constify X509_REQ_get0_signature()
authorDr. Stephen Henson <steve@openssl.org>
Thu, 18 Aug 2016 14:13:00 +0000 (15:13 +0100)
committerDr. Stephen Henson <steve@openssl.org>
Fri, 19 Aug 2016 11:47:31 +0000 (12:47 +0100)
Reviewed-by: Matt Caswell <matt@openssl.org>
crypto/x509/t_req.c
crypto/x509/x509_req.c
doc/crypto/X509_get0_signature.pod
include/openssl/x509.h

index dbe4be3..0fced67 100644 (file)
@@ -174,9 +174,9 @@ int X509_REQ_print_ex(BIO *bp, X509_REQ *x, unsigned long nmflags,
     }
 
     if (!(cflag & X509_FLAG_NO_SIGDUMP)) {
-        X509_ALGOR *sig_alg;
-        ASN1_BIT_STRING *sig;
-        X509_REQ_get0_signature(&sig, &sig_alg, x);
+        const X509_ALGOR *sig_alg;
+        const ASN1_BIT_STRING *sig;
+        X509_REQ_get0_signature(x, &sig, &sig_alg);
         if (!X509_signature_print(bp, sig_alg, sig))
             goto err;
     }
index e7c2ae8..7b88dbc 100644 (file)
@@ -277,8 +277,8 @@ X509_NAME *X509_REQ_get_subject_name(const X509_REQ *req)
     return req->req_info.subject;
 }
 
-void X509_REQ_get0_signature(ASN1_BIT_STRING **psig, X509_ALGOR **palg,
-                             X509_REQ *req)
+void X509_REQ_get0_signature(const X509_REQ *req, const ASN1_BIT_STRING **psig,
+                             const X509_ALGOR **palg)
 {
     if (psig != NULL)
         *psig = req->signature;
index 0741dfb..61a2dda 100644 (file)
@@ -16,8 +16,9 @@ X509_CRL_get_signature_nid - signature information
  int X509_get_signature_nid(const X509 *x);
  const X509_ALGOR *X509_get0_tbs_sigalg(const X509 *x);
 
- void X509_REQ_get0_signature(ASN1_BIT_STRING **psig, X509_ALGOR **palg,
-                              const X509_REQ *crl);
+ void X509_REQ_get0_signature(const X509_REQ *crl,
+                              const ASN1_BIT_STRING **psig,
+                              const X509_ALGOR **palg);
  int X509_REQ_get_signature_nid(const X509_REQ *crl);
 
  void X509_CRL_get0_signature(const X509_CRL *crl,
index 48de4de..7822712 100644 (file)
@@ -647,8 +647,8 @@ long X509_REQ_get_version(const X509_REQ *req);
 int X509_REQ_set_version(X509_REQ *x, long version);
 X509_NAME *X509_REQ_get_subject_name(const X509_REQ *req);
 int X509_REQ_set_subject_name(X509_REQ *req, X509_NAME *name);
-void X509_REQ_get0_signature(ASN1_BIT_STRING **psig, X509_ALGOR **palg,
-                             X509_REQ *req);
+void X509_REQ_get0_signature(const X509_REQ *req, const ASN1_BIT_STRING **psig,
+                             const X509_ALGOR **palg);
 int X509_REQ_get_signature_nid(const X509_REQ *req);
 int i2d_re_X509_REQ_tbs(X509_REQ *req, unsigned char **pp);
 int X509_REQ_set_pubkey(X509_REQ *x, EVP_PKEY *pkey);