From 2b65c176cd085e0f59d8b374162e97575ef2185e Mon Sep 17 00:00:00 2001 From: jsing Date: Tue, 20 Feb 2018 17:06:19 +0000 Subject: [PATCH] Provide X509_REQ_get0_signature() --- lib/libcrypto/Symbols.list | 1 + lib/libcrypto/asn1/x_req.c | 12 +++++++++++- lib/libcrypto/x509/x509.h | 5 ++++- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/lib/libcrypto/Symbols.list b/lib/libcrypto/Symbols.list index f57513291e5..f446e08ea7b 100644 --- a/lib/libcrypto/Symbols.list +++ b/lib/libcrypto/Symbols.list @@ -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 diff --git a/lib/libcrypto/asn1/x_req.c b/lib/libcrypto/asn1/x_req.c index 5ffa11e2ddf..38a6ec885cf 100644 --- a/lib/libcrypto/asn1/x_req.c +++ b/lib/libcrypto/asn1/x_req.c @@ -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; +} diff --git a/lib/libcrypto/x509/x509.h b/lib/libcrypto/x509/x509.h index 9d02e319aa0..26e71ee40e4 100644 --- a/lib/libcrypto/x509/x509.h +++ b/lib/libcrypto/x509/x509.h @@ -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), -- 2.20.1