Make update / libeay.num fix
authorRich Salz <rsalz@akamai.com>
Mon, 28 Sep 2015 21:00:00 +0000 (17:00 -0400)
committerRich Salz <rsalz@openssl.org>
Wed, 30 Sep 2015 15:15:14 +0000 (11:15 -0400)
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>
crypto/dh/dh_rfc5114.c
include/openssl/dh.h
test/Makefile

index 61cd9ad4d12cf9e379c27c55a7e59f0f8be1b29c..8819ac087b9c486d40f120abe2830781dd2d2893 100644 (file)
 
 /*
  * 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)
index 0957a5892c89f62ae60bf11ddb5facaa6d03a556..f5b03d32f5ddc274db54aa588b8cbc9d90ed2df3 100644 (file)
@@ -342,17 +342,6 @@ int DH_KDF_X9_42(unsigned char *out, size_t outlen,
 # define EVP_PKEY_DH_KDF_X9_42                           2
 # endif
 
-#define declare_dh_bn(x) \
-        const extern BIGNUM _bignum_dh##x##_p;\
-        const extern BIGNUM _bignum_dh##x##_g;\
-        const extern BIGNUM _bignum_dh##x##_q;
-
-declare_dh_bn(1024_160)
-declare_dh_bn(2048_224)
-declare_dh_bn(2048_256)
-
-#undef declare_dh_bn
-
 /* BEGIN ERROR CODES */
 /*
  * The following lines are auto generated by the script mkerr.pl. Any changes
index 5c695cd66b46415441507edfe0d3f54745173495..6f32758074165a851c8ea9fae8d1f8c525004583 100644 (file)
@@ -524,8 +524,21 @@ gmdifftest.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
 gmdifftest.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
 gmdifftest.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
 gmdifftest.o: gmdifftest.c
-gost2814789test.o: ../include/openssl/e_os2.h ../include/openssl/opensslconf.h
-gost2814789test.o: gost2814789test.c
+gost2814789test.o: ../e_os.h ../engines/ccgost/gost89.h
+gost2814789test.o: ../include/openssl/asn1.h ../include/openssl/bio.h
+gost2814789test.o: ../include/openssl/buffer.h ../include/openssl/conf.h
+gost2814789test.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
+gost2814789test.o: ../include/openssl/ec.h ../include/openssl/ecdh.h
+gost2814789test.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h
+gost2814789test.o: ../include/openssl/err.h ../include/openssl/evp.h
+gost2814789test.o: ../include/openssl/hmac.h ../include/openssl/lhash.h
+gost2814789test.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h
+gost2814789test.o: ../include/openssl/opensslconf.h
+gost2814789test.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
+gost2814789test.o: ../include/openssl/pkcs7.h ../include/openssl/safestack.h
+gost2814789test.o: ../include/openssl/sha.h ../include/openssl/stack.h
+gost2814789test.o: ../include/openssl/symhacks.h ../include/openssl/x509.h
+gost2814789test.o: ../include/openssl/x509_vfy.h gost2814789test.c
 heartbeat_test.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
 heartbeat_test.o: ../include/openssl/bn.h ../include/openssl/buffer.h
 heartbeat_test.o: ../include/openssl/comp.h ../include/openssl/crypto.h