summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/dh/dh_check.c
diff options
context:
space:
mode:
authordjm <>2008-09-06 12:17:54 +0000
committerdjm <>2008-09-06 12:17:54 +0000
commit38ce604e3cc97706b876b0525ddff0121115456d (patch)
tree7ccc28afe1789ea3dbedf72365f955d5b8e105b5 /src/lib/libcrypto/dh/dh_check.c
parent12867252827c8efaa8ddd1fa3b3d6e321e2bcdef (diff)
downloadopenbsd-38ce604e3cc97706b876b0525ddff0121115456d.tar.gz
openbsd-38ce604e3cc97706b876b0525ddff0121115456d.tar.bz2
openbsd-38ce604e3cc97706b876b0525ddff0121115456d.zip
resolve conflicts
Diffstat (limited to 'src/lib/libcrypto/dh/dh_check.c')
-rw-r--r--src/lib/libcrypto/dh/dh_check.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/lib/libcrypto/dh/dh_check.c b/src/lib/libcrypto/dh/dh_check.c
index 17debff62d..b846913004 100644
--- a/src/lib/libcrypto/dh/dh_check.c
+++ b/src/lib/libcrypto/dh/dh_check.c
@@ -62,7 +62,7 @@
62#include <openssl/dh.h> 62#include <openssl/dh.h>
63 63
64/* Check that p is a safe prime and 64/* Check that p is a safe prime and
65 * if g is 2, 3 or 5, check that is is a suitable generator 65 * if g is 2, 3 or 5, check that it is a suitable generator
66 * where 66 * where
67 * for 2, p mod 24 == 11 67 * for 2, p mod 24 == 11
68 * for 3, p mod 12 == 5 68 * for 3, p mod 12 == 5
@@ -70,8 +70,6 @@
70 * should hold. 70 * should hold.
71 */ 71 */
72 72
73#ifndef OPENSSL_FIPS
74
75int DH_check(const DH *dh, int *ret) 73int DH_check(const DH *dh, int *ret)
76 { 74 {
77 int ok=0; 75 int ok=0;
@@ -106,12 +104,12 @@ int DH_check(const DH *dh, int *ret)
106 else 104 else
107 *ret|=DH_UNABLE_TO_CHECK_GENERATOR; 105 *ret|=DH_UNABLE_TO_CHECK_GENERATOR;
108 106
109 if (!BN_is_prime(dh->p,BN_prime_checks,NULL,ctx,NULL)) 107 if (!BN_is_prime_ex(dh->p,BN_prime_checks,ctx,NULL))
110 *ret|=DH_CHECK_P_NOT_PRIME; 108 *ret|=DH_CHECK_P_NOT_PRIME;
111 else 109 else
112 { 110 {
113 if (!BN_rshift1(q,dh->p)) goto err; 111 if (!BN_rshift1(q,dh->p)) goto err;
114 if (!BN_is_prime(q,BN_prime_checks,NULL,ctx,NULL)) 112 if (!BN_is_prime_ex(q,BN_prime_checks,ctx,NULL))
115 *ret|=DH_CHECK_P_NOT_SAFE_PRIME; 113 *ret|=DH_CHECK_P_NOT_SAFE_PRIME;
116 } 114 }
117 ok=1; 115 ok=1;
@@ -142,5 +140,3 @@ err:
142 if (q != NULL) BN_free(q); 140 if (q != NULL) BN_free(q);
143 return(ok); 141 return(ok);
144 } 142 }
145
146#endif