Lines Matching +full:256 +full:kb
123 struct ep11keyblob *kb = (struct ep11keyblob *) (key + sizeof(*hdr)); in ep11_check_aes_key_with_hdr() local
127 if (keylen < sizeof(*hdr) + sizeof(*kb)) { in ep11_check_aes_key_with_hdr()
129 __func__, keylen, sizeof(*hdr) + sizeof(*kb)); in ep11_check_aes_key_with_hdr()
157 if (hdr->len < sizeof(*hdr) + sizeof(*kb)) { in ep11_check_aes_key_with_hdr()
160 __func__, (int) hdr->len, sizeof(*hdr) + sizeof(*kb)); in ep11_check_aes_key_with_hdr()
164 if (kb->version != EP11_STRUCT_MAGIC) { in ep11_check_aes_key_with_hdr()
167 __func__, (int) kb->version, EP11_STRUCT_MAGIC); in ep11_check_aes_key_with_hdr()
170 if (checkcpacfexp && !(kb->attr & EP11_BLOB_PKEY_EXTRACTABLE)) { in ep11_check_aes_key_with_hdr()
190 struct ep11keyblob *kb = (struct ep11keyblob *) (key + sizeof(*hdr)); in ep11_check_ecc_key_with_hdr() local
194 if (keylen < sizeof(*hdr) + sizeof(*kb)) { in ep11_check_ecc_key_with_hdr()
196 __func__, keylen, sizeof(*hdr) + sizeof(*kb)); in ep11_check_ecc_key_with_hdr()
224 if (hdr->len < sizeof(*hdr) + sizeof(*kb)) { in ep11_check_ecc_key_with_hdr()
227 __func__, (int) hdr->len, sizeof(*hdr) + sizeof(*kb)); in ep11_check_ecc_key_with_hdr()
231 if (kb->version != EP11_STRUCT_MAGIC) { in ep11_check_ecc_key_with_hdr()
234 __func__, (int) kb->version, EP11_STRUCT_MAGIC); in ep11_check_ecc_key_with_hdr()
237 if (checkcpacfexp && !(kb->attr & EP11_BLOB_PKEY_EXTRACTABLE)) { in ep11_check_ecc_key_with_hdr()
257 struct ep11keyblob *kb = (struct ep11keyblob *) key; in ep11_check_aes_key() local
261 if (keylen < sizeof(*kb)) { in ep11_check_aes_key()
263 __func__, keylen, sizeof(*kb)); in ep11_check_aes_key()
267 if (kb->head.type != TOKTYPE_NON_CCA) { in ep11_check_aes_key()
270 __func__, (int) kb->head.type, TOKTYPE_NON_CCA); in ep11_check_aes_key()
273 if (kb->head.version != TOKVER_EP11_AES) { in ep11_check_aes_key()
276 __func__, (int) kb->head.version, TOKVER_EP11_AES); in ep11_check_aes_key()
279 if (kb->head.len > keylen) { in ep11_check_aes_key()
282 __func__, (int) kb->head.len, keylen); in ep11_check_aes_key()
285 if (kb->head.len < sizeof(*kb)) { in ep11_check_aes_key()
288 __func__, (int) kb->head.len, sizeof(*kb)); in ep11_check_aes_key()
292 if (kb->version != EP11_STRUCT_MAGIC) { in ep11_check_aes_key()
295 __func__, (int) kb->version, EP11_STRUCT_MAGIC); in ep11_check_aes_key()
298 if (checkcpacfexp && !(kb->attr & EP11_BLOB_PKEY_EXTRACTABLE)) { in ep11_check_aes_key()
705 struct ep11keyblob *kb; in ep11_genaeskey() local
711 case 256: in ep11_genaeskey()
787 kb = (struct ep11keyblob *) keybuf; in ep11_genaeskey()
788 kb->head.type = TOKTYPE_NON_CCA; in ep11_genaeskey()
789 kb->head.len = rep_pl->data_len; in ep11_genaeskey()
790 kb->head.version = TOKVER_EP11_AES; in ep11_genaeskey()
791 kb->head.keybitlen = keybitsize; in ep11_genaeskey()
970 struct ep11keyblob *kb; in ep11_unwrapkey() local
1055 kb = (struct ep11keyblob *) keybuf; in ep11_unwrapkey()
1056 kb->head.type = TOKTYPE_NON_CCA; in ep11_unwrapkey()
1057 kb->head.len = rep_pl->data_len; in ep11_unwrapkey()
1058 kb->head.version = TOKVER_EP11_AES; in ep11_unwrapkey()
1059 kb->head.keybitlen = keybitsize; in ep11_unwrapkey()
1101 struct ep11keyblob *kb; in ep11_wrapkey() local
1108 kb = (struct ep11keyblob *) key; in ep11_wrapkey()
1109 if (kb->head.type == TOKTYPE_NON_CCA && in ep11_wrapkey()
1110 kb->head.version == TOKVER_EP11_AES) { in ep11_wrapkey()
1112 keysize = kb->head.len < keysize ? kb->head.len : keysize; in ep11_wrapkey()
1141 kb = (struct ep11keyblob *)(p - keysize); in ep11_wrapkey()
1142 memset(&kb->head, 0, sizeof(kb->head)); in ep11_wrapkey()
1205 struct ep11keyblob *kb; in ep11_clr2keyblob() local
1209 if (keybitsize == 128 || keybitsize == 192 || keybitsize == 256) in ep11_clr2keyblob()
1226 /* Step 1: generate AES 256 bit random kek key */ in ep11_clr2keyblob()
1227 rc = ep11_genaeskey(card, domain, 256, in ep11_clr2keyblob()
1236 kb = (struct ep11keyblob *) kek; in ep11_clr2keyblob()
1237 memset(&kb->head, 0, sizeof(kb->head)); in ep11_clr2keyblob()
1346 /* AES 256 protected key */ in ep11_kblob2protkey()
1404 /* allocate 1k space for up to 256 apqns */ in ep11_findcard2()
1405 _apqns = kmalloc_array(256, sizeof(u32), GFP_KERNEL); in ep11_findcard2()
1447 if (_nr_apqns < 256) in ep11_findcard2()