Hi,
When configure'd with "no-engine" and "no-hw" options, build of OpenSSL
1.0.1h on Windows 7 failed.
Although it might not be the best solution, the attached patch solved
this (for static linking) by adding or moving up some related
preprocessor directives.
But still leaves a problem when dynamic linking :
LIBEAY32.def : error LNK2001: unresolved external symbol
TS_CONF_set_crypto_device
LIBEAY32.def : error LNK2001: unresolved external symbol
TS_CONF_set_default_engine
I tried to modify the libeay.num file for these two symbols (I added
'ENGINE' at the end of the lines 3873 and 4098), but this didn't solved
this issue, proving that I still do not understand the whole build
process :-(
Does anyone know about this matter ?
--- ccgost/gost2001.c Thu Jun 05 11:41:31 2014
+++ ccgost/gost2001.c Sun Jun 08 00:09:58 2014
@@ -6,6 +6,9 @@
* Implementation of GOST R 34.10-2001 *
* Requires OpenSSL 0.9.9 for compilation *
**********************************************************************/
+
+#ifndef OPENSSL_NO_ENGINE
+
#include "gost_lcl.h"
#include "gost_params.h"
#include <string.h>
@@ -341,3 +344,4 @@
return gost2001_compute_public(ec);
}
+#endif /* !OPENSSL_NO_ENGINE */
\ No newline at end of file
--- ccgost/gost2001_keyx.c Thu Jun 05 11:41:31 2014
+++ ccgost/gost2001_keyx.c Sun Jun 08 00:07:01 2014
@@ -7,6 +7,9 @@
* based PKCS7/SMIME support *
* Requires OpenSSL 0.9.9 for compilation *
**********************************************************************/
+
+#ifndef OPENSSL_NO_ENGINE
+
#include <openssl/evp.h>
#include <openssl/rand.h>
#include <string.h>
@@ -18,8 +21,6 @@
#include "gost_lcl.h"
#include "gost2001_keyx.h"
-
-
/* Implementation of CryptoPro VKO 34.10-2001 algorithm */
static int VKO_compute_key(unsigned char *shared_key,size_t shared_key_size,const EC_POINT *pub_key,EC_KEY *priv_key,const unsigned char *ukm)
{
@@ -306,3 +307,5 @@
if (gkt) GOST_KEY_TRANSPORT_free(gkt);
return ret;
}
+
+#endif /* !OPENSSL_NO_ENGINE */
--- ccgost/gost94_keyx.c Thu Jun 05 11:41:31 2014
+++ ccgost/gost94_keyx.c Sun Jun 08 00:10:11 2014
@@ -8,6 +8,9 @@
* *
* Requires OpenSSL 0.9.9 for compilation *
**********************************************************************/
+
+#ifndef OPENSSL_NO_ENGINE
+
#include <string.h>
#include <openssl/dh.h>
#include <openssl/rand.h>
@@ -289,3 +292,4 @@
return -1;
}
+#endif /* !OPENSSL_NO_ENGINE */
\ No newline at end of file
--- ccgost/gost_ameth.c Thu Jun 05 11:44:33 2014
+++ ccgost/gost_ameth.c Sun Jun 08 00:07:55 2014
@@ -7,6 +7,9 @@
* for OpenSSL *
* Requires OpenSSL 0.9.9 for compilation *
**********************************************************************/
+
+#ifndef OPENSSL_NO_ENGINE
+
#include <string.h>
#include <openssl/crypto.h>
#include <openssl/err.h>
@@ -943,3 +946,5 @@
}
return 1;
}
+
+#endif /* !OPENSSL_NO_ENGINE */
\ No newline at end of file
--- ccgost/gost_asn1.c Thu Jun 05 11:41:31 2014
+++ ccgost/gost_asn1.c Sun Jun 08 00:08:07 2014
@@ -6,6 +6,9 @@
* ASN1 structure definition for GOST key transport *
* Requires OpenSSL 0.9.9 for compilation *
**********************************************************************/
+
+#ifndef OPENSSL_NO_ENGINE
+
#include <stdio.h>
#include <openssl/asn1t.h>
#include <openssl/x509.h>
@@ -53,3 +56,5 @@
} ASN1_NDEF_SEQUENCE_END(GOST_CLIENT_KEY_EXCHANGE_PARAMS)
IMPLEMENT_ASN1_FUNCTIONS(GOST_CLIENT_KEY_EXCHANGE_PARAMS)
+
+#endif /* !OPENSSL_NO_ENGINE */
\ No newline at end of file
--- ccgost/gost_crypt.c Thu Jun 05 11:41:31 2014
+++ ccgost/gost_crypt.c Sun Jun 08 00:08:18 2014
@@ -6,6 +6,9 @@
* OpenSSL interface to GOST 28147-89 cipher functions *
* Requires OpenSSL 0.9.9 for compilation *
**********************************************************************/
+
+#ifndef OPENSSL_NO_ENGINE
+
#include <string.h>
#include "gost89.h"
#include <openssl/rand.h>
@@ -632,3 +635,4 @@
return 1;
}
+#endif /* !OPENSSL_NO_ENGINE */
\ No newline at end of file
--- ccgost/gost_ctl.c Thu Jun 05 11:41:31 2014
+++ ccgost/gost_ctl.c Sun Jun 08 00:08:42 2014
@@ -6,6 +6,9 @@
* Implementation of control commands for GOST engine *
* OpenSSL 0.9.9 libraries required *
**********************************************************************/
+
+#ifndef OPENSSL_NO_ENGINE
+
#include <stdlib.h>
#include <string.h>
#include <openssl/crypto.h>
@@ -87,3 +90,5 @@
return 1;
}
+
+#endif /* !OPENSSL_NO_ENGINE */
--- ccgost/gost_eng.c Thu Jun 05 11:44:33 2014
+++ ccgost/gost_eng.c Sun Jun 08 00:08:57 2014
@@ -7,6 +7,9 @@
* for OpenSSL *
* Requires OpenSSL 0.9.9 for compilation *
**********************************************************************/
+
+#ifndef OPENSSL_NO_ENGINE
+
#include <string.h>
#include <openssl/crypto.h>
#include <openssl/err.h>
@@ -15,6 +18,7 @@
#include <openssl/obj_mac.h>
#include "e_gost_err.h"
#include "gost_lcl.h"
+
static const char *engine_gost_id = "gost";
static const char *engine_gost_name = "Reference implementation of GOST engine";
@@ -286,3 +290,4 @@
}
#endif
+#endif /* !OPENSSL_NO_ENGINE */
--- ccgost/gost_md.c Thu Jun 05 11:41:31 2014
+++ ccgost/gost_md.c Sun Jun 08 00:09:17 2014
@@ -6,6 +6,9 @@
* OpenSSL interface to GOST R 34.11-94 hash functions *
* Requires OpenSSL 0.9.9 for compilation *
**********************************************************************/
+
+#ifndef OPENSSL_NO_ENGINE
+
#include <string.h>
#include "gost_lcl.h"
#include "gosthash.h"
@@ -73,3 +76,5 @@
memset(ctx->md_data,0,sizeof(struct ossl_gost_digest_ctx));
return 1;
}
+
+#endif /* !OPENSSL_NO_ENGINE */
\ No newline at end of file
--- ccgost/gost_pmeth.c Thu Jun 05 11:44:33 2014
+++ ccgost/gost_pmeth.c Sun Jun 08 00:09:30 2014
@@ -7,6 +7,9 @@
* for OpenSSL *
* Requires OpenSSL 0.9.9 for compilation *
**********************************************************************/
+
+#ifndef OPENSSL_NO_ENGINE
+
#include <openssl/evp.h>
#include <openssl/objects.h>
#include <openssl/ec.h>
@@ -626,3 +629,4 @@
return 1;
}
+#endif /* !OPENSSL_NO_ENGINE */
\ No newline at end of file
--- ccgost/gost_sign.c Thu Jun 05 11:41:31 2014
+++ ccgost/gost_sign.c Sun Jun 08 00:10:31 2014
@@ -7,6 +7,9 @@
* for OpenSSL *
* Requires OpenSSL 0.9.9 for compilation *
**********************************************************************/
+
+#ifndef OPENSSL_NO_ENGINE
+
#include <string.h>
#include <openssl/rand.h>
#include <openssl/bn.h>
@@ -319,3 +322,5 @@
BN_bn2bin(bn,buf+len-bytes);
return 1;
}
+
+#endif /* !OPENSSL_NO_ENGINE */
\ No newline at end of file
--- e_4758cca.c Thu Jun 05 11:41:31 2014
+++ e_4758cca.c Sun Jun 08 00:10:43 2014
@@ -52,6 +52,8 @@
* Hudson (t...@cryptsoft.com).
*
*/
+#ifndef OPENSSL_NO_HW
+#ifndef OPENSSL_NO_HW_4758_CCA
#include <stdio.h>
#include <string.h>
@@ -65,9 +67,6 @@
#include <openssl/rsa.h>
#endif
#include <openssl/bn.h>
-
-#ifndef OPENSSL_NO_HW
-#ifndef OPENSSL_NO_HW_4758_CCA
#ifdef FLAT_INC
#include "hw_4758_cca.h"
--- e_aep.c Thu Jun 05 11:44:33 2014
+++ e_aep.c Sun Jun 08 00:10:58 2014
@@ -52,6 +52,9 @@
*
*/
+#ifndef OPENSSL_NO_HW
+#ifndef OPENSSL_NO_HW_AEP
+
#include <stdio.h>
#include <openssl/bn.h>
#include <string.h>
@@ -86,8 +89,6 @@
#include <openssl/dh.h>
#endif
-#ifndef OPENSSL_NO_HW
-#ifndef OPENSSL_NO_HW_AEP
#ifdef FLAT_INC
#include "aep.h"
#else
--- e_atalla.c Thu Jun 05 09:22:48 2014
+++ e_atalla.c Sun Jun 08 00:11:11 2014
@@ -56,6 +56,9 @@
*
*/
+#ifndef OPENSSL_NO_HW
+#ifndef OPENSSL_NO_HW_ATALLA
+
#include <stdio.h>
#include <string.h>
#include <openssl/crypto.h>
@@ -72,9 +75,6 @@
#include <openssl/dh.h>
#endif
#include <openssl/bn.h>
-
-#ifndef OPENSSL_NO_HW
-#ifndef OPENSSL_NO_HW_ATALLA
#ifdef FLAT_INC
#include "atalla.h"
--- e_capi.c Thu Jun 05 11:44:33 2014
+++ e_capi.c Sun Jun 08 00:11:47 2014
@@ -51,6 +51,8 @@
* ====================================================================
*/
+#ifndef OPENSSL_NO_ENGINE
+#ifndef OPENSSL_NO_CAPIENG
#include <stdio.h>
#include <string.h>
@@ -59,7 +61,6 @@
#include <openssl/bn.h>
#ifdef OPENSSL_SYS_WIN32
-#ifndef OPENSSL_NO_CAPIENG
#include <openssl/rsa.h>
@@ -1840,3 +1841,5 @@
void ENGINE_load_capi(void){}
#endif
#endif
+
+#endif /* !OPENSSL_NO_ENGINE */
--- e_chil.c Thu Jun 05 11:41:31 2014
+++ e_chil.c Sun Jun 08 00:12:01 2014
@@ -57,6 +57,9 @@
*
*/
+#ifndef OPENSSL_NO_HW
+#ifndef OPENSSL_NO_HW_CHIL
+
#include <stdio.h>
#include <string.h>
#include <openssl/crypto.h>
@@ -72,9 +75,6 @@
#include <openssl/dh.h>
#endif
#include <openssl/bn.h>
-
-#ifndef OPENSSL_NO_HW
-#ifndef OPENSSL_NO_HW_CHIL
/* Attribution notice: nCipher have said several times that it's OK for
* us to implement a general interface to their boxes, and recently declared
--- e_cswift.c Thu Jun 05 09:22:48 2014
+++ e_cswift.c Sun Jun 08 00:12:13 2014
@@ -56,6 +56,9 @@
*
*/
+#ifndef OPENSSL_NO_HW
+#ifndef OPENSSL_NO_HW_CSWIFT
+
#include <stdio.h>
#include <string.h>
#include <openssl/crypto.h>
@@ -73,9 +76,6 @@
#endif
#include <openssl/rand.h>
#include <openssl/bn.h>
-
-#ifndef OPENSSL_NO_HW
-#ifndef OPENSSL_NO_HW_CSWIFT
/* Attribution notice: Rainbow have generously allowed me to reproduce
* the necessary definitions here from their API. This means the support
--- e_gmp.c Thu Jun 05 11:41:31 2014
+++ e_gmp.c Sun Jun 08 00:12:24 2014
@@ -80,6 +80,9 @@
* chipsets might be a good deal more favourable to the GMP version (eg. PPC).
* Feedback welcome. */
+#ifndef OPENSSL_NO_HW
+#ifndef OPENSSL_NO_GMP
+
#include <stdio.h>
#include <string.h>
#include <openssl/crypto.h>
@@ -89,9 +92,6 @@
#include <openssl/rsa.h>
#endif
#include <openssl/bn.h>
-
-#ifndef OPENSSL_NO_HW
-#ifndef OPENSSL_NO_GMP
#include <gmp.h>
--- e_nuron.c Thu Jun 05 09:22:48 2014
+++ e_nuron.c Sun Jun 08 00:12:36 2014
@@ -55,6 +55,8 @@
* Hudson (t...@cryptsoft.com).
*
*/
+#ifndef OPENSSL_NO_HW
+#ifndef OPENSSL_NO_HW_NURON
#include <stdio.h>
#include <string.h>
@@ -72,9 +74,6 @@
#include <openssl/dh.h>
#endif
#include <openssl/bn.h>
-
-#ifndef OPENSSL_NO_HW
-#ifndef OPENSSL_NO_HW_NURON
#define NURON_LIB_NAME "nuron engine"
#include "e_nuron_err.c"
--- e_padlock.c Thu Jun 05 11:44:33 2014
+++ e_padlock.c Sun Jun 08 00:12:49 2014
@@ -62,6 +62,8 @@
*
*/
+#ifndef OPENSSL_NO_HW
+#ifndef OPENSSL_NO_HW_PADLOCK
#include <stdio.h>
#include <string.h>
@@ -76,9 +78,6 @@
#endif
#include <openssl/rand.h>
#include <openssl/err.h>
-
-#ifndef OPENSSL_NO_HW
-#ifndef OPENSSL_NO_HW_PADLOCK
/* Attempt to have a single source for both 0.9.7 and 0.9.8 :-) */
#if (OPENSSL_VERSION_NUMBER >= 0x00908000L)
--- e_sureware.c Thu Jun 05 11:41:31 2014
+++ e_sureware.c Sun Jun 08 00:13:02 2014
@@ -50,6 +50,9 @@
* SUCH DAMAGE. *
====================================================================*/
+#ifndef OPENSSL_NO_HW
+#ifndef OPENSSL_NO_HW_SUREWARE
+
#include <stdio.h>
#include <string.h>
#include <openssl/crypto.h>
@@ -67,9 +70,6 @@
#include <openssl/dh.h>
#endif
#include <openssl/bn.h>
-
-#ifndef OPENSSL_NO_HW
-#ifndef OPENSSL_NO_HW_SUREWARE
#ifdef FLAT_INC
#include "sureware.h"
--- e_ubsec.c Thu Jun 05 11:41:31 2014
+++ e_ubsec.c Sun Jun 08 00:13:13 2014
@@ -58,6 +58,9 @@
*
*/
+ #ifndef OPENSSL_NO_HW
+#ifndef OPENSSL_NO_HW_UBSEC
+
#include <stdio.h>
#include <string.h>
#include <openssl/crypto.h>
@@ -74,9 +77,6 @@
#include <openssl/dh.h>
#endif
#include <openssl/bn.h>
-
-#ifndef OPENSSL_NO_HW
-#ifndef OPENSSL_NO_HW_UBSEC
#ifdef FLAT_INC
#include "hw_ubsec.h"