aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/dh
diff options
context:
space:
mode:
authorRich Salz <rsalz@akamai.com>2015-09-28 17:00:00 -0400
committerRich Salz <rsalz@openssl.org>2015-09-30 11:15:14 -0400
commit75f648aa06933a5b5436d2ae4a764be68ab22c4d (patch)
tree81a6f5d278e0d53a4b2c68b2254bf9397229325c /crypto/dh
parentdd35486db671dca36caffecc7ee1f5f6483b3a4b (diff)
downloadopenssl-75f648aa06933a5b5436d2ae4a764be68ab22c4d.tar.gz
Make update / libeay.num fix
Looks like someone forgot to do a "make update" since crypto/ts/Makefile keeps changing. So include that. Second is that the declare_dh_bn macro fools the libeay.num script. The declarations are only needed in one file (dh_rfc5114) so remove them from the header and put the "raw" declarations directly into that file. Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'crypto/dh')
-rw-r--r--crypto/dh/dh_rfc5114.c38
1 files changed, 20 insertions, 18 deletions
diff --git a/crypto/dh/dh_rfc5114.c b/crypto/dh/dh_rfc5114.c
index 61cd9ad4d1..8819ac087b 100644
--- a/crypto/dh/dh_rfc5114.c
+++ b/crypto/dh/dh_rfc5114.c
@@ -63,27 +63,29 @@
/*
* Macro to make a DH structure from BIGNUM data. NB: although just copying
- * the BIGNUM static pointers would be more efficient we can't as they get
- * wiped using BN_clear_free() when DH_free() is called.
+ * the BIGNUM static pointers would be more efficient, we can't do that
+ * because they get wiped using BN_clear_free() when DH_free() is called.
*/
#define make_dh(x) \
-DH * DH_get_##x(void) \
- { \
- DH *dh; \
- dh = DH_new(); \
- if (!dh) \
- return NULL; \
- dh->p = BN_dup(&_bignum_dh##x##_p); \
- dh->g = BN_dup(&_bignum_dh##x##_g); \
- dh->q = BN_dup(&_bignum_dh##x##_q); \
- if (!dh->p || !dh->q || !dh->g) \
- { \
- DH_free(dh); \
- return NULL; \
- } \
- return dh; \
- }
+\
+extern const BIGNUM _bignum_dh##x##_p, _bignum_dh##x##_g, _bignum_dh##x##_q; \
+\
+DH *DH_get_##x(void) \
+{ \
+ DH *dh = DH_new(); \
+\
+ if (dh == NULL) \
+ return NULL; \
+ dh->p = BN_dup(&_bignum_dh##x##_p); \
+ dh->g = BN_dup(&_bignum_dh##x##_g); \
+ dh->q = BN_dup(&_bignum_dh##x##_q); \
+ if (dh->p == NULL || dh->q == NULL || dh->g == NULL) {\
+ DH_free(dh); \
+ return NULL; \
+ } \
+ return dh; \
+}
make_dh(1024_160)
make_dh(2048_224)