Lines Matching refs:NULL

136     return NULL;  in xor_prov_get_keymgmt_new()
147 return NULL; in xor_prov_get_keymgmt_free()
158 return NULL; in xor_prov_get_keymgmt_import()
169 return NULL; in xor_prov_get_keymgmt_export()
179 void *key = NULL; in xor_prov_import_key()
181 if (kmgmt_new != NULL && kmgmt_import != NULL && kmgmt_free != NULL) { in xor_prov_import_key()
182 if ((key = kmgmt_new(provctx)) == NULL in xor_prov_import_key()
185 key = NULL; in xor_prov_import_key()
195 if (kmgmt_free != NULL) in xor_prov_free_key()
406 if (dummy_group_names[i] == NULL) { in tls_prov_get_capabilities()
408 if (dummy_group_names[i] == NULL) in tls_prov_get_capabilities()
439 if (prov_ctx == NULL) in xor_newprovctx()
440 return NULL; in xor_newprovctx()
442 if (libctx == NULL) { in xor_newprovctx()
444 return NULL; in xor_newprovctx()
469 if (pxorctx == NULL) in xor_newkemkexctx()
470 return NULL; in xor_newkemkexctx()
482 if (pxorctx == NULL || vkey == NULL) in xor_init()
492 if (pxorctx == NULL || vpeerkey == NULL) in xor_set_peer()
504 if (pxorctx->key == NULL || pxorctx->peerkey == NULL) in xor_derive()
508 if (secret == NULL) in xor_derive()
531 if (dstctx == NULL) in xor_dupctx()
532 return NULL; in xor_dupctx()
555 { NULL, NULL, NULL }
576 void *genctx = NULL, *derivectx = NULL; in xor_encapsulate()
577 XORKEY *ourkey = NULL; in xor_encapsulate()
580 if (ct == NULL || ss == NULL) { in xor_encapsulate()
583 if (ctlen == NULL && sslen == NULL) in xor_encapsulate()
585 if (ctlen != NULL) in xor_encapsulate()
587 if (sslen != NULL) in xor_encapsulate()
593 genctx = xor_gen_init(pxorctx->provctx, OSSL_KEYMGMT_SELECT_KEYPAIR, NULL); in xor_encapsulate()
594 if (genctx == NULL) in xor_encapsulate()
596 ourkey = xor_gen(genctx, NULL, NULL); in xor_encapsulate()
597 if (ourkey == NULL) in xor_encapsulate()
606 if (derivectx == NULL in xor_encapsulate()
607 || !xor_init(derivectx, ourkey, NULL) in xor_encapsulate()
632 void *derivectx = NULL; in xor_decapsulate()
633 XORKEY *peerkey = NULL; in xor_decapsulate()
636 if (ss == NULL) { in xor_decapsulate()
638 if (sslen == NULL) in xor_decapsulate()
647 if (peerkey == NULL) in xor_decapsulate()
653 if (derivectx == NULL in xor_decapsulate()
654 || !xor_init(derivectx, pxorctx->key, NULL) in xor_decapsulate()
684 { NULL, NULL, NULL }
693 if (ret == NULL) in xor_newkey()
694 return NULL; in xor_newkey()
698 return NULL; in xor_newkey()
709 if (key == NULL) in xor_freekey()
719 if (key != NULL) { in xor_freekey()
721 key->tls_name = NULL; in xor_freekey()
743 if (key != NULL) { in xor_has()
756 XORKEY *tokey = xor_newkey(NULL); in xor_dup()
760 if (tokey != NULL && fromkey != NULL) { in xor_dup()
779 if (fromkey->tls_name != NULL) in xor_dup()
784 tokey = NULL; in xor_dup()
794 if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_BITS)) != NULL in xor_get_params()
798 if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_SECURITY_BITS)) != NULL in xor_get_params()
803 OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY)) != NULL) { in xor_get_params()
807 if (p->data != NULL && p->data_size >= XOR_KEY_SIZE) in xor_get_params()
815 OSSL_PARAM_int(OSSL_PKEY_PARAM_BITS, NULL),
816 OSSL_PARAM_int(OSSL_PKEY_PARAM_SECURITY_BITS, NULL),
817 OSSL_PARAM_octet_string(OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY, NULL, 0),
832 if (p != NULL) { in xor_set_params()
844 OSSL_PARAM_octet_string(OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY, NULL, 0),
850 XORKEY *key = NULL; in xor_load()
856 *(XORKEY **)reference = NULL; in xor_load()
859 return NULL; in xor_load()
879 if (key1->tls_name != NULL && key2->tls_name != NULL) in xor_match()
927 struct xor_gen_ctx *gctx = NULL; in xor_gen_init()
931 return NULL; in xor_gen_init()
933 if ((gctx = OPENSSL_zalloc(sizeof(*gctx))) != NULL) in xor_gen_init()
940 return NULL; in xor_gen_init()
950 if (gctx == NULL) in xor_gen_set_params()
954 if (p != NULL) { in xor_gen_set_params()
968 OSSL_PARAM_utf8_string(OSSL_PKEY_PARAM_GROUP_NAME, NULL, 0), in xor_gen_settable_params()
977 XORKEY *key = xor_newkey(NULL); in xor_gen()
980 if (key == NULL) in xor_gen()
981 return NULL; in xor_gen()
986 return NULL; in xor_gen()
1009 if (key == NULL || (select & OSSL_KEYMGMT_SELECT_KEYPAIR) == 0) in xor_import()
1017 if ((param_priv_key != NULL in xor_import()
1020 || (param_pub_key != NULL in xor_import()
1044 if (key == NULL || (select & OSSL_KEYMGMT_SELECT_KEYPAIR) == 0) in xor_export()
1058 OSSL_PARAM_BN(OSSL_PKEY_PARAM_PUB_KEY, NULL, 0),
1059 OSSL_PARAM_BN(OSSL_PKEY_PARAM_PRIV_KEY, NULL, 0),
1065 return (select & OSSL_KEYMGMT_SELECT_KEYPAIR) != 0 ? xor_key_types : NULL; in xor_import_types()
1070 if (provctx == NULL) in xor_import_types_ex()
1071 return NULL; in xor_import_types_ex()
1078 return (select & OSSL_KEYMGMT_SELECT_KEYPAIR) != 0 ? xor_key_types : NULL; in xor_export_types()
1083 if (provctx == NULL) in xor_export_types_ex()
1084 return NULL; in xor_export_types_ex()
1123 if (k == NULL) in xor_xorhmacsig_gen()
1124 return NULL; in xor_xorhmacsig_gen()
1126 if (k->tls_name == NULL) { in xor_xorhmacsig_gen()
1128 return NULL; in xor_xorhmacsig_gen()
1137 if (k == NULL) in xor_xorhmacsha2sig_gen()
1138 return NULL; in xor_xorhmacsha2sig_gen()
1140 if (k->tls_name == NULL) { in xor_xorhmacsha2sig_gen()
1142 return NULL; in xor_xorhmacsha2sig_gen()
1208 XORKEY *key = NULL; in xor_key_op()
1211 if (palg != NULL) { in xor_key_op()
1215 X509_ALGOR_get0(NULL, &ptype, NULL, palg); in xor_key_op()
1216 if (ptype != V_ASN1_UNDEF || palg->algorithm == NULL) { in xor_key_op()
1223 if (p == NULL || nid == EVP_PKEY_NONE || nid == NID_undef) { in xor_key_op()
1228 key = xor_newkey(NULL); in xor_key_op()
1229 if (key == NULL) { in xor_key_op()
1248 if (key->tls_name == NULL) in xor_key_op()
1254 return NULL; in xor_key_op()
1264 if (!xpk || (!X509_PUBKEY_get0_param(NULL, &p, &plen, &palg, xpk))) { in xor_key_from_x509pubkey()
1265 return NULL; in xor_key_from_x509pubkey()
1273 XORKEY *xork = NULL; in xor_key_from_pkcs8()
1276 ASN1_OCTET_STRING *oct = NULL; in xor_key_from_pkcs8()
1279 if (!PKCS8_pkey_get0(NULL, &p, &plen, &palg, p8inf)) in xor_key_from_pkcs8()
1282 oct = d2i_ASN1_OCTET_STRING(NULL, &p, plen); in xor_key_from_pkcs8()
1283 if (oct == NULL) { in xor_key_from_pkcs8()
1284 p = NULL; in xor_key_from_pkcs8()
1309 { NULL, NULL, NULL }
1355 unsigned char *der = NULL; in key_to_p8info()
1358 PKCS8_PRIV_KEY_INFO *p8info = NULL; in key_to_p8info()
1360 if ((p8info = PKCS8_PRIV_KEY_INFO_new()) == NULL in key_to_p8info()
1363 V_ASN1_UNDEF, NULL, in key_to_p8info()
1368 p8info = NULL; in key_to_p8info()
1377 X509_SIG *p8 = NULL; in p8info_to_encp8()
1382 if (ctx->cipher == NULL || ctx->pwcb == NULL) in p8info_to_encp8()
1383 return NULL; in p8info_to_encp8()
1385 if (!ctx->pwcb(kstr, PEM_BUFSIZE, &klen, NULL, ctx->pwcbarg)) { in p8info_to_encp8()
1387 return NULL; in p8info_to_encp8()
1390 p8 = PKCS8_encrypt_ex(-1, ctx->cipher, kstr, klen, NULL, 0, 0, p8info, libctx, NULL); in p8info_to_encp8()
1401 X509_SIG *p8 = NULL; in key_to_encp8()
1403 if (p8info == NULL) { in key_to_encp8()
1417 unsigned char *der = NULL; in xorx_key_to_pubkey()
1420 X509_PUBKEY *xpk = NULL; in xorx_key_to_pubkey()
1422 if ((xpk = X509_PUBKEY_new()) == NULL in xorx_key_to_pubkey()
1425 V_ASN1_UNDEF, NULL, in xorx_key_to_pubkey()
1430 xpk = NULL; in xorx_key_to_pubkey()
1463 void *str = NULL; in key_to_epki_der_priv_bio()
1470 if (p2s != NULL && !p2s(key, key_nid, ctx->save_parameters, in key_to_epki_der_priv_bio()
1475 if (p8 != NULL) in key_to_epki_der_priv_bio()
1491 void *str = NULL; in key_to_epki_pem_priv_bio()
1498 if (p2s != NULL && !p2s(key, key_nid, ctx->save_parameters, in key_to_epki_pem_priv_bio()
1503 if (p8 != NULL) in key_to_epki_pem_priv_bio()
1519 void *str = NULL; in key_to_pki_der_priv_bio()
1527 if (p2s != NULL && !p2s(key, key_nid, ctx->save_parameters, in key_to_pki_der_priv_bio()
1533 if (p8info != NULL) in key_to_pki_der_priv_bio()
1551 void *str = NULL; in key_to_pki_pem_priv_bio()
1559 if (p2s != NULL && !p2s(key, key_nid, ctx->save_parameters, in key_to_pki_pem_priv_bio()
1565 if (p8info != NULL) in key_to_pki_pem_priv_bio()
1583 X509_PUBKEY *xpk = NULL; in key_to_spki_der_pub_bio()
1584 void *str = NULL; in key_to_spki_der_pub_bio()
1587 if (p2s != NULL && !p2s(key, key_nid, ctx->save_parameters, in key_to_spki_der_pub_bio()
1593 if (xpk != NULL) in key_to_spki_der_pub_bio()
1608 X509_PUBKEY *xpk = NULL; in key_to_spki_pem_pub_bio()
1609 void *str = NULL; in key_to_spki_pem_pub_bio()
1612 if (p2s != NULL && !p2s(key, key_nid, ctx->save_parameters, in key_to_spki_pem_pub_bio()
1618 if (xpk != NULL) in key_to_spki_pem_pub_bio()
1633 ASN1_OBJECT *params = NULL; in prepare_xorx_params()
1648 if (params == NULL || OBJ_length(params) == 0) { in prepare_xorx_params()
1665 if (xorxkey == NULL) { in xorx_spki_pub_to_der()
1671 if (keyblob == NULL) { in xorx_spki_pub_to_der()
1683 unsigned char* buf = NULL; in xorx_pki_priv_to_der()
1687 if (xorxkey == NULL) { in xorx_pki_priv_to_der()
1716 # define xorx_check_key_type NULL
1734 if (ctx != NULL) { in key2any_newctx()
1753 OSSL_PARAM_utf8_string(OSSL_ENCODER_PARAM_CIPHER, NULL, 0), in key2any_settable_ctx_params()
1754 OSSL_PARAM_utf8_string(OSSL_ENCODER_PARAM_PROPERTIES, NULL, 0), in key2any_settable_ctx_params()
1772 if (cipherp != NULL) { in key2any_set_ctx_params()
1773 const char *ciphername = NULL; in key2any_set_ctx_params()
1774 const char *props = NULL; in key2any_set_ctx_params()
1778 if (propsp != NULL && !OSSL_PARAM_get_utf8_string_ptr(propsp, &props)) in key2any_set_ctx_params()
1782 ctx->cipher = NULL; in key2any_set_ctx_params()
1783 ctx->cipher_intent = ciphername != NULL; in key2any_set_ctx_params()
1784 if (ciphername != NULL in key2any_set_ctx_params()
1786 EVP_CIPHER_fetch(libctx, ciphername, props)) == NULL)) { in key2any_set_ctx_params()
1791 if (save_paramsp != NULL) { in key2any_set_ctx_params()
1842 if (key == NULL || type <= 0) { in key2any_encode()
1844 } else if (writer != NULL) { in key2any_encode()
1847 if (out != NULL) { in key2any_encode()
1885 NULL, NULL, NULL, \
1987 if (key_abstract != NULL) { \
2108 { NULL, NULL, NULL }
2185 if (xpub == NULL)
2186 return NULL;
2189 libctx, NULL);
2208 BUF_MEM *mem = NULL; in xor_read_der()
2227 PKCS8_PRIV_KEY_INFO *p8inf = NULL; in xor_der2key_decode_p8()
2228 const X509_ALGOR *alg = NULL; in xor_der2key_decode_p8()
2229 void *key = NULL; in xor_der2key_decode_p8()
2231 if ((p8inf = d2i_PKCS8_PRIV_KEY_INFO(NULL, input_der, input_der_len)) != NULL in xor_der2key_decode_p8()
2232 && PKCS8_pkey_get0(NULL, NULL, NULL, &alg, p8inf) in xor_der2key_decode_p8()
2234 key = key_from_pkcs8(p8inf, PROV_XOR_LIBCTX_OF(ctx->provctx), NULL); in xor_der2key_decode_p8()
2243 XORKEY *key = NULL; in xor_d2i_PUBKEY()
2246 xpk = xorx_d2i_X509_PUBKEY_INTERNAL(pp, length, NULL); in xor_d2i_PUBKEY()
2248 key = xor_key_from_x509pubkey(xpk, NULL, NULL); in xor_d2i_PUBKEY()
2250 if (key == NULL) in xor_d2i_PUBKEY()
2253 if (a != NULL) { in xor_d2i_PUBKEY()
2275 if (ctx != NULL) { in der2key_newctx()
2331 unsigned char *der = NULL; in xor_der2key_decode()
2334 void *key = NULL; in xor_der2key_decode()
2361 if (ctx->desc->d2i_PKCS8 != NULL) { in xor_der2key_decode()
2362 key = ctx->desc->d2i_PKCS8(NULL, &derp, der_len, ctx); in xor_der2key_decode()
2365 } else if (ctx->desc->d2i_private_key != NULL) { in xor_der2key_decode()
2366 key = ctx->desc->d2i_private_key(NULL, &derp, der_len); in xor_der2key_decode()
2368 if (key == NULL && ctx->selection != 0) in xor_der2key_decode()
2371 if (key == NULL && (selection & OSSL_KEYMGMT_SELECT_PUBLIC_KEY) != 0) { in xor_der2key_decode()
2373 if (ctx->desc->d2i_PUBKEY != NULL) in xor_der2key_decode()
2374 key = ctx->desc->d2i_PUBKEY(NULL, &derp, der_len); in xor_der2key_decode()
2376 key = ctx->desc->d2i_public_key(NULL, &derp, der_len); in xor_der2key_decode()
2377 if (key == NULL && ctx->selection != 0) in xor_der2key_decode()
2380 if (key == NULL && (selection & OSSL_KEYMGMT_SELECT_ALL_PARAMETERS) != 0) { in xor_der2key_decode()
2382 if (ctx->desc->d2i_key_params != NULL) in xor_der2key_decode()
2383 key = ctx->desc->d2i_key_params(NULL, &derp, der_len); in xor_der2key_decode()
2384 if (key == NULL && ctx->selection != 0) in xor_der2key_decode()
2395 if (key != NULL in xor_der2key_decode()
2396 && ctx->desc->check_key != NULL in xor_der2key_decode()
2399 key = NULL; in xor_der2key_decode()
2402 if (key != NULL && ctx->desc->adjust_key != NULL) in xor_der2key_decode()
2418 der = NULL; in xor_der2key_decode()
2420 if (key != NULL) { in xor_der2key_decode()
2455 if (reference_sz == sizeof(keydata) && export != NULL) { in der2key_export_object()
2482 NULL, \
2483 NULL, \
2484 NULL, \
2486 NULL, \
2487 NULL, \
2494 NULL, \
2495 NULL, \
2496 NULL, \
2497 NULL, \
2499 NULL, \
2583 { NULL, NULL, NULL }
2615 X509_ALGOR_set0(algor, OBJ_txt2obj(tls_name, 0), V_ASN1_UNDEF, NULL); in xor_get_aid()
2655 if (pxor_sigctx == NULL) in xor_sig_newctx()
2656 return NULL; in xor_sig_newctx()
2660 if (propq != NULL && (pxor_sigctx->propq = OPENSSL_strdup(propq)) == NULL) { in xor_sig_newctx()
2662 pxor_sigctx = NULL; in xor_sig_newctx()
2673 if (mdprops == NULL) in xor_sig_setup_md()
2678 if ((md == NULL) || (EVP_MD_nid(md)==NID_undef)) { in xor_sig_setup_md()
2679 if (md == NULL) in xor_sig_setup_md()
2687 ctx->mdctx = NULL; in xor_sig_setup_md()
2689 ctx->md = NULL; in xor_sig_setup_md()
2692 ctx->aid = NULL; in xor_sig_setup_md()
2699 ctx->mdctx = NULL; in xor_sig_setup_md()
2710 if (pxor_sigctx == NULL || vxorsig == NULL) in xor_sig_signverify_init()
2717 if ((operation==EVP_PKEY_OP_SIGN && pxor_sigctx->sig == NULL) in xor_sig_signverify_init()
2718 || (operation==EVP_PKEY_OP_VERIFY && pxor_sigctx->sig == NULL)) { in xor_sig_signverify_init()
2747 if (xorkey == NULL || !xorkey->hasprivkey) { in xor_sig_sign()
2752 if (sig == NULL) { in xor_sig_sign()
2765 if (!EVP_Q_mac(pxor_sigctx->libctx, "HMAC", NULL, "sha1", NULL, in xor_sig_sign()
2789 if (xorkey == NULL || sig == NULL || tbs == NULL) { in xor_sig_verify()
2803 if (!EVP_Q_mac(pxor_sigctx->libctx, "HMAC", NULL, "sha1", NULL, in xor_sig_verify()
2824 if (rmdname == NULL) in xor_sig_digest_signverify_init()
2831 if (!xor_sig_setup_md(pxor_sigctx, rmdname, NULL)) in xor_sig_digest_signverify_init()
2835 if (pxor_sigctx->mdctx == NULL) in xor_sig_digest_signverify_init()
2838 if (!EVP_DigestInit_ex(pxor_sigctx->mdctx, pxor_sigctx->md, NULL)) in xor_sig_digest_signverify_init()
2846 pxor_sigctx->mdctx = NULL; in xor_sig_digest_signverify_init()
2847 pxor_sigctx->md = NULL; in xor_sig_digest_signverify_init()
2870 if (pxor_sigctx == NULL || pxor_sigctx->mdctx == NULL) in xor_sig_digest_signverify_update()
2884 if (sig != NULL) { in xor_sig_digest_sign_final()
2885 if (pxor_sigctx == NULL || pxor_sigctx->mdctx == NULL) in xor_sig_digest_sign_final()
2905 if (pxor_sigctx == NULL || pxor_sigctx->mdctx == NULL) in xor_sig_digest_verify_final()
2923 ctx->propq = NULL; in xor_sig_freectx()
2924 ctx->mdctx = NULL; in xor_sig_freectx()
2925 ctx->md = NULL; in xor_sig_freectx()
2927 ctx->sig = NULL; in xor_sig_freectx()
2938 if (dstctx == NULL) in xor_sig_dupctx()
2939 return NULL; in xor_sig_dupctx()
2942 dstctx->sig = NULL; in xor_sig_dupctx()
2943 dstctx->md = NULL; in xor_sig_dupctx()
2944 dstctx->mdctx = NULL; in xor_sig_dupctx()
2945 dstctx->aid = NULL; in xor_sig_dupctx()
2947 if ((srcctx->sig != NULL) && !xor_key_up_ref(srcctx->sig)) in xor_sig_dupctx()
2951 if (srcctx->md != NULL && !EVP_MD_up_ref(srcctx->md)) in xor_sig_dupctx()
2955 if (srcctx->mdctx != NULL) { in xor_sig_dupctx()
2957 if (dstctx->mdctx == NULL in xor_sig_dupctx()
2965 return NULL; in xor_sig_dupctx()
2973 if (pxor_sigctx == NULL || params == NULL) in xor_sig_get_ctx_params()
2978 if (pxor_sigctx->aid == NULL) in xor_sig_get_ctx_params()
2981 if (p != NULL in xor_sig_get_ctx_params()
2986 if (p != NULL && !OSSL_PARAM_set_utf8_string(p, pxor_sigctx->mdname)) in xor_sig_get_ctx_params()
2993 OSSL_PARAM_octet_string(OSSL_SIGNATURE_PARAM_ALGORITHM_ID, NULL, 0),
2994 OSSL_PARAM_utf8_string(OSSL_SIGNATURE_PARAM_DIGEST, NULL, 0),
3008 if (pxor_sigctx == NULL || params == NULL) in xor_sig_set_ctx_params()
3013 if (p != NULL && !pxor_sigctx->flag_allow_md) in xor_sig_set_ctx_params()
3015 if (p != NULL) { in xor_sig_set_ctx_params()
3024 if (propsp != NULL in xor_sig_set_ctx_params()
3035 OSSL_PARAM_utf8_string(OSSL_SIGNATURE_PARAM_DIGEST, NULL, 0),
3036 OSSL_PARAM_utf8_string(OSSL_SIGNATURE_PARAM_PROPERTIES, NULL, 0),
3050 if (pxor_sigctx->mdctx == NULL) in xor_sig_get_ctx_md_params()
3060 if (pxor_sigctx->md == NULL) in xor_sig_gettable_ctx_md_params()
3070 if (pxor_sigctx->mdctx == NULL) in xor_sig_set_ctx_md_params()
3080 if (pxor_sigctx->md == NULL) in xor_sig_settable_ctx_md_params()
3134 { NULL, NULL, NULL }
3156 return NULL; in tls_prov_query()
3168 dummy_group_names[i] = NULL; in tls_prov_teardown()
3221 OSSL_FUNC_core_obj_create_fn *c_obj_create= NULL; in tls_provider_init()
3222 OSSL_FUNC_core_obj_add_sigid_fn *c_obj_add_sigid= NULL; in tls_provider_init()
3225 if (libctx == NULL || xor_prov_ctx == NULL) in tls_provider_init()
3268 if (!c_obj_create(handle, XORSIGALG_HASH_OID, XORSIGALG_HASH_NAME, NULL)) { in tls_provider_init()
3283 *provctx = NULL; in tls_provider_init()