Lines Matching full:kb
118 static int ep11_kb_split(const u8 *kb, size_t kblen, u32 kbver, in ep11_kb_split() argument
129 hdr = (struct ep11kblob_header *)kb; in ep11_kb_split()
146 pl = (u8 *)kb + hdrsize; in ep11_kb_split()
162 static int ep11_kb_decode(const u8 *kb, size_t kblen, in ep11_kb_decode() argument
174 tmph = (struct ep11kblob_header *)kb; in ep11_kb_decode()
180 if (ep11_kb_split(kb, kblen, tmph->version, in ep11_kb_decode()
213 struct ep11keyblob *kb; in ep11_kb_wkvp() local
215 if (ep11_kb_decode(keyblob, keybloblen, NULL, NULL, &kb, NULL)) in ep11_kb_wkvp()
217 return kb->wkvp; in ep11_kb_wkvp()
228 struct ep11keyblob *kb = (struct ep11keyblob *)(key + sizeof(*hdr)); in ep11_check_aes_key_with_hdr() local
232 if (keylen < sizeof(*hdr) + sizeof(*kb)) { in ep11_check_aes_key_with_hdr()
234 __func__, keylen, sizeof(*hdr) + sizeof(*kb)); in ep11_check_aes_key_with_hdr()
262 if (hdr->len < sizeof(*hdr) + sizeof(*kb)) { in ep11_check_aes_key_with_hdr()
265 __func__, (int)hdr->len, sizeof(*hdr) + sizeof(*kb)); in ep11_check_aes_key_with_hdr()
269 if (kb->version != EP11_STRUCT_MAGIC) { in ep11_check_aes_key_with_hdr()
272 __func__, (int)kb->version, EP11_STRUCT_MAGIC); in ep11_check_aes_key_with_hdr()
275 if (checkcpacfexp && !(kb->attr & EP11_BLOB_PKEY_EXTRACTABLE)) { in ep11_check_aes_key_with_hdr()
295 struct ep11keyblob *kb = (struct ep11keyblob *)(key + sizeof(*hdr)); in ep11_check_ecc_key_with_hdr() local
299 if (keylen < sizeof(*hdr) + sizeof(*kb)) { in ep11_check_ecc_key_with_hdr()
301 __func__, keylen, sizeof(*hdr) + sizeof(*kb)); in ep11_check_ecc_key_with_hdr()
329 if (hdr->len < sizeof(*hdr) + sizeof(*kb)) { in ep11_check_ecc_key_with_hdr()
332 __func__, (int)hdr->len, sizeof(*hdr) + sizeof(*kb)); in ep11_check_ecc_key_with_hdr()
336 if (kb->version != EP11_STRUCT_MAGIC) { in ep11_check_ecc_key_with_hdr()
339 __func__, (int)kb->version, EP11_STRUCT_MAGIC); in ep11_check_ecc_key_with_hdr()
342 if (checkcpacfexp && !(kb->attr & EP11_BLOB_PKEY_EXTRACTABLE)) { in ep11_check_ecc_key_with_hdr()
362 struct ep11keyblob *kb = (struct ep11keyblob *)key; in ep11_check_aes_key() local
366 if (keylen < sizeof(*kb)) { in ep11_check_aes_key()
368 __func__, keylen, sizeof(*kb)); in ep11_check_aes_key()
372 if (kb->head.type != TOKTYPE_NON_CCA) { in ep11_check_aes_key()
375 __func__, (int)kb->head.type, TOKTYPE_NON_CCA); in ep11_check_aes_key()
378 if (kb->head.version != TOKVER_EP11_AES) { in ep11_check_aes_key()
381 __func__, (int)kb->head.version, TOKVER_EP11_AES); in ep11_check_aes_key()
384 if (kb->head.len > keylen) { in ep11_check_aes_key()
387 __func__, (int)kb->head.len, keylen); in ep11_check_aes_key()
390 if (kb->head.len < sizeof(*kb)) { in ep11_check_aes_key()
393 __func__, (int)kb->head.len, sizeof(*kb)); in ep11_check_aes_key()
397 if (kb->version != EP11_STRUCT_MAGIC) { in ep11_check_aes_key()
400 __func__, (int)kb->version, EP11_STRUCT_MAGIC); in ep11_check_aes_key()
403 if (checkcpacfexp && !(kb->attr & EP11_BLOB_PKEY_EXTRACTABLE)) { in ep11_check_aes_key()