0

This is similar to this question: Can't link OpenSSL code

I have to update the OpenSSL being used in our code. Older version present in our GIT repository is 0.9.8 I have to now update it to version 1.1.0e

When I downloaded the open source version of OpenSSL(version 1.1.0e) and gave ./config and then make there was no issue with the compilation. Also the .h was generated from the corresponding .h.in (e.g. opensslconf.h, bn_conf.h).

But when I copied the crypto folder into my worktree (I have removed the older OpenSSL-version 0.9.8, from my makefile and have added the new folder into the make, i.e., now the compiler wont use older openssl folder and will compile the new folder containing the latest version of OpenSSL) and compiled it for my target, I am getting errors like below:

*** ERROR ***: init.c:(.text+0xbec): undefined reference to `OPENSSL_cpuid_setup'
*** ERROR ***: dso_lib.c:(.text+0xdc4): undefined reference to `DSO_METHOD_openssl'
*** ERROR ***: conf_lib.c:(.text+0x924): undefined reference to `NCONF_default'
*** ERROR ***: conf_lib.c:(.text+0x934): undefined reference to `_CONF_get_section_values'
*** ERROR ***: conf_lib.c:(.text+0x944): undefined reference to `_CONF_get_string'
*** ERROR ***: e_chacha20_poly1305.c:(.text+0xdec): undefined reference to `CRYPTO_memcmp'
*** ERROR ***: e_rc4_hmac_md5.c:(.text+0x8cc): undefined reference to `CRYPTO_memcmp'
*** ERROR ***: async.c:(.text+0xe68): undefined reference to `async_wait_ctx_reset_counts'
*** ERROR ***: conf_sap.c:(.text+0x124): undefined reference to `OPENSSL_load_builtin_modules'
*** ERROR ***: p12_crpt.c:(.text+0x220): undefined reference to `PKCS12_key_gen_utf8'
*** ERROR ***: p5_scrypt.c:(.text+0x89c): undefined reference to `EVP_PBE_scrypt'
*** ERROR ***: e_des3.c:(.text+0x1540): undefined reference to `CRYPTO_memcmp'
*** ERROR ***: e_aes.c:(.text+0x3a80): undefined reference to `aes_p8_set_encrypt_key'
*** ERROR ***: e_aes.c:(.text+0x3a90): undefined reference to `aes_p8_set_decrypt_key'
*** ERROR ***: e_aes.c:(.text+0x3ab0): undefined reference to `CRYPTO_gcm128_setiv'  
*** ERROR ***: /export/git/tlouis/ssl_fwdport/dxx/fan/common/cryptlib_2/build/../evp/p_verify.c:47: undefined reference to `EVP_PKEY_verify_init'
*** ERROR ***: /export/git/tlouis/ssl_fwdport/dxx/fan/common/cryptlib_2/build/../evp/p_verify.c:51: undefined reference to `EVP_PKEY_verify'
*** ERROR ***: collect2: error: ld returned 1 exit status
FATAL: make exited with nonzero exitcode

I copied the libcrypto.so, libcrypto.so.1.1, libssl.so and libssl.so.1.1 also inside to my code where the library files are present.

But still it is not fixing the issues.

TreesaL
  • 79
  • 6
  • It looks like you are trying to use functions that are no longer public. I'm guessing you are using OpenSSL 1.1.0. Also see [OpenSSL 1.1.0 Changes | Compatibility Layer](https://wiki.openssl.org/index.php/OpenSSL_1.1.0_Changes#Compatibility_Layer) on the OpenSSL wiki. – jww Aug 23 '17 at 18:03
  • @jww for `CRYPTO_memcmp' there is macro before the definition : !defined(OPENSSL_CPUID_OBJ). because of that macro. my compiler is not able to read the function definition in cryptlib.c & hence throwing the above error. will disabling that macro check result in any kind of breakage in security level? – TreesaL Aug 25 '17 at 05:44

0 Answers0