Lines Matching defs:kb

113 static int ep11_kb_split(const u8 *kb, size_t kblen, u32 kbver,
124 hdr = (struct ep11kblob_header *)kb;
141 pl = (u8 *)kb + hdrsize;
157 static int ep11_kb_decode(const u8 *kb, size_t kblen,
169 tmph = (struct ep11kblob_header *)kb;
175 if (ep11_kb_split(kb, kblen, tmph->version,
208 struct ep11keyblob *kb;
210 if (ep11_kb_decode(keyblob, keybloblen, NULL, NULL, &kb, NULL))
212 return kb->wkvp;
223 struct ep11keyblob *kb = (struct ep11keyblob *)(key + sizeof(*hdr));
227 if (keylen < sizeof(*hdr) + sizeof(*kb)) {
229 __func__, keylen, sizeof(*hdr) + sizeof(*kb));
257 if (hdr->len < sizeof(*hdr) + sizeof(*kb)) {
260 __func__, (int)hdr->len, sizeof(*hdr) + sizeof(*kb));
264 if (kb->version != EP11_STRUCT_MAGIC) {
267 __func__, (int)kb->version, EP11_STRUCT_MAGIC);
270 if (checkcpacfexp && !(kb->attr & EP11_BLOB_PKEY_EXTRACTABLE)) {
290 struct ep11keyblob *kb = (struct ep11keyblob *)(key + sizeof(*hdr));
294 if (keylen < sizeof(*hdr) + sizeof(*kb)) {
296 __func__, keylen, sizeof(*hdr) + sizeof(*kb));
324 if (hdr->len < sizeof(*hdr) + sizeof(*kb)) {
327 __func__, (int)hdr->len, sizeof(*hdr) + sizeof(*kb));
331 if (kb->version != EP11_STRUCT_MAGIC) {
334 __func__, (int)kb->version, EP11_STRUCT_MAGIC);
337 if (checkcpacfexp && !(kb->attr & EP11_BLOB_PKEY_EXTRACTABLE)) {
357 struct ep11keyblob *kb = (struct ep11keyblob *)key;
361 if (keylen < sizeof(*kb)) {
363 __func__, keylen, sizeof(*kb));
367 if (kb->head.type != TOKTYPE_NON_CCA) {
370 __func__, (int)kb->head.type, TOKTYPE_NON_CCA);
373 if (kb->head.version != TOKVER_EP11_AES) {
376 __func__, (int)kb->head.version, TOKVER_EP11_AES);
379 if (kb->head.len > keylen) {
382 __func__, (int)kb->head.len, keylen);
385 if (kb->head.len < sizeof(*kb)) {
388 __func__, (int)kb->head.len, sizeof(*kb));
392 if (kb->version != EP11_STRUCT_MAGIC) {
395 __func__, (int)kb->version, EP11_STRUCT_MAGIC);
398 if (checkcpacfexp && !(kb->attr & EP11_BLOB_PKEY_EXTRACTABLE)) {