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