Loading crypto/ec/ec_cvt.c +7 −31 Original line number Diff line number Diff line Loading @@ -69,6 +69,8 @@ * */ #define OPENSSL_FIPSAPI #include <openssl/err.h> #include "ec_lcl.h" Loading @@ -78,34 +80,9 @@ EC_GROUP *EC_GROUP_new_curve_GFp(const BIGNUM *p, const BIGNUM *a, const BIGNUM const EC_METHOD *meth; EC_GROUP *ret; if (BN_nist_mod_func(p)) meth = EC_GFp_nist_method(); ret = EC_GROUP_new(meth); if (ret == NULL) return NULL; if (!EC_GROUP_set_curve_GFp(ret, p, a, b, ctx)) { unsigned long err; err = ERR_peek_last_error(); if (!(ERR_GET_LIB(err) == ERR_LIB_EC && ((ERR_GET_REASON(err) == EC_R_NOT_A_NIST_PRIME) || (ERR_GET_REASON(err) == EC_R_NOT_A_SUPPORTED_NIST_PRIME)))) { /* real error */ EC_GROUP_clear_free(ret); return NULL; } /* not an actual error, we just cannot use EC_GFp_nist_method */ ERR_clear_error(); EC_GROUP_clear_free(ret); else meth = EC_GFp_mont_method(); ret = EC_GROUP_new(meth); Loading @@ -117,7 +94,6 @@ EC_GROUP *EC_GROUP_new_curve_GFp(const BIGNUM *p, const BIGNUM *a, const BIGNUM EC_GROUP_clear_free(ret); return NULL; } } return ret; } Loading Loading
crypto/ec/ec_cvt.c +7 −31 Original line number Diff line number Diff line Loading @@ -69,6 +69,8 @@ * */ #define OPENSSL_FIPSAPI #include <openssl/err.h> #include "ec_lcl.h" Loading @@ -78,34 +80,9 @@ EC_GROUP *EC_GROUP_new_curve_GFp(const BIGNUM *p, const BIGNUM *a, const BIGNUM const EC_METHOD *meth; EC_GROUP *ret; if (BN_nist_mod_func(p)) meth = EC_GFp_nist_method(); ret = EC_GROUP_new(meth); if (ret == NULL) return NULL; if (!EC_GROUP_set_curve_GFp(ret, p, a, b, ctx)) { unsigned long err; err = ERR_peek_last_error(); if (!(ERR_GET_LIB(err) == ERR_LIB_EC && ((ERR_GET_REASON(err) == EC_R_NOT_A_NIST_PRIME) || (ERR_GET_REASON(err) == EC_R_NOT_A_SUPPORTED_NIST_PRIME)))) { /* real error */ EC_GROUP_clear_free(ret); return NULL; } /* not an actual error, we just cannot use EC_GFp_nist_method */ ERR_clear_error(); EC_GROUP_clear_free(ret); else meth = EC_GFp_mont_method(); ret = EC_GROUP_new(meth); Loading @@ -117,7 +94,6 @@ EC_GROUP *EC_GROUP_new_curve_GFp(const BIGNUM *p, const BIGNUM *a, const BIGNUM EC_GROUP_clear_free(ret); return NULL; } } return ret; } Loading