Lines Matching +full:2 +full:kb

113 static int ep11_kb_split(const u8 *kb, size_t kblen, u32 kbver,  in ep11_kb_split()  argument
124 hdr = (struct ep11kblob_header *)kb; in ep11_kb_split()
141 pl = (u8 *)kb + hdrsize; in ep11_kb_split()
157 static int ep11_kb_decode(const u8 *kb, size_t kblen, in ep11_kb_decode() argument
169 tmph = (struct ep11kblob_header *)kb; in ep11_kb_decode()
175 if (ep11_kb_split(kb, kblen, tmph->version, in ep11_kb_decode()
208 struct ep11keyblob *kb; in ep11_kb_wkvp() local
210 if (ep11_kb_decode(keyblob, keybloblen, NULL, NULL, &kb, NULL)) in ep11_kb_wkvp()
212 return kb->wkvp; in ep11_kb_wkvp()
223 struct ep11keyblob *kb = (struct ep11keyblob *)(key + sizeof(*hdr)); in ep11_check_aes_key_with_hdr() local
227 if (keylen < sizeof(*hdr) + sizeof(*kb)) { in ep11_check_aes_key_with_hdr()
229 __func__, keylen, sizeof(*hdr) + sizeof(*kb)); in ep11_check_aes_key_with_hdr()
257 if (hdr->len < sizeof(*hdr) + sizeof(*kb)) { in ep11_check_aes_key_with_hdr()
260 __func__, (int)hdr->len, sizeof(*hdr) + sizeof(*kb)); in ep11_check_aes_key_with_hdr()
264 if (kb->version != EP11_STRUCT_MAGIC) { in ep11_check_aes_key_with_hdr()
267 __func__, (int)kb->version, EP11_STRUCT_MAGIC); in ep11_check_aes_key_with_hdr()
270 if (checkcpacfexp && !(kb->attr & EP11_BLOB_PKEY_EXTRACTABLE)) { in ep11_check_aes_key_with_hdr()
290 struct ep11keyblob *kb = (struct ep11keyblob *)(key + sizeof(*hdr)); in ep11_check_ecc_key_with_hdr() local
294 if (keylen < sizeof(*hdr) + sizeof(*kb)) { in ep11_check_ecc_key_with_hdr()
296 __func__, keylen, sizeof(*hdr) + sizeof(*kb)); in ep11_check_ecc_key_with_hdr()
324 if (hdr->len < sizeof(*hdr) + sizeof(*kb)) { in ep11_check_ecc_key_with_hdr()
327 __func__, (int)hdr->len, sizeof(*hdr) + sizeof(*kb)); in ep11_check_ecc_key_with_hdr()
331 if (kb->version != EP11_STRUCT_MAGIC) { in ep11_check_ecc_key_with_hdr()
334 __func__, (int)kb->version, EP11_STRUCT_MAGIC); in ep11_check_ecc_key_with_hdr()
337 if (checkcpacfexp && !(kb->attr & EP11_BLOB_PKEY_EXTRACTABLE)) { in ep11_check_ecc_key_with_hdr()
357 struct ep11keyblob *kb = (struct ep11keyblob *)key; in ep11_check_aes_key() local
361 if (keylen < sizeof(*kb)) { in ep11_check_aes_key()
363 __func__, keylen, sizeof(*kb)); in ep11_check_aes_key()
367 if (kb->head.type != TOKTYPE_NON_CCA) { in ep11_check_aes_key()
370 __func__, (int)kb->head.type, TOKTYPE_NON_CCA); in ep11_check_aes_key()
373 if (kb->head.version != TOKVER_EP11_AES) { in ep11_check_aes_key()
376 __func__, (int)kb->head.version, TOKVER_EP11_AES); in ep11_check_aes_key()
379 if (kb->head.len > keylen) { in ep11_check_aes_key()
382 __func__, (int)kb->head.len, keylen); in ep11_check_aes_key()
385 if (kb->head.len < sizeof(*kb)) { in ep11_check_aes_key()
388 __func__, (int)kb->head.len, sizeof(*kb)); in ep11_check_aes_key()
392 if (kb->version != EP11_STRUCT_MAGIC) { in ep11_check_aes_key()
395 __func__, (int)kb->version, EP11_STRUCT_MAGIC); in ep11_check_aes_key()
398 if (checkcpacfexp && !(kb->attr & EP11_BLOB_PKEY_EXTRACTABLE)) { in ep11_check_aes_key()
425 memcpy(cprb->func_id, "T4", 2); in alloc_cprb()
434 * Limited to length info <= 2 byte.
437 #define ASN1TAGLEN(x) (2 + (x) + ((x) > 127 ? 1 : 0) + ((x) > 255 ? 1 : 0))
444 *((u16 *)(ptr + 2)) = valuelen; in asn1tag_write()
450 ptr[2] = (u8)valuelen; in asn1tag_write()
455 memcpy(ptr + 2, pvalue, valuelen); in asn1tag_write()
456 return 2 + valuelen; in asn1tag_write()
523 pl += 2; in check_reply_pl()
556 pl += 2; in check_reply_pl()
771 p_dom_info->dom_flags & 0x08 ? '2' : '1'; in ep11_get_domain_info()
1080 p += 2; in ep11_cryptsingle()
1448 /* Step 2: encrypt clear key value with the kek key */ in ep11_clr2keyblob()
1557 case 2: /* TDES */ in ep11_kblob2protkey()