diff options
author | Rich Salz <rsalz@akamai.com> | 2015-09-28 23:00:00 +0200 |
---|---|---|
committer | Rich Salz <rsalz@openssl.org> | 2015-09-30 17:15:14 +0200 |
commit | 75f648aa06933a5b5436d2ae4a764be68ab22c4d (patch) | |
tree | 81a6f5d278e0d53a4b2c68b2254bf9397229325c /crypto/dh/dh_rfc5114.c | |
parent | Fix libeay.num (diff) | |
download | openssl-75f648aa06933a5b5436d2ae4a764be68ab22c4d.tar.xz openssl-75f648aa06933a5b5436d2ae4a764be68ab22c4d.zip |
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/dh_rfc5114.c')
-rw-r--r-- | crypto/dh/dh_rfc5114.c | 38 |
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) |