diff options
Diffstat (limited to 'src/lib/libcrypto/dh/dh_check.c')
-rw-r--r-- | src/lib/libcrypto/dh/dh_check.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/lib/libcrypto/dh/dh_check.c b/src/lib/libcrypto/dh/dh_check.c index 066898174e..316cb9221d 100644 --- a/src/lib/libcrypto/dh/dh_check.c +++ b/src/lib/libcrypto/dh/dh_check.c | |||
@@ -70,6 +70,8 @@ | |||
70 | * should hold. | 70 | * should hold. |
71 | */ | 71 | */ |
72 | 72 | ||
73 | #ifndef OPENSSL_FIPS | ||
74 | |||
73 | int DH_check(const DH *dh, int *ret) | 75 | int DH_check(const DH *dh, int *ret) |
74 | { | 76 | { |
75 | int ok=0; | 77 | int ok=0; |
@@ -128,11 +130,11 @@ int DH_check_pub_key(const DH *dh, const BIGNUM *pub_key, int *ret) | |||
128 | q=BN_new(); | 130 | q=BN_new(); |
129 | if (q == NULL) goto err; | 131 | if (q == NULL) goto err; |
130 | BN_set_word(q,1); | 132 | BN_set_word(q,1); |
131 | if (BN_cmp(pub_key,q)<=0) | 133 | if (BN_cmp(pub_key,q) <= 0) |
132 | *ret|=DH_CHECK_PUBKEY_TOO_SMALL; | 134 | *ret|=DH_CHECK_PUBKEY_TOO_SMALL; |
133 | BN_copy(q,dh->p); | 135 | BN_copy(q,dh->p); |
134 | BN_sub_word(q,1); | 136 | BN_sub_word(q,1); |
135 | if (BN_cmp(pub_key,q)>=0) | 137 | if (BN_cmp(pub_key,q) >= 0) |
136 | *ret|=DH_CHECK_PUBKEY_TOO_LARGE; | 138 | *ret|=DH_CHECK_PUBKEY_TOO_LARGE; |
137 | 139 | ||
138 | ok = 1; | 140 | ok = 1; |
@@ -140,3 +142,5 @@ err: | |||
140 | if (q != NULL) BN_free(q); | 142 | if (q != NULL) BN_free(q); |
141 | return(ok); | 143 | return(ok); |
142 | } | 144 | } |
145 | |||
146 | #endif | ||