Provide X509_REQ_get_signature_nid().
authorjsing <jsing@openbsd.org>
Thu, 22 Feb 2018 16:50:30 +0000 (16:50 +0000)
committerjsing <jsing@openbsd.org>
Thu, 22 Feb 2018 16:50:30 +0000 (16:50 +0000)
lib/libcrypto/Symbols.list
lib/libcrypto/asn1/x_req.c
lib/libcrypto/x509/x509.h

index 511c44c..fb10bde 100644 (file)
@@ -2791,6 +2791,7 @@ X509_REQ_get_attr_count
 X509_REQ_get_extension_nids
 X509_REQ_get_extensions
 X509_REQ_get_pubkey
+X509_REQ_get_signature_nid
 X509_REQ_it
 X509_REQ_new
 X509_REQ_print
index 38a6ec8..eb5210a 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: x_req.c,v 1.16 2018/02/20 17:06:19 jsing Exp $ */
+/* $OpenBSD: x_req.c,v 1.17 2018/02/22 16:50:30 jsing Exp $ */
 /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
  * All rights reserved.
  *
@@ -226,6 +226,12 @@ X509_REQ_dup(X509_REQ *x)
        return ASN1_item_dup(&X509_REQ_it, x);
 }
 
+int
+X509_REQ_get_signature_nid(const X509_REQ *req)
+{
+       return OBJ_obj2nid(req->sig_alg->algorithm);
+}
+
 void
 X509_REQ_get0_signature(const X509_REQ *req, const ASN1_BIT_STRING **psig,
     const X509_ALGOR **palg)
index c7695b4..9033b1d 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: x509.h,v 1.33 2018/02/22 16:47:50 jsing Exp $ */
+/* $OpenBSD: x509.h,v 1.34 2018/02/22 16:50:30 jsing Exp $ */
 /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
  * All rights reserved.
  *
@@ -611,6 +611,8 @@ 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);
 
+int X509_REQ_get_signature_nid(const X509_REQ *req);
+
 void X509_REQ_get0_signature(const X509_REQ *req, const ASN1_BIT_STRING **psig,
     const X509_ALGOR **palg);