diff --git a/CHANGES b/CHANGES index 21bff0eda12ceabb9df39132257268b312ad415a..9bdac6226d6a7d0a1b441d0dcdbec05afd0defe6 100644 --- a/CHANGES +++ b/CHANGES @@ -4,6 +4,10 @@ Changes between 1.0.1 and 1.1.0 [xx XXX xxxx] + *) New functions to retrieve certificate signature and signature + OID NID. + [Steve Henson] + *) Print out deprecated issuer and subject unique ID fields in certificates. [Steve Henson] diff --git a/crypto/asn1/x_x509.c b/crypto/asn1/x_x509.c index de3df9eb51c18401592f169e741fb5b867795d90..fd5e6c6428f29837548d54ad603ec71ff5143dbd 100644 --- a/crypto/asn1/x_x509.c +++ b/crypto/asn1/x_x509.c @@ -192,3 +192,17 @@ int i2d_X509_AUX(X509 *a, unsigned char **pp) if(a) length += i2d_X509_CERT_AUX(a->aux, pp); return length; } + +void X509_get0_signature(ASN1_BIT_STRING **psig, X509_ALGOR **palg, + const X509 *x) + { + if (psig) + *psig = x->signature; + if (palg) + *palg = x->sig_alg; + } + +int X509_get_signature_nid(const X509 *x) + { + return OBJ_obj2nid(x->sig_alg->algorithm); + } diff --git a/crypto/x509/x509.h b/crypto/x509/x509.h index 14ef1d3aad9e59023460a84c9da89b0c4fe25d81..85f3c73a9f66202a829760999e2ce44daf9bc35a 100644 --- a/crypto/x509/x509.h +++ b/crypto/x509/x509.h @@ -849,6 +849,10 @@ void *X509_get_ex_data(X509 *r, int idx); int i2d_X509_AUX(X509 *a,unsigned char **pp); X509 * d2i_X509_AUX(X509 **a,const unsigned char **pp,long length); +void X509_get0_signature(ASN1_BIT_STRING **psig, X509_ALGOR **palg, + const X509 *x); +int X509_get_signature_nid(const X509 *x); + int X509_alias_set1(X509 *x, unsigned char *name, int len); int X509_keyid_set1(X509 *x, unsigned char *id, int len); unsigned char * X509_alias_get0(X509 *x, int *len);