Provide X509_REQ_get0_signature()
authorjsing <jsing@openbsd.org>
Tue, 20 Feb 2018 17:06:19 +0000 (17:06 +0000)
committerjsing <jsing@openbsd.org>
Tue, 20 Feb 2018 17:06:19 +0000 (17:06 +0000)
lib/libcrypto/Symbols.list
lib/libcrypto/asn1/x_req.c
lib/libcrypto/x509/x509.h

index f575132..f446e08 100644 (file)
@@ -2750,6 +2750,7 @@ X509_REQ_digest
 X509_REQ_dup
 X509_REQ_extension_nid
 X509_REQ_free
+X509_REQ_get0_signature
 X509_REQ_get1_email
 X509_REQ_get_attr
 X509_REQ_get_attr_by_NID
index 5ffa11e..38a6ec8 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: x_req.c,v 1.15 2015/02/11 04:00:39 jsing Exp $ */
+/* $OpenBSD: x_req.c,v 1.16 2018/02/20 17:06:19 jsing Exp $ */
 /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
  * All rights reserved.
  *
@@ -225,3 +225,13 @@ X509_REQ_dup(X509_REQ *x)
 {
        return ASN1_item_dup(&X509_REQ_it, x);
 }
+
+void
+X509_REQ_get0_signature(const X509_REQ *req, const ASN1_BIT_STRING **psig,
+    const X509_ALGOR **palg)
+{
+       if (psig != NULL)
+               *psig = req->signature;
+       if (palg != NULL)
+               *palg = req->sig_alg;
+}
index 9d02e31..26e71ee 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: x509.h,v 1.30 2018/02/20 17:04:58 jsing Exp $ */
+/* $OpenBSD: x509.h,v 1.31 2018/02/20 17:06:19 jsing Exp $ */
 /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
  * All rights reserved.
  *
@@ -611,6 +611,9 @@ const ASN1_TIME *X509_CRL_get0_nextUpdate(const X509_CRL *crl);
 void X509_CRL_get0_signature(const X509_CRL *crl, const ASN1_BIT_STRING **psig,
     const X509_ALGOR **palg);
 
+void X509_REQ_get0_signature(const X509_REQ *req, const ASN1_BIT_STRING **psig,
+    const X509_ALGOR **palg);
+
 void X509_CRL_set_default_method(const X509_CRL_METHOD *meth);
 X509_CRL_METHOD *X509_CRL_METHOD_new(
        int (*crl_init)(X509_CRL *crl),