Lines Matching +full:0 +full:x0080000
139 memset(&mechanism, 0, sizeof(mechanism)); in p11_rsa_private_encrypt()
177 memset(&mechanism, 0, sizeof(mechanism)); in p11_rsa_private_decrypt()
225 new_method = RSA_meth_new("hx509 PKCS11 PKCS#1 RSA", 0); in get_p11_rsa_pkcs1_method()
273 hx509_set_error_string(context, 0, HX509_PKCS11_NO_MECH, in p11_mech_info()
278 if (i == 0) { in p11_mech_info()
279 hx509_set_error_string(context, 0, HX509_PKCS11_NO_MECH, in p11_mech_info()
283 slot->mechs.list = calloc(i, sizeof(slot->mechs.list[0])); in p11_mech_info()
285 hx509_set_error_string(context, 0, ENOMEM, in p11_mech_info()
292 hx509_set_error_string(context, 0, HX509_PKCS11_NO_MECH, in p11_mech_info()
301 hx509_set_error_string(context, 0, ENOMEM, in p11_mech_info()
306 for (i = 0; i < slot->mechs.num; i++) { in p11_mech_info()
307 slot->mechs.infos[i] = calloc(1, sizeof(*(slot->mechs.infos[0]))); in p11_mech_info()
309 hx509_set_error_string(context, 0, ENOMEM, in p11_mech_info()
316 hx509_set_error_string(context, 0, HX509_PKCS11_NO_MECH, in p11_mech_info()
323 return 0; in p11_mech_info()
345 hx509_set_error_string(context, 0, HX509_PKCS11_TOKEN_CONFUSED, in p11_init_slot()
351 for (i = sizeof(slot_info.slotDescription) - 1; i > 0; i--) { in p11_init_slot()
353 if (c == ' ' || c == '\t' || c == '\n' || c == '\r' || c == '\0') in p11_init_slot()
362 if ((slot_info.flags & CKF_TOKEN_PRESENT) == 0) in p11_init_slot()
363 return 0; in p11_init_slot()
367 hx509_set_error_string(context, 0, HX509_PKCS11_NO_TOKEN, in p11_init_slot()
369 "with error 0x08x", in p11_init_slot()
408 return 0; in p11_get_session()
418 hx509_set_error_string(context, 0, HX509_PKCS11_OPEN_SESSION, in p11_get_session()
420 "with error: 0x%08x", in p11_get_session()
440 && (slot->flags & P11_LOGIN_DONE) == 0 in p11_get_session()
449 memset(&prompt, 0, sizeof(prompt)); in p11_get_session()
461 hx509_set_error_string(context, 0, ret, in p11_get_session()
476 hx509_set_error_string(context, 0, HX509_PKCS11_LOGIN, in p11_get_session()
478 "with error: 0x%08x", in p11_get_session()
488 hx509_set_error_string(context, 0, ENOMEM, in p11_get_session()
500 return 0; in p11_get_session()
508 if ((slot->flags & P11_SESSION_IN_USE) == 0) in p11_put_session()
512 return 0; in p11_put_session()
540 if (object_count == 0) in iterate_entries()
543 for (i = 0; i < num_query; i++) in iterate_entries()
551 for (i = 0; i < num_query; i++) { in iterate_entries()
569 for (i = 0; i < num_query; i++) { in iterate_entries()
577 for (i = 0; i < num_query; i++) { in iterate_entries()
604 query.ulValueLen = 0; in getattr_bn()
641 localKeyId.data = query[0].pValue; in collect_private_key()
642 localKeyId.length = query[0].ulValueLen; in collect_private_key()
675 if (p->ref == 0) in collect_private_key()
676 _hx509_abort("pkcs11 ref == 0 on alloc"); in collect_private_key()
702 return 0; in collect_private_key()
724 if ((CK_LONG)query[0].ulValueLen == -1 || in collect_cert()
727 return 0; in collect_cert()
735 if (p->ref == 0) in collect_cert()
736 _hx509_abort("pkcs11 ref == 0 on alloc"); in collect_cert()
746 data.data = query[0].pValue; in collect_cert()
747 data.length = query[0].ulValueLen; in collect_cert()
784 {CKA_CLASS, NULL, 0}, in p11_list_keys()
787 {CKA_ID, NULL, 0}, in p11_list_keys()
788 {CKA_VALUE, NULL, 0}, in p11_list_keys()
789 {CKA_LABEL, NULL, 0} in p11_list_keys()
793 search_data[0].pValue = &key_class; in p11_list_keys()
794 search_data[0].ulValueLen = sizeof(key_class); in p11_list_keys()
854 *str++ = '\0'; in p11_init()
859 *strnext++ = '\0'; in p11_init()
860 #if 0 in p11_init()
861 if (strncasecmp(str, "slot=", 5) == 0) in p11_init()
871 hx509_set_error_string(context, 0, ret, in p11_init()
879 hx509_set_error_string(context, 0, ret, in p11_init()
888 hx509_set_error_string(context, 0, ret, in p11_init()
896 hx509_set_error_string(context, 0, ret, in p11_init()
904 hx509_set_error_string(context, 0, ret, in p11_init()
909 if (p->num_slots == 0) { in p11_init()
911 hx509_set_error_string(context, 0, ret, in p11_init()
919 int num_tokens = 0; in p11_init()
932 hx509_set_error_string(context, 0, HX509_PKCS11_TOKEN_CONFUSED, in p11_init()
939 p->slot = calloc(p->num_slots, sizeof(p->slot[0])); in p11_init()
942 hx509_set_error_string(context, 0, ENOMEM, in p11_init()
948 for (i = 0; i < p->num_slots; i++) { in p11_init()
958 if (num_tokens == 0) { in p11_init()
966 return 0; in p11_init()
977 if (p->ref == 0) in p11_release_module()
979 if (--p->ref > 0) in p11_release_module()
982 for (i = 0; i < p->num_slots; i++) { in p11_release_module()
992 memset(p->slot[i].pin, 0, strlen(p->slot[i].pin)); in p11_release_module()
1001 for (j = 0 ; j < p->slot[i].mechs.num ; j++) in p11_release_module()
1015 memset(p, 0, sizeof(*p)); in p11_release_module()
1025 for (i = 0; i < p->num_slots; i++) { in p11_free()
1030 return 0; in p11_free()
1052 ret = hx509_certs_init(context, "MEMORY:pkcs11-iter", 0, NULL, &c->certs); in p11_iter_start()
1058 for (i = 0 ; i < p->num_slots; i++) { in p11_iter_start()
1073 return 0; in p11_iter_start()
1077 return 0; in p11_iter_start()
1102 MECHFLAG(0x80000000),
1103 MECHFLAG(0x40000000),
1104 MECHFLAG(0x20000000),
1105 MECHFLAG(0x10000000),
1106 MECHFLAG(0x08000000),
1107 MECHFLAG(0x04000000),
1108 {"ec-compress", 0x2000000 },
1109 {"ec-uncompress", 0x1000000 },
1110 {"ec-namedcurve", 0x0800000 },
1111 {"ec-ecparameters", 0x0400000 },
1112 {"ec-f-2m", 0x0200000 },
1113 {"ec-f-p", 0x0100000 },
1114 {"derive", 0x0080000 },
1115 {"unwrap", 0x0040000 },
1116 {"wrap", 0x0020000 },
1117 {"genereate-key-pair", 0x0010000 },
1118 {"generate", 0x0008000 },
1119 {"verify-recover", 0x0004000 },
1120 {"verify", 0x0002000 },
1121 {"sign-recover", 0x0001000 },
1122 {"sign", 0x0000800 },
1123 {"digest", 0x0000400 },
1124 {"decrypt", 0x0000200 },
1125 {"encrypt", 0x0000100 },
1126 MECHFLAG(0x00080),
1127 MECHFLAG(0x00040),
1128 MECHFLAG(0x00020),
1129 MECHFLAG(0x00010),
1130 MECHFLAG(0x00008),
1131 MECHFLAG(0x00004),
1132 MECHFLAG(0x00002),
1133 {"hw", 0x0000001 },
1134 { NULL, 0x0000000 }
1151 for (i = 0; i < p->num_slots; i++) { in p11_printinfo()
1159 for (j = 0; j < s->mechs.num; j++) { in p11_printinfo()
1203 return 0; in p11_printinfo()
1208 0,