Skip to content

Commit ec19e47

Browse files
committed
ts: use TS_VERIFY_CTX_set_certs instead of TS_VERIFY_CTS_set_certs
[ This is a backport to the 2.2 branch to fix build with LibreSSL. ] OpenSSL 3.0 fixed the typo in the function name and replaced the current 'CTS' version with a macro. (cherry picked from commit 2be6779)
1 parent 075b68e commit ec19e47

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

ext/openssl/extconf.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,13 +176,16 @@ def find_openssl_library
176176
have_func("TS_STATUS_INFO_get0_status")
177177
have_func("TS_STATUS_INFO_get0_text")
178178
have_func("TS_STATUS_INFO_get0_failure_info")
179-
have_func("TS_VERIFY_CTS_set_certs")
179+
have_func("TS_VERIFY_CTS_set_certs(NULL, NULL)", "openssl/ts.h")
180180
have_func("TS_VERIFY_CTX_set_store")
181181
have_func("TS_VERIFY_CTX_add_flags")
182182
have_func("TS_RESP_CTX_set_time_cb")
183183
have_func("EVP_PBE_scrypt")
184184
have_func("SSL_CTX_set_post_handshake_auth")
185185

186+
# added in 3.0.0
187+
have_func("TS_VERIFY_CTX_set_certs(NULL, NULL)", "openssl/ts.h")
188+
186189
Logging::message "=== Checking done. ===\n"
187190

188191
create_header

ext/openssl/openssl_missing.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,4 +254,9 @@ IMPL_PKEY_GETTER(EC_KEY, ec)
254254
} while (0)
255255
#endif
256256

257+
/* added in 3.0.0 */
258+
#if !defined(HAVE_TS_VERIFY_CTX_SET_CERTS)
259+
# define TS_VERIFY_CTX_set_certs(ctx, crts) TS_VERIFY_CTS_set_certs(ctx, crts)
260+
#endif
261+
257262
#endif /* _OSSL_OPENSSL_MISSING_H_ */

ext/openssl/ossl_ts.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -820,7 +820,7 @@ ossl_ts_resp_verify(int argc, VALUE *argv, VALUE self)
820820
X509_up_ref(cert);
821821
}
822822

823-
TS_VERIFY_CTS_set_certs(ctx, x509inter);
823+
TS_VERIFY_CTX_set_certs(ctx, x509inter);
824824
TS_VERIFY_CTX_add_flags(ctx, TS_VFY_SIGNATURE);
825825
TS_VERIFY_CTX_set_store(ctx, x509st);
826826

0 commit comments

Comments
 (0)