Skip to content

Commit

Permalink
ts: use TS_VERIFY_CTX_set_certs instead of TS_VERIFY_CTS_set_certs
Browse files Browse the repository at this point in the history
OpenSSL 3.0 fixed the typo in the function name and replaced the
current 'CTS' version with a macro.
  • Loading branch information
rhenium committed Oct 24, 2021
1 parent 8e98d2e commit 2be6779
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
3 changes: 2 additions & 1 deletion ext/openssl/extconf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def find_openssl_library
have_func("TS_STATUS_INFO_get0_status")
have_func("TS_STATUS_INFO_get0_text")
have_func("TS_STATUS_INFO_get0_failure_info")
have_func("TS_VERIFY_CTS_set_certs")
have_func("TS_VERIFY_CTS_set_certs(NULL, NULL)", "openssl/ts.h")
have_func("TS_VERIFY_CTX_set_store")
have_func("TS_VERIFY_CTX_add_flags")
have_func("TS_RESP_CTX_set_time_cb")
Expand All @@ -173,6 +173,7 @@ def find_openssl_library
# added in 3.0.0
have_func("SSL_set0_tmp_dh_pkey")
have_func("ERR_get_error_all")
have_func("TS_VERIFY_CTX_set_certs(NULL, NULL)", "openssl/ts.h")

Logging::message "=== Checking done. ===\n"

Expand Down
5 changes: 5 additions & 0 deletions ext/openssl/openssl_missing.h
Original file line number Diff line number Diff line change
Expand Up @@ -214,4 +214,9 @@ IMPL_PKEY_GETTER(EC_KEY, ec)
} while (0)
#endif

/* added in 3.0.0 */
#if !defined(HAVE_TS_VERIFY_CTX_SET_CERTS)
# define TS_VERIFY_CTX_set_certs(ctx, crts) TS_VERIFY_CTS_set_certs(ctx, crts)
#endif

#endif /* _OSSL_OPENSSL_MISSING_H_ */
2 changes: 1 addition & 1 deletion ext/openssl/ossl_ts.c
Original file line number Diff line number Diff line change
Expand Up @@ -826,7 +826,7 @@ ossl_ts_resp_verify(int argc, VALUE *argv, VALUE self)
X509_up_ref(cert);
}

TS_VERIFY_CTS_set_certs(ctx, x509inter);
TS_VERIFY_CTX_set_certs(ctx, x509inter);
TS_VERIFY_CTX_add_flags(ctx, TS_VFY_SIGNATURE);
TS_VERIFY_CTX_set_store(ctx, x509st);

Expand Down

0 comments on commit 2be6779

Please sign in to comment.