Lines Matching refs:NULL

89     return NULL;  in ec_query_operation_name()
101 return NULL; in sm2_query_operation_name()
118 BIGNUM *x = NULL, *y = NULL; in key_to_params()
119 const BIGNUM *priv_key = NULL; in key_to_params()
120 const EC_POINT *pub_point = NULL; in key_to_params()
121 const EC_GROUP *ecg = NULL; in key_to_params()
124 BN_CTX *bnctx = NULL; in key_to_params()
126 if (eckey == NULL in key_to_params()
127 || (ecg = EC_KEY_get0_group(eckey)) == NULL) in key_to_params()
133 if (pub_point != NULL) { in key_to_params()
134 OSSL_PARAM *p = NULL, *px = NULL, *py = NULL; in key_to_params()
140 if (bnctx == NULL) in key_to_params()
145 if (tmpl == NULL) { in key_to_params()
151 if (p != NULL || tmpl != NULL) { in key_to_params()
163 if (px != NULL || py != NULL) { in key_to_params()
164 if (px != NULL) { in key_to_params()
166 if (x == NULL) in key_to_params()
169 if (py != NULL) { in key_to_params()
171 if (y == NULL) in key_to_params()
177 if (px != NULL in key_to_params()
181 if (py != NULL in key_to_params()
188 if (priv_key != NULL && include_private) { in key_to_params()
246 const char *name = NULL; in otherparams_to_params()
249 if (ec == NULL) in otherparams_to_params()
254 if (name != NULL in otherparams_to_params()
262 if (name != NULL in otherparams_to_params()
284 return NULL; in ec_newdata()
285 return EC_KEY_new_ex(PROV_LIBCTX_OF(provctx), NULL); in ec_newdata()
294 return NULL; in sm2_newdata()
295 return EC_KEY_new_by_curve_name_ex(PROV_LIBCTX_OF(provctx), NULL, NID_sm2); in sm2_newdata()
312 if (!ossl_prov_is_running() || ec == NULL) in ec_has()
318 ok = ok && (EC_KEY_get0_public_key(ec) != NULL); in ec_has()
320 ok = ok && (EC_KEY_get0_private_key(ec) != NULL); in ec_has()
322 ok = ok && (EC_KEY_get0_group(ec) != NULL); in ec_has()
337 BN_CTX *ctx = NULL; in ec_match()
344 if (ctx == NULL) in ec_match()
348 ok = ok && group_a != NULL && group_b != NULL in ec_match()
357 if (pa != NULL && pb != NULL) { in ec_match()
367 if (pa != NULL && pb != NULL) { in ec_match()
380 const EC_GROUP *ecg = NULL; in common_check_sm2()
386 if ((ecg = EC_KEY_get0_group(ec)) == NULL in common_check_sm2()
399 if (!ossl_prov_is_running() || ec == NULL) in common_import()
456 OSSL_PARAM_BLD *tmpl = NULL; in ec_export()
457 OSSL_PARAM *params = NULL; in ec_export()
458 unsigned char *pub_key = NULL, *genbuf = NULL; in ec_export()
459 BN_CTX *bnctx = NULL; in ec_export()
462 if (!ossl_prov_is_running() || ec == NULL) in ec_export()
485 if (tmpl == NULL) in ec_export()
490 if (bnctx == NULL) { in ec_export()
495 ok = ok && ossl_ec_group_todata(EC_KEY_get0_group(ec), tmpl, NULL, in ec_export()
505 ok = ok && key_to_params(ec, tmpl, NULL, include_private, &pub_key); in ec_export()
508 ok = ok && otherparams_to_params(ec, tmpl, NULL); in ec_export()
510 if (!ok || (params = OSSL_PARAM_BLD_to_param(tmpl)) == NULL) { in ec_export()
529 OSSL_PARAM_utf8_string(OSSL_PKEY_PARAM_GROUP_NAME, NULL, 0), \
530 OSSL_PARAM_utf8_string(OSSL_PKEY_PARAM_EC_ENCODING, NULL, 0), \
531 OSSL_PARAM_utf8_string(OSSL_PKEY_PARAM_EC_POINT_CONVERSION_FORMAT, NULL, 0),\
532 OSSL_PARAM_utf8_string(OSSL_PKEY_PARAM_EC_FIELD_TYPE, NULL, 0), \
533 OSSL_PARAM_BN(OSSL_PKEY_PARAM_EC_P, NULL, 0), \
534 OSSL_PARAM_BN(OSSL_PKEY_PARAM_EC_A, NULL, 0), \
535 OSSL_PARAM_BN(OSSL_PKEY_PARAM_EC_B, NULL, 0), \
536 OSSL_PARAM_octet_string(OSSL_PKEY_PARAM_EC_GENERATOR, NULL, 0), \
537 OSSL_PARAM_BN(OSSL_PKEY_PARAM_EC_ORDER, NULL, 0), \
538 OSSL_PARAM_BN(OSSL_PKEY_PARAM_EC_COFACTOR, NULL, 0), \
539 OSSL_PARAM_octet_string(OSSL_PKEY_PARAM_EC_SEED, NULL, 0), \
540 OSSL_PARAM_int(OSSL_PKEY_PARAM_EC_DECODED_FROM_EXPLICIT_PARAMS, NULL)
543 OSSL_PARAM_octet_string(OSSL_PKEY_PARAM_PUB_KEY, NULL, 0)
545 OSSL_PARAM_BN(OSSL_PKEY_PARAM_PRIV_KEY, NULL, 0)
547 OSSL_PARAM_int(OSSL_PKEY_PARAM_USE_COFACTOR_ECDH, NULL), \
548 OSSL_PARAM_int(OSSL_PKEY_PARAM_EC_INCLUDE_PUBLIC, NULL)
595 const char *basis_name = NULL; in ec_get_ecm_params()
610 if (!ossl_param_build_set_int(NULL, params, OSSL_PKEY_PARAM_EC_CHAR2_M, m) in ec_get_ecm_params()
611 || !ossl_param_build_set_utf8_string(NULL, params, in ec_get_ecm_params()
618 || !ossl_param_build_set_int(NULL, params, in ec_get_ecm_params()
624 || !ossl_param_build_set_int(NULL, params, in ec_get_ecm_params()
626 || !ossl_param_build_set_int(NULL, params, in ec_get_ecm_params()
628 || !ossl_param_build_set_int(NULL, params, in ec_get_ecm_params()
643 const EC_GROUP *ecg = NULL; in common_get_params()
645 unsigned char *pub_key = NULL, *genbuf = NULL; in common_get_params()
648 BN_CTX *bnctx = NULL; in common_get_params()
651 if (ecg == NULL) { in common_get_params()
660 if (bnctx == NULL) in common_get_params()
664 if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_MAX_SIZE)) != NULL in common_get_params()
667 if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_BITS)) != NULL in common_get_params()
670 if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_SECURITY_BITS)) != NULL) { in common_get_params()
710 != NULL) { in common_get_params()
719 if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_DEFAULT_DIGEST)) != NULL in common_get_params()
723 if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_DEFAULT_DIGEST)) != NULL in common_get_params()
731 if (p != NULL) { in common_get_params()
742 OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY)) != NULL) { in common_get_params()
745 if (ecp == NULL) { in common_get_params()
757 && ossl_ec_group_todata(ecg, NULL, params, libctx, propq, bnctx, in common_get_params()
759 && key_to_params(eck, NULL, params, 1, &pub_key) in common_get_params()
760 && otherparams_to_params(eck, NULL, params); in common_get_params()
777 OSSL_PARAM_int(OSSL_PKEY_PARAM_EC_CHAR2_M, NULL), \
778 OSSL_PARAM_utf8_string(OSSL_PKEY_PARAM_EC_CHAR2_TYPE, NULL, 0), \
779 OSSL_PARAM_int(OSSL_PKEY_PARAM_EC_CHAR2_TP_BASIS, NULL), \
780 OSSL_PARAM_int(OSSL_PKEY_PARAM_EC_CHAR2_PP_K1, NULL), \
781 OSSL_PARAM_int(OSSL_PKEY_PARAM_EC_CHAR2_PP_K2, NULL), \
782 OSSL_PARAM_int(OSSL_PKEY_PARAM_EC_CHAR2_PP_K3, NULL),
788 OSSL_PARAM_int(OSSL_PKEY_PARAM_BITS, NULL),
789 OSSL_PARAM_int(OSSL_PKEY_PARAM_SECURITY_BITS, NULL),
790 OSSL_PARAM_int(OSSL_PKEY_PARAM_MAX_SIZE, NULL),
791 OSSL_PARAM_utf8_string(OSSL_PKEY_PARAM_DEFAULT_DIGEST, NULL, 0),
792 OSSL_PARAM_octet_string(OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY, NULL, 0),
793 OSSL_PARAM_int(OSSL_PKEY_PARAM_EC_DECODED_FROM_EXPLICIT_PARAMS, NULL),
797 OSSL_PARAM_BN(OSSL_PKEY_PARAM_EC_PUB_X, NULL, 0),
798 OSSL_PARAM_BN(OSSL_PKEY_PARAM_EC_PUB_Y, NULL, 0),
811 OSSL_PARAM_int(OSSL_PKEY_PARAM_USE_COFACTOR_ECDH, NULL),
812 OSSL_PARAM_octet_string(OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY, NULL, 0),
813 OSSL_PARAM_utf8_string(OSSL_PKEY_PARAM_EC_ENCODING, NULL, 0),
814 OSSL_PARAM_utf8_string(OSSL_PKEY_PARAM_EC_POINT_CONVERSION_FORMAT, NULL, 0),
815 OSSL_PARAM_octet_string(OSSL_PKEY_PARAM_EC_SEED, NULL, 0),
816 OSSL_PARAM_int(OSSL_PKEY_PARAM_EC_INCLUDE_PUBLIC, NULL),
817 OSSL_PARAM_utf8_string(OSSL_PKEY_PARAM_EC_GROUP_CHECK_TYPE, NULL, 0),
833 if (key == NULL) in ec_set_params()
842 if (p != NULL) { in ec_set_params()
846 if (ctx == NULL in ec_set_params()
867 OSSL_PARAM_int(OSSL_PKEY_PARAM_BITS, NULL),
868 OSSL_PARAM_int(OSSL_PKEY_PARAM_SECURITY_BITS, NULL),
869 OSSL_PARAM_int(OSSL_PKEY_PARAM_MAX_SIZE, NULL),
870 OSSL_PARAM_utf8_string(OSSL_PKEY_PARAM_DEFAULT_DIGEST, NULL, 0),
871 OSSL_PARAM_octet_string(OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY, NULL, 0),
872 OSSL_PARAM_int(OSSL_PKEY_PARAM_EC_DECODED_FROM_EXPLICIT_PARAMS, NULL),
875 OSSL_PARAM_octet_string(OSSL_PKEY_PARAM_EC_PUB_X, NULL, 0),
876 OSSL_PARAM_octet_string(OSSL_PKEY_PARAM_EC_PUB_Y, NULL, 0),
888 OSSL_PARAM_octet_string(OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY, NULL, 0),
903 BN_CTX *ctx = NULL; in sm2_validate()
912 if (ctx == NULL) in sm2_validate()
942 BN_CTX *ctx = NULL; in ec_validate()
951 if (ctx == NULL) in ec_validate()
1003 struct ec_gen_ctx *gctx = NULL; in ec_gen_init()
1006 return NULL; in ec_gen_init()
1008 if ((gctx = OPENSSL_zalloc(sizeof(*gctx))) != NULL) { in ec_gen_init()
1015 gctx = NULL; in ec_gen_init()
1028 if (gctx != NULL) { in sm2_gen_init()
1029 if (gctx->group_name != NULL) in sm2_gen_init()
1031 if ((gctx->group_name = OPENSSL_strdup("sm2")) != NULL) in sm2_gen_init()
1035 return NULL; in sm2_gen_init()
1046 if (group == NULL) { in ec_gen_set_group()
1061 if (!ossl_prov_is_running() || gctx == NULL || ec == NULL) in ec_gen_set_template()
1063 if ((ec_group = EC_KEY_get0_group(ec)) == NULL) in ec_gen_set_template()
1070 if (p != NULL && !OSSL_PARAM_get_int(p, &val)) \
1075 if (p != NULL) { \
1080 if (val == NULL) \
1086 if (p != NULL) { \
1092 if (val == NULL) \
1098 if (p != NULL) { \
1099 if (bn == NULL) \
1101 if (bn == NULL || !OSSL_PARAM_get_BN(p, &bn)) \
1110 EC_GROUP *group = NULL; in ec_gen_set_params()
1147 OSSL_PARAM *params = NULL; in ec_gen_set_group_from_params()
1148 EC_GROUP *group = NULL; in ec_gen_set_group_from_params()
1151 if (bld == NULL) in ec_gen_set_group_from_params()
1154 if (gctx->encoding != NULL in ec_gen_set_group_from_params()
1159 if (gctx->pt_format != NULL in ec_gen_set_group_from_params()
1165 if (gctx->group_name != NULL) { in ec_gen_set_group_from_params()
1171 } else if (gctx->field_type != NULL) { in ec_gen_set_group_from_params()
1178 if (gctx->p == NULL in ec_gen_set_group_from_params()
1179 || gctx->a == NULL in ec_gen_set_group_from_params()
1180 || gctx->b == NULL in ec_gen_set_group_from_params()
1181 || gctx->order == NULL in ec_gen_set_group_from_params()
1188 if (gctx->cofactor != NULL in ec_gen_set_group_from_params()
1193 if (gctx->seed != NULL in ec_gen_set_group_from_params()
1198 if (gctx->gen == NULL in ec_gen_set_group_from_params()
1204 if (params == NULL) in ec_gen_set_group_from_params()
1206 group = EC_GROUP_new_from_params(params, gctx->libctx, NULL); in ec_gen_set_group_from_params()
1207 if (group == NULL) in ec_gen_set_group_from_params()
1224 OSSL_PARAM_utf8_string(OSSL_PKEY_PARAM_GROUP_NAME, NULL, 0), in ec_gen_settable_params()
1225 OSSL_PARAM_int(OSSL_PKEY_PARAM_USE_COFACTOR_ECDH, NULL), in ec_gen_settable_params()
1226 OSSL_PARAM_utf8_string(OSSL_PKEY_PARAM_EC_ENCODING, NULL, 0), in ec_gen_settable_params()
1227 OSSL_PARAM_utf8_string(OSSL_PKEY_PARAM_EC_POINT_CONVERSION_FORMAT, NULL, 0), in ec_gen_settable_params()
1228 OSSL_PARAM_utf8_string(OSSL_PKEY_PARAM_EC_FIELD_TYPE, NULL, 0), in ec_gen_settable_params()
1229 OSSL_PARAM_BN(OSSL_PKEY_PARAM_EC_P, NULL, 0), in ec_gen_settable_params()
1230 OSSL_PARAM_BN(OSSL_PKEY_PARAM_EC_A, NULL, 0), in ec_gen_settable_params()
1231 OSSL_PARAM_BN(OSSL_PKEY_PARAM_EC_B, NULL, 0), in ec_gen_settable_params()
1232 OSSL_PARAM_octet_string(OSSL_PKEY_PARAM_EC_GENERATOR, NULL, 0), in ec_gen_settable_params()
1233 OSSL_PARAM_BN(OSSL_PKEY_PARAM_EC_ORDER, NULL, 0), in ec_gen_settable_params()
1234 OSSL_PARAM_BN(OSSL_PKEY_PARAM_EC_COFACTOR, NULL, 0), in ec_gen_settable_params()
1235 OSSL_PARAM_octet_string(OSSL_PKEY_PARAM_EC_SEED, NULL, 0), in ec_gen_settable_params()
1236 OSSL_PARAM_octet_string(OSSL_PKEY_PARAM_DHKEM_IKM, NULL, 0), in ec_gen_settable_params()
1257 if (gctx == NULL) in ec_gen_get_params()
1268 if (group == NULL) { in ec_gen_assign_group()
1281 EC_KEY *ec = NULL; in ec_gen()
1285 || gctx == NULL in ec_gen()
1286 || (ec = EC_KEY_new_ex(gctx->libctx, NULL)) == NULL) in ec_gen()
1287 return NULL; in ec_gen()
1289 if (gctx->gen_group == NULL) { in ec_gen()
1293 if (gctx->encoding != NULL) { in ec_gen()
1300 if (gctx->pt_format != NULL) { in ec_gen()
1325 if (gctx->dhkem_ikm != NULL && gctx->dhkem_ikmlen != 0) in ec_gen()
1336 if (gctx->group_check != NULL) in ec_gen()
1344 return NULL; in ec_gen()
1355 EC_KEY *ec = NULL; in sm2_gen()
1358 if (gctx == NULL in sm2_gen()
1359 || (ec = EC_KEY_new_ex(gctx->libctx, NULL)) == NULL) in sm2_gen()
1360 return NULL; in sm2_gen()
1362 if (gctx->gen_group == NULL) { in sm2_gen()
1373 if (gctx->pt_format != NULL) { in sm2_gen()
1394 return NULL; in sm2_gen()
1403 if (gctx == NULL) in ec_gen_cleanup()
1425 EC_KEY *ec = NULL; in common_load()
1432 return NULL; in common_load()
1435 *(EC_KEY **)reference = NULL; in common_load()
1438 return NULL; in common_load()
1459 return NULL; in ec_dup()