projects
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add BN_check_prime()
[openssl.git]
/
apps
/
s_client.c
diff --git
a/apps/s_client.c
b/apps/s_client.c
index 016df7c657e2fe9933dc0e2c7ebf5f4f07bfad01..392ab0223455880a7ec516e9242a2d2638f0aeaf 100644
(file)
--- a/
apps/s_client.c
+++ b/
apps/s_client.c
@@
-272,8
+272,6
@@
typedef struct srp_arg_st {
int strength; /* minimal size for N */
} SRP_ARG;
int strength; /* minimal size for N */
} SRP_ARG;
-# define SRP_NUMBER_ITERATIONS_FOR_PRIME 64
-
static int srp_Verify_N_and_g(const BIGNUM *N, const BIGNUM *g)
{
BN_CTX *bn_ctx = BN_CTX_new();
static int srp_Verify_N_and_g(const BIGNUM *N, const BIGNUM *g)
{
BN_CTX *bn_ctx = BN_CTX_new();
@@
-281,10
+279,10
@@
static int srp_Verify_N_and_g(const BIGNUM *N, const BIGNUM *g)
BIGNUM *r = BN_new();
int ret =
g != NULL && N != NULL && bn_ctx != NULL && BN_is_odd(N) &&
BIGNUM *r = BN_new();
int ret =
g != NULL && N != NULL && bn_ctx != NULL && BN_is_odd(N) &&
- BN_
is_prime_ex(N, SRP_NUMBER_ITERATIONS_FOR_PRIME
, bn_ctx, NULL) == 1 &&
+ BN_
check_prime(N
, bn_ctx, NULL) == 1 &&
p != NULL && BN_rshift1(p, N) &&
/* p = (N-1)/2 */
p != NULL && BN_rshift1(p, N) &&
/* p = (N-1)/2 */
- BN_
is_prime_ex(p, SRP_NUMBER_ITERATIONS_FOR_PRIME
, bn_ctx, NULL) == 1 &&
+ BN_
check_prime(p
, bn_ctx, NULL) == 1 &&
r != NULL &&
/* verify g^((N-1)/2) == -1 (mod N) */
BN_mod_exp(r, g, p, N, bn_ctx) &&
r != NULL &&
/* verify g^((N-1)/2) == -1 (mod N) */
BN_mod_exp(r, g, p, N, bn_ctx) &&