mirror of
https://github.com/ruby/ruby.git
synced 2026-01-27 04:24:23 +00:00
[ruby/openssl] ssl: fix extconf.rb check for SSL_CTX_set0_tmp_dh_pkey()
Check for the function we actually use. Both SSL_set0_tmp_dh_pkey() and SSL_CTX_set0_tmp_dh_pkey() were added in OpenSSL 3.0. https://github.com/ruby/openssl/commit/a9b6a64e5f
This commit is contained in:
parent
810b3a405b
commit
8dfe540341
@ -147,7 +147,7 @@ have_func("EVP_PBE_scrypt(\"\", 0, (unsigned char *)\"\", 0, 0, 0, 0, 0, NULL, 0
|
||||
have_func("EVP_PKEY_check(NULL)", evp_h)
|
||||
|
||||
# added in 3.0.0
|
||||
have_func("SSL_set0_tmp_dh_pkey(NULL, NULL)", ssl_h)
|
||||
have_func("SSL_CTX_set0_tmp_dh_pkey(NULL, NULL)", ssl_h)
|
||||
have_func("ERR_get_error_all(NULL, NULL, NULL, NULL, NULL)", "openssl/err.h")
|
||||
have_func("SSL_CTX_load_verify_file(NULL, \"\")", ssl_h)
|
||||
have_func("BN_check_prime(NULL, NULL, NULL)", "openssl/bn.h")
|
||||
|
||||
@ -1148,7 +1148,7 @@ ossl_sslctx_set_client_sigalgs(VALUE self, VALUE v)
|
||||
* contained in the key object, if any, are ignored. The server will always
|
||||
* generate a new key pair for each handshake.
|
||||
*
|
||||
* Added in version 3.0. See also the man page SSL_set0_tmp_dh_pkey(3).
|
||||
* Added in version 3.0. See also the man page SSL_CTX_set0_tmp_dh_pkey(3).
|
||||
*
|
||||
* Example:
|
||||
* ctx = OpenSSL::SSL::SSLContext.new
|
||||
@ -1169,7 +1169,7 @@ ossl_sslctx_set_tmp_dh(VALUE self, VALUE arg)
|
||||
if (EVP_PKEY_base_id(pkey) != EVP_PKEY_DH)
|
||||
rb_raise(eSSLError, "invalid pkey type %s (expected DH)",
|
||||
OBJ_nid2sn(EVP_PKEY_base_id(pkey)));
|
||||
#ifdef HAVE_SSL_SET0_TMP_DH_PKEY
|
||||
#ifdef HAVE_SSL_CTX_SET0_TMP_DH_PKEY
|
||||
if (!SSL_CTX_set0_tmp_dh_pkey(ctx, pkey))
|
||||
ossl_raise(eSSLError, "SSL_CTX_set0_tmp_dh_pkey");
|
||||
EVP_PKEY_up_ref(pkey);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user