From c1cf22a0091991dfdc48730c4504305159f7a095 Mon Sep 17 00:00:00 2001 From: Dmitry Mikushin Date: Wed, 8 Aug 2018 00:26:07 +0300 Subject: [PATCH 1/2] Fixing build for Visual Studio 2017 --- crypto/x509/x_all.c | 4 ++++ include/openssl/asn1.h | 8 ++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/crypto/x509/x_all.c b/crypto/x509/x_all.c index 8ec88c2..1406174 100644 --- a/crypto/x509/x_all.c +++ b/crypto/x509/x_all.c @@ -205,6 +205,10 @@ int i2d_X509_REQ_bio(BIO *bp, X509_REQ *req) #ifndef OPENSSL_NO_RSA #ifndef OPENSSL_NO_FP_API + +DECLARE_ASN1_ITEM(RSAPrivateKey); +DECLARE_ASN1_ITEM(RSAPublicKey); + RSA *d2i_RSAPrivateKey_fp(FILE *fp, RSA **rsa) { return ASN1_item_d2i_fp(ASN1_ITEM_rptr(RSAPrivateKey), fp, rsa); diff --git a/include/openssl/asn1.h b/include/openssl/asn1.h index 59540e4..80ca308 100644 --- a/include/openssl/asn1.h +++ b/include/openssl/asn1.h @@ -320,15 +320,19 @@ typedef struct ASN1_VALUE_st ASN1_VALUE; #define DECLARE_ASN1_ENCODE_FUNCTIONS_const(type, name) \ type *d2i_##name(type **a, const unsigned char **in, long len); \ - int i2d_##name(const type *a, unsigned char **out); \ - DECLARE_ASN1_ITEM(name) + int i2d_##name(const type *a, unsigned char **out); #define DECLARE_ASN1_NDEF_FUNCTION(name) \ int i2d_##name##_NDEF(name *a, unsigned char **out); +#if 0 #define DECLARE_ASN1_FUNCTIONS_const(name) \ DECLARE_ASN1_ALLOC_FUNCTIONS(name) \ DECLARE_ASN1_ENCODE_FUNCTIONS_const(name, name) +#else +#define DECLARE_ASN1_FUNCTIONS_const(name) \ + DECLARE_ASN1_ALLOC_FUNCTIONS(name) +#endif #define DECLARE_ASN1_ALLOC_FUNCTIONS_name(type, name) \ type *name##_new(void); \ From 8d33642ecc25bc86f0e9a59248c7d20a519e1205 Mon Sep 17 00:00:00 2001 From: Dmitry Mikushin Date: Wed, 8 Aug 2018 15:48:29 +0300 Subject: [PATCH 2/2] Default to static ssl/crypto libraries - easier to link into Python modules --- crypto/CMakeLists.txt | 2 +- ssl/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/crypto/CMakeLists.txt b/crypto/CMakeLists.txt index 7f3e3f2..6b4e701 100644 --- a/crypto/CMakeLists.txt +++ b/crypto/CMakeLists.txt @@ -184,7 +184,7 @@ add_submodule ( x509v3 v3_bcons.c v3_bitst.c v3_conf.c v3_extku.c v3_ia5.c v3_li add_submodule ( . EXHEADERS crypto.h opensslv.h opensslconf.h ebcdic.h symhacks.h ossl_typ.h ) -add_library ( crypto ${LIBSRC} ${OBJECTS_SRC} crypto.def ) +add_library ( crypto STATIC ${LIBSRC} ${OBJECTS_SRC} crypto.def ) if ( WIN32 AND NOT CYGWIN ) target_link_libraries ( crypto ws2_32 crypt32 ) diff --git a/ssl/CMakeLists.txt b/ssl/CMakeLists.txt index d4a05cb..ceb8489 100644 --- a/ssl/CMakeLists.txt +++ b/ssl/CMakeLists.txt @@ -16,7 +16,7 @@ set ( LIBSRC s2_meth.c s2_srvr.c s2_clnt.c s2_lib.c s2_enc.c s2_pkt.c s3_meth.c ssl_sess.c ssl_ciph.c ssl_stat.c ssl_rsa.c ssl_asn1.c ssl_txt.c ssl_algs.c bio_ssl.c ssl_err.c kssl.c t1_reneg.c ) -add_library ( ssl ${LIBSRC} ssl.def ) +add_library ( ssl STATIC ${LIBSRC} ssl.def ) target_link_libraries ( ssl crypto ) install_header ( ssl.h ssl2.h ssl3.h ssl23.h tls1.h dtls1.h kssl.h INTO openssl )