[rs-commit] r149 - in /mod_csr/trunk: mod_csr.c openssl_setter_compat.h

rs-commit at redwax.eu rs-commit at redwax.eu
Wed Dec 4 22:04:43 CET 2019


Author: dirkx at redwax.eu
Date: Wed Dec  4 22:04:41 2019
New Revision: 149

Log:
Adapt to changens on openssl-master for 1.1.1e

Modified:
    mod_csr/trunk/mod_csr.c
    mod_csr/trunk/openssl_setter_compat.h

Modified: mod_csr/trunk/mod_csr.c
==============================================================================
--- mod_csr/trunk/mod_csr.c	(original)
+++ mod_csr/trunk/mod_csr.c	Wed Dec  4 22:04:41 2019
@@ -901,8 +901,8 @@
     /* duplicate the signature algorithm */
 #if OPENSSL_VERSION_NUMBER  >= 0x010100000L
     const X509_ALGOR *psigalg;
-    X509_REQ_get0_signature(req,NULL /* no need for signature */,&psigalg);
-    X509_REQ_set0_signature(creq, NULL, X509_ALGOR_dup((X509_ALGOR*)psigalg));
+    X509_REQ_get0_signature(req, NULL, &psigalg);
+    X509_REQ_set1_signature(creq, X509_ALGOR_dup((X509_ALGOR*)psigalg));
 #else
     creq->sig_alg = X509_ALGOR_dup(req->sig_alg);
 #endif

Modified: mod_csr/trunk/openssl_setter_compat.h
==============================================================================
--- mod_csr/trunk/openssl_setter_compat.h	(original)
+++ mod_csr/trunk/openssl_setter_compat.h	Wed Dec  4 22:04:41 2019
@@ -53,12 +53,13 @@
 # endif
 };
 
-static void X509_REQ_set0_signature(X509_REQ *req, ASN1_BIT_STRING *psigOrNull,
-                             X509_ALGOR *palgOrNull)
+
+void X509_REQ_set1_signature(X509_REQ *req, X509_ALGOR *palg)
 {
-    if (psigOrNull != NULL)
-        req->signature = psigOrNull;
-    if (palgOrNull != NULL)
-        req->sig_alg = *palgOrNull;
+    if (req->sig_alg.algorithm)
+        ASN1_OBJECT_free(req->sig_alg.algorithm);
+    if (req->sig_alg.parameter)
+        ASN1_TYPE_free(req->sig_alg.parameter);
+    req->sig_alg = *palg;
 }
 #endif



More information about the rs-commit mailing list