summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/dh/dh_check.c
diff options
context:
space:
mode:
authorbeck <>2000-03-19 11:13:58 +0000
committerbeck <>2000-03-19 11:13:58 +0000
commit796d609550df3a33fc11468741c5d2f6d3df4c11 (patch)
tree6c6d539061caa20372dad0ac4ddb1dfae2fbe7fe /src/lib/libcrypto/dh/dh_check.c
parent5be3114c1fd7e0dfea1e38d3abb4cbba75244419 (diff)
downloadopenbsd-796d609550df3a33fc11468741c5d2f6d3df4c11.tar.gz
openbsd-796d609550df3a33fc11468741c5d2f6d3df4c11.tar.bz2
openbsd-796d609550df3a33fc11468741c5d2f6d3df4c11.zip
OpenSSL 0.9.5 merge
*warning* this bumps shared lib minors for libssl and libcrypto from 2.1 to 2.2 if you are using the ssl26 packages for ssh and other things to work you will need to get new ones (see ~beck/libsslsnap/<arch>) on cvs or ~beck/src-patent.tar.gz on cvs
Diffstat (limited to 'src/lib/libcrypto/dh/dh_check.c')
-rw-r--r--src/lib/libcrypto/dh/dh_check.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/lib/libcrypto/dh/dh_check.c b/src/lib/libcrypto/dh/dh_check.c
index 95ce9cfad0..7e5cfd8bfc 100644
--- a/src/lib/libcrypto/dh/dh_check.c
+++ b/src/lib/libcrypto/dh/dh_check.c
@@ -61,7 +61,7 @@
61#include <openssl/bn.h> 61#include <openssl/bn.h>
62#include <openssl/dh.h> 62#include <openssl/dh.h>
63 63
64/* Check that p is a strong 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 is is a suitable generator
66 * where 66 * where
67 * for 2, p mod 24 == 11 67 * for 2, p mod 24 == 11
@@ -88,11 +88,13 @@ int DH_check(DH *dh, int *ret)
88 l=BN_mod_word(dh->p,24); 88 l=BN_mod_word(dh->p,24);
89 if (l != 11) *ret|=DH_NOT_SUITABLE_GENERATOR; 89 if (l != 11) *ret|=DH_NOT_SUITABLE_GENERATOR;
90 } 90 }
91/* else if (BN_is_word(dh->g,DH_GENERATOR_3)) 91#if 0
92 else if (BN_is_word(dh->g,DH_GENERATOR_3))
92 { 93 {
93 l=BN_mod_word(dh->p,12); 94 l=BN_mod_word(dh->p,12);
94 if (l != 5) *ret|=DH_NOT_SUITABLE_GENERATOR; 95 if (l != 5) *ret|=DH_NOT_SUITABLE_GENERATOR;
95 }*/ 96 }
97#endif
96 else if (BN_is_word(dh->g,DH_GENERATOR_5)) 98 else if (BN_is_word(dh->g,DH_GENERATOR_5))
97 { 99 {
98 l=BN_mod_word(dh->p,10); 100 l=BN_mod_word(dh->p,10);
@@ -108,7 +110,7 @@ int DH_check(DH *dh, int *ret)
108 { 110 {
109 if (!BN_rshift1(q,dh->p)) goto err; 111 if (!BN_rshift1(q,dh->p)) goto err;
110 if (!BN_is_prime(q,BN_prime_checks,NULL,ctx,NULL)) 112 if (!BN_is_prime(q,BN_prime_checks,NULL,ctx,NULL))
111 *ret|=DH_CHECK_P_NOT_STRONG_PRIME; 113 *ret|=DH_CHECK_P_NOT_SAFE_PRIME;
112 } 114 }
113 ok=1; 115 ok=1;
114err: 116err: