mirror of
https://github.com/isc-projects/bind9.git
synced 2026-06-11 11:29:59 -04:00
OpenSSL 4 compatibility fix
Starting from OpenSSL 4 the the X509_get_subject_name() function
returns a 'const' pointer to a name instead of a regular pointer.
Duplicate the name before operating on it, then free it.
(cherry picked from commit 336c523b79)
This commit is contained in:
parent
ce0d28d19c
commit
6e07cc19cc
1 changed files with 4 additions and 1 deletions
|
|
@ -462,7 +462,7 @@ isc_tlsctx_createserver(const char *keyfile, const char *certfile,
|
|||
|
||||
X509_set_pubkey(cert, pkey);
|
||||
|
||||
X509_NAME *name = X509_get_subject_name(cert);
|
||||
X509_NAME *name = X509_NAME_dup(X509_get_subject_name(cert));
|
||||
|
||||
X509_NAME_add_entry_by_txt(name, "C", MBSTRING_ASC,
|
||||
(const unsigned char *)"AQ", -1, -1,
|
||||
|
|
@ -477,6 +477,9 @@ isc_tlsctx_createserver(const char *keyfile, const char *certfile,
|
|||
-1, -1, 0);
|
||||
|
||||
X509_set_issuer_name(cert, name);
|
||||
|
||||
X509_NAME_free(name);
|
||||
|
||||
X509_sign(cert, pkey, EVP_sha256());
|
||||
rv = SSL_CTX_use_certificate(ctx, cert);
|
||||
if (rv != 1) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue