Lines Matching +full:0 +full:x10020000

33 static const u8 def_iv[16] = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
34 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff };
54 rc = 0; in card_cache_fetch()
65 int found = 0; in card_cache_update()
135 DBF("%s key check failed, type 0x%02x != 0x%02x\n", in ep11_check_aes_key_with_hdr()
139 if (hdr->hver != 0x00) { in ep11_check_aes_key_with_hdr()
141 DBF("%s key check failed, header version 0x%02x != 0x00\n", in ep11_check_aes_key_with_hdr()
147 DBF("%s key check failed, version 0x%02x != 0x%02x\n", in ep11_check_aes_key_with_hdr()
166 DBF("%s key check failed, blob magic 0x%04x != 0x%04x\n", in ep11_check_aes_key_with_hdr()
179 return 0; in ep11_check_aes_key_with_hdr()
202 DBF("%s key check failed, type 0x%02x != 0x%02x\n", in ep11_check_ecc_key_with_hdr()
206 if (hdr->hver != 0x00) { in ep11_check_ecc_key_with_hdr()
208 DBF("%s key check failed, header version 0x%02x != 0x00\n", in ep11_check_ecc_key_with_hdr()
214 DBF("%s key check failed, version 0x%02x != 0x%02x\n", in ep11_check_ecc_key_with_hdr()
233 DBF("%s key check failed, blob magic 0x%04x != 0x%04x\n", in ep11_check_ecc_key_with_hdr()
246 return 0; in ep11_check_ecc_key_with_hdr()
269 DBF("%s key check failed, type 0x%02x != 0x%02x\n", in ep11_check_aes_key()
275 DBF("%s key check failed, version 0x%02x != 0x%02x\n", in ep11_check_aes_key()
294 DBF("%s key check failed, blob magic 0x%04x != 0x%04x\n", in ep11_check_aes_key()
307 return 0; in ep11_check_aes_key()
324 cprb->cprb_ver_id = 0x04; in alloc_cprb()
326 cprb->ret_code = 0xFFFFFFFF; in alloc_cprb()
337 #define ASN1TAGLEN(x) (2 + (x) + ((x) > 127 ? 1 : 0) + ((x) > 255 ? 1 : 0))
341 ptr[0] = tag; in asn1tag_write()
343 ptr[1] = 0x82; in asn1tag_write()
349 ptr[1] = 0x81; in asn1tag_write()
376 h->tag = 0x30; in prep_head()
377 h->lenfmt = 0x82; in prep_head()
379 h->func_tag = 0x04; in prep_head()
382 h->dom_tag = 0x04; in prep_head()
400 /* Check ep11 reply payload, return 0 or suggested errno value. */
407 if (*pl++ != 0x30) { in check_reply_pl()
416 } else if (*pl == 0x81) { in check_reply_pl()
420 } else if (*pl == 0x82) { in check_reply_pl()
425 DEBUG_ERR("%s reply start tag lenfmt mismatch 0x%02hhx\n", in check_reply_pl()
437 if (pl[0] != 0x04 || pl[1] != 0x04) { in check_reply_pl()
444 if (pl[0] != 0x04 || pl[1] != 0x04) { in check_reply_pl()
451 if (pl[0] != 0x04 || pl[1] != 0x04) { in check_reply_pl()
457 if (ret != 0) { in check_reply_pl()
458 DEBUG_ERR("%s return value 0x%04x != 0\n", func, ret); in check_reply_pl()
462 return 0; in check_reply_pl()
501 req_pl->query_type_tag = 0x04; in ep11_query_info()
504 req_pl->query_subtype_tag = 0x04; in ep11_query_info()
534 if (rep_pl->data_tag != 0x04 || rep_pl->data_lenfmt != 0x82) { in ep11_query_info()
594 0x01 /* module info query */, in ep11_get_card_info()
601 memset(info, 0, sizeof(*info)); in ep11_get_card_info()
634 rc = ep11_query_info(card, domain, 0x03 /* domain info query */, in ep11_get_domain_info()
639 memset(info, 0, sizeof(*info)); in ep11_get_domain_info()
640 info->cur_wk_state = '0'; in ep11_get_domain_info()
641 info->new_wk_state = '0'; in ep11_get_domain_info()
642 if (p_dom_info->dom_flags & 0x10 /* left imprint mode */) { in ep11_get_domain_info()
643 if (p_dom_info->dom_flags & 0x02 /* cur wk valid */) { in ep11_get_domain_info()
647 if (p_dom_info->dom_flags & 0x04 /* new wk present */ in ep11_get_domain_info()
648 || p_dom_info->dom_flags & 0x08 /* new wk committed */) { in ep11_get_domain_info()
650 p_dom_info->dom_flags & 0x08 ? '2' : '1'; in ep11_get_domain_info()
666 #define KEY_ATTR_DEFAULTS 0x00200c00
726 api = (!keygenflags || keygenflags & 0x00200000) ? 4 : 1; in ep11_genaeskey()
728 req_pl->var_tag = 0x04; in ep11_genaeskey()
730 req_pl->keybytes_tag = 0x04; in ep11_genaeskey()
733 req_pl->mech_tag = 0x04; in ep11_genaeskey()
735 req_pl->mech = 0x00001080; /* CKM_AES_KEY_GEN */ in ep11_genaeskey()
736 req_pl->attr_tag = 0x04; in ep11_genaeskey()
738 req_pl->attr_header = 0x10010000; in ep11_genaeskey()
741 req_pl->attr_val_len_type = 0x00000161; /* CKA_VALUE_LEN */ in ep11_genaeskey()
743 req_pl->pin_tag = 0x04; in ep11_genaeskey()
772 if (rep_pl->data_tag != 0x04 || rep_pl->data_lenfmt != 0x82) { in ep11_genaeskey()
838 if (keysize > 0xFFFF || inbufsize > 0xFFFF) in ep11_cryptsingle()
842 req_pl_size = sizeof(struct crypt_req_pl) + (iv ? 16 : 0) in ep11_cryptsingle()
849 req_pl->var_tag = 0x04; in ep11_cryptsingle()
852 req_pl->mech_tag = 0x04; in ep11_cryptsingle()
853 req_pl->mech_len = sizeof(u32) + (iv ? 16 : 0); in ep11_cryptsingle()
854 req_pl->mech = (mech ? mech : 0x00001085); /* CKM_AES_CBC_PAD */ in ep11_cryptsingle()
861 p += asn1tag_write(p, 0x04, key, keysize); in ep11_cryptsingle()
862 p += asn1tag_write(p, 0x04, inbuf, inbufsize); in ep11_cryptsingle()
892 if (rep_pl->data_tag != 0x04) { in ep11_cryptsingle()
900 else if (rep_pl->data_lenfmt == 0x81) in ep11_cryptsingle()
902 else if (rep_pl->data_lenfmt == 0x82) { in ep11_cryptsingle()
906 DEBUG_ERR("%s unknown reply data length format 0x%02hhx\n", in ep11_cryptsingle()
976 req_pl_size = sizeof(struct uw_req_pl) + (iv ? 16 : 0) in ep11_unwrapkey()
982 api = (!keygenflags || keygenflags & 0x00200000) ? 4 : 1; in ep11_unwrapkey()
984 req_pl->attr_tag = 0x04; in ep11_unwrapkey()
986 req_pl->attr_header = 0x10020000; in ep11_unwrapkey()
989 req_pl->attr_key_type = 0x00000100; /* CKA_KEY_TYPE */ in ep11_unwrapkey()
990 req_pl->attr_key_type_value = 0x0000001f; /* CKK_AES */ in ep11_unwrapkey()
991 req_pl->attr_val_len = 0x00000161; /* CKA_VALUE_LEN */ in ep11_unwrapkey()
994 req_pl->mech_tag = 0x04; in ep11_unwrapkey()
995 req_pl->mech_len = sizeof(u32) + (iv ? 16 : 0); in ep11_unwrapkey()
996 req_pl->mech = (mech ? mech : 0x00001085); /* CKM_AES_CBC_PAD */ in ep11_unwrapkey()
1003 p += asn1tag_write(p, 0x04, kek, keksize); in ep11_unwrapkey()
1005 *p++ = 0x04; in ep11_unwrapkey()
1006 *p++ = 0; in ep11_unwrapkey()
1008 *p++ = 0x04; in ep11_unwrapkey()
1009 *p++ = 0; in ep11_unwrapkey()
1011 p += asn1tag_write(p, 0x04, enckey, enckeysize); in ep11_unwrapkey()
1040 if (rep_pl->data_tag != 0x04 || rep_pl->data_lenfmt != 0x82) { in ep11_unwrapkey()
1116 req_pl_size = sizeof(struct wk_req_pl) + (iv ? 16 : 0) in ep11_wrapkey()
1121 if (!mech || mech == 0x80060001) in ep11_wrapkey()
1122 req->flags |= 0x20; /* CPACF_WRAP needs special bit */ in ep11_wrapkey()
1124 api = (!mech || mech == 0x80060001) ? 4 : 1; /* CKM_IBM_CPACF_WRAP */ in ep11_wrapkey()
1126 req_pl->var_tag = 0x04; in ep11_wrapkey()
1129 req_pl->mech_tag = 0x04; in ep11_wrapkey()
1130 req_pl->mech_len = sizeof(u32) + (iv ? 16 : 0); in ep11_wrapkey()
1131 req_pl->mech = (mech ? mech : 0x80060001); /* CKM_IBM_CPACF_WRAP */ in ep11_wrapkey()
1138 p += asn1tag_write(p, 0x04, key, keysize); in ep11_wrapkey()
1142 memset(&kb->head, 0, sizeof(kb->head)); in ep11_wrapkey()
1145 *p++ = 0x04; in ep11_wrapkey()
1146 *p++ = 0; in ep11_wrapkey()
1148 *p++ = 0x04; in ep11_wrapkey()
1149 *p++ = 0; in ep11_wrapkey()
1178 if (rep_pl->data_tag != 0x04 || rep_pl->data_lenfmt != 0x82) { in ep11_wrapkey()
1228 0x00006c00, /* EN/DECRYPT, WRAP/UNWRAP */ in ep11_clr2keyblob()
1237 memset(&kb->head, 0, sizeof(kb->head)); in ep11_clr2keyblob()
1240 rc = ep11_cryptsingle(card, domain, 0, 0, def_iv, kek, keklen, in ep11_clr2keyblob()
1251 encbuf, encbuflen, 0, def_iv, in ep11_clr2keyblob()
1252 keybitsize, 0, keybuf, keybufsize); in ep11_clr2keyblob()
1279 u8 pkey[0]; in ep11_kblob2protkey()
1314 0, def_iv, wkbuf, &wkbuflen); in ep11_kblob2protkey()
1391 u32 *_apqns = NULL, _nr_apqns = 0; in ep11_findcard2()
1412 for (i = 0; i < MAX_ZDEV_ENTRIES_EXT; i++) { in ep11_findcard2()
1419 if (!(device_status[i].functions & 0x01)) in ep11_findcard2()
1422 if (cardnr != 0xFFFF && card != cardnr) in ep11_findcard2()
1425 if (domain != 0xFFFF && dom != domain) in ep11_findcard2()
1431 if (minapi > 0) { in ep11_findcard2()
1432 if (ep11_get_card_info(card, &eci, 0)) in ep11_findcard2()
1459 rc = 0; in ep11_findcard2()