X-Git-Url: https://git.librecmc.org/?p=oweals%2Fopenssl.git;a=blobdiff_plain;f=crypto%2Fdh%2Fdh_check.c;h=67b4cec5184ddc2e160a30083e19f6fb90da5776;hp=52cc0eb47609d4d79487feb1042d2024e6558ca7;hb=af6ce3b46cd0fba2235c9ec488973c90c56d92a1;hpb=66ed53c848c60cbaf7a11fa56f1959abf5ef09c0 diff --git a/crypto/dh/dh_check.c b/crypto/dh/dh_check.c index 52cc0eb476..67b4cec518 100644 --- a/crypto/dh/dh_check.c +++ b/crypto/dh/dh_check.c @@ -12,6 +12,8 @@ #include #include "dh_locl.h" +# define DH_NUMBER_ITERATIONS_FOR_PRIME 64 + /*- * Check that p and g are suitable enough * @@ -125,7 +127,7 @@ int DH_check(const DH *dh, int *ret) if (!BN_is_one(t1)) *ret |= DH_NOT_SUITABLE_GENERATOR; } - r = BN_is_prime_ex(dh->q, BN_prime_checks, ctx, NULL); + r = BN_is_prime_ex(dh->q, DH_NUMBER_ITERATIONS_FOR_PRIME, ctx, NULL); if (r < 0) goto err; if (!r) @@ -153,7 +155,7 @@ int DH_check(const DH *dh, int *ret) } else *ret |= DH_UNABLE_TO_CHECK_GENERATOR; - r = BN_is_prime_ex(dh->p, BN_prime_checks, ctx, NULL); + r = BN_is_prime_ex(dh->p, DH_NUMBER_ITERATIONS_FOR_PRIME, ctx, NULL); if (r < 0) goto err; if (!r) @@ -161,7 +163,7 @@ int DH_check(const DH *dh, int *ret) else if (!dh->q) { if (!BN_rshift1(t1, dh->p)) goto err; - r = BN_is_prime_ex(t1, BN_prime_checks, ctx, NULL); + r = BN_is_prime_ex(t1, DH_NUMBER_ITERATIONS_FOR_PRIME, ctx, NULL); if (r < 0) goto err; if (!r)