Skip to content

Commit

Permalink
fix(sec): fix OpenSSL V1.1 API incompatibility for Windows 32 build (#…
Browse files Browse the repository at this point in the history
…4187)

* Fixed build for Embarcdero C++Builder 10.4/clang

* Fix invalid order of parameters for gmtime_s in arch/win32/ua_clock.c

* Update ua_architecture.h

Fix MS build (again)...

* Fix parameter order of gmtime_s() for CodeGear and MSVC

* Fix OpenSSL V1.1 API compatibility

Co-authored-by: Julius Pfrommer <jpfr@users.noreply.github.com>
  • Loading branch information
ogsadmin and jpfr committed Feb 16, 2021
1 parent 15bc92f commit 511fc25
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions plugins/crypto/openssl/securitypolicy_openssl_common.c
Expand Up @@ -69,8 +69,11 @@ UA_Openssl_Init (void) {
static UA_Int16 bInit = 0;
if (bInit == 1)
return;
#if OPENSSL_API_COMPAT < 0x10100000L
/* only needed, if OpenSSL < V1.1 */
OpenSSL_add_all_algorithms ();
ERR_load_crypto_strings ();
#endif
bInit = 1;
#endif
}
Expand Down
6 changes: 5 additions & 1 deletion plugins/crypto/openssl/ua_pki_openssl.c
Expand Up @@ -478,7 +478,11 @@ UA_CertificateVerification_Verify (void * verificationContext,
ret = UA_STATUSCODE_BADINTERNALERROR;
goto cleanup;
}
(void) X509_STORE_CTX_trusted_stack (storeCtx, ctx->skTrusted);
#if OPENSSL_API_COMPAT < 0x10100000L
(void) X509_STORE_CTX_trusted_stack (storeCtx, ctx->skTrusted);
#else
(void) X509_STORE_CTX_set0_trusted_stack (storeCtx, ctx->skTrusted);
#endif

/* Set crls to ctx */
if (sk_X509_CRL_num (ctx->skCrls) > 0) {
Expand Down

0 comments on commit 511fc25

Please sign in to comment.