Skip to content

Commit 67f20c0

Browse files
committed
fixup! Add const qualifiers for OpenSSL 4.0 compatibility
1 parent 8101b7b commit 67f20c0

5 files changed

Lines changed: 10 additions & 5 deletions

File tree

ext/openssl/ossl_x509cert.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ ossl_x509_new(const X509 *x509)
5454
VALUE obj;
5555

5656
obj = NewX509(cX509Cert);
57-
new = X509_dup(x509);
57+
/* OpenSSL 1.1.1 takes a non-const pointer */
58+
new = X509_dup((X509 *)x509);
5859
if (!new)
5960
ossl_raise(eX509CertError, "X509_dup");
6061
SetX509(obj, new);

ext/openssl/ossl_x509crl.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ ossl_x509crl_new(const X509_CRL *crl)
6464
VALUE obj;
6565

6666
obj = NewX509CRL(cX509CRL);
67-
tmp = X509_CRL_dup(crl);
67+
/* OpenSSL 1.1.1 takes a non-const pointer */
68+
tmp = X509_CRL_dup((X509_CRL *)crl);
6869
if (!tmp)
6970
ossl_raise(eX509CRLError, "X509_CRL_dup");
7071
SetX509CRL(obj, tmp);

ext/openssl/ossl_x509ext.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ ossl_x509ext_new(const X509_EXTENSION *ext)
6868
VALUE obj;
6969

7070
obj = NewX509Ext(cX509Ext);
71-
new = X509_EXTENSION_dup(ext);
71+
/* OpenSSL 1.1.1 takes a non-const pointer */
72+
new = X509_EXTENSION_dup((X509_EXTENSION *)ext);
7273
if (!new)
7374
ossl_raise(eX509ExtError, "X509_EXTENSION_dup");
7475
SetX509Ext(obj, new);

ext/openssl/ossl_x509name.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ ossl_x509name_new(const X509_NAME *name)
5959
VALUE obj;
6060

6161
obj = NewX509Name(cX509Name);
62-
new = X509_NAME_dup(name);
62+
/* OpenSSL 1.1.1 takes a non-const pointer */
63+
new = X509_NAME_dup((X509_NAME *)name);
6364
if (!new)
6465
ossl_raise(eX509NameError, "X509_NAME_dup");
6566
SetX509Name(obj, new);

ext/openssl/ossl_x509revoked.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ ossl_x509revoked_new(const X509_REVOKED *rev)
5454
VALUE obj;
5555

5656
obj = NewX509Rev(cX509Rev);
57-
new = X509_REVOKED_dup(rev);
57+
/* OpenSSL 1.1.1 takes a non-const pointer */
58+
new = X509_REVOKED_dup((X509_REVOKED *)rev);
5859
if (!new)
5960
ossl_raise(eX509RevError, "X509_REVOKED_dup");
6061
SetX509Rev(obj, new);

0 commit comments

Comments
 (0)