From 5f92c14a359d6e4fe6bd918c90f814b13c46965c Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Wed, 1 Jun 2016 21:47:10 -0700 Subject: backport a function from 1.1.0 for x.509 (#2939) --- src/_cffi_src/openssl/x509.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/_cffi_src') diff --git a/src/_cffi_src/openssl/x509.py b/src/_cffi_src/openssl/x509.py index b0ff9844..28f00da7 100644 --- a/src/_cffi_src/openssl/x509.py +++ b/src/_cffi_src/openssl/x509.py @@ -281,6 +281,7 @@ int i2d_X509_REQ_INFO(X509_REQ_INFO *, unsigned char **); /* new in 1.0.2 */ int i2d_re_X509_tbs(X509 *, unsigned char **); void X509_get0_signature(ASN1_BIT_STRING **, X509_ALGOR **, X509 *); +int X509_get_signature_nid(const X509 *); long X509_get_version(X509 *); @@ -377,6 +378,12 @@ void X509_get0_signature(ASN1_BIT_STRING **psig, X509_ALGOR **palg, if (palg) *palg = x->sig_alg; } + +int X509_get_signature_nid(const X509 *x) +{ + return OBJ_obj2nid(x->sig_alg->algorithm); +} + #endif /* Added in 1.0.2 but we need it in all versions now due to the great opaquing. */ -- cgit v1.2.3