From: jsing Date: Wed, 14 Feb 2018 16:18:10 +0000 (+0000) Subject: Provide X509_get_signature_nid(). X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=343313920412ed77707824945bc52e4afc492272;p=openbsd Provide X509_get_signature_nid(). --- diff --git a/lib/libcrypto/Symbols.list b/lib/libcrypto/Symbols.list index 239b106ae3b..6dfd569e1fd 100644 --- a/lib/libcrypto/Symbols.list +++ b/lib/libcrypto/Symbols.list @@ -2800,32 +2800,32 @@ X509_VAL_it X509_VAL_new X509_VERIFY_PARAM_add0_policy X509_VERIFY_PARAM_add0_table +X509_VERIFY_PARAM_add1_host X509_VERIFY_PARAM_clear_flags X509_VERIFY_PARAM_free +X509_VERIFY_PARAM_get0 +X509_VERIFY_PARAM_get0_name +X509_VERIFY_PARAM_get0_peername +X509_VERIFY_PARAM_get_count X509_VERIFY_PARAM_get_depth X509_VERIFY_PARAM_get_flags X509_VERIFY_PARAM_inherit X509_VERIFY_PARAM_lookup X509_VERIFY_PARAM_new X509_VERIFY_PARAM_set1 +X509_VERIFY_PARAM_set1_email +X509_VERIFY_PARAM_set1_host +X509_VERIFY_PARAM_set1_ip +X509_VERIFY_PARAM_set1_ip_asc X509_VERIFY_PARAM_set1_name X509_VERIFY_PARAM_set1_policies X509_VERIFY_PARAM_set_depth X509_VERIFY_PARAM_set_flags +X509_VERIFY_PARAM_set_hostflags X509_VERIFY_PARAM_set_purpose X509_VERIFY_PARAM_set_time X509_VERIFY_PARAM_set_trust X509_VERIFY_PARAM_table_cleanup -X509_VERIFY_PARAM_set1_host -X509_VERIFY_PARAM_add1_host -X509_VERIFY_PARAM_set_hostflags -X509_VERIFY_PARAM_get0_peername -X509_VERIFY_PARAM_set1_email -X509_VERIFY_PARAM_set1_ip -X509_VERIFY_PARAM_set1_ip_asc -X509_VERIFY_PARAM_get0_name -X509_VERIFY_PARAM_get0 -X509_VERIFY_PARAM_get_count X509_add1_ext_i2d X509_add1_reject_object X509_add1_trust_object @@ -2874,6 +2874,7 @@ X509_get_issuer_name X509_get_pubkey X509_get_pubkey_parameters X509_get_serialNumber +X509_get_signature_nid X509_get_subject_name X509_gmtime_adj X509_issuer_and_serial_cmp diff --git a/lib/libcrypto/asn1/x_x509.c b/lib/libcrypto/asn1/x_x509.c index 168c2c0fcd5..c82301a8917 100644 --- a/lib/libcrypto/asn1/x_x509.c +++ b/lib/libcrypto/asn1/x_x509.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x_x509.c,v 1.24 2015/03/19 14:00:22 tedu Exp $ */ +/* $OpenBSD: x_x509.c,v 1.25 2018/02/14 16:18:10 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -344,3 +344,9 @@ i2d_X509_AUX(X509 *a, unsigned char **pp) length += i2d_X509_CERT_AUX(a->aux, pp); return length; } + +int +X509_get_signature_nid(const X509 *x) +{ + return OBJ_obj2nid(x->sig_alg->algorithm); +} diff --git a/lib/libcrypto/x509/x509.h b/lib/libcrypto/x509/x509.h index 056b6d118cb..cda89ac5afb 100644 --- a/lib/libcrypto/x509/x509.h +++ b/lib/libcrypto/x509/x509.h @@ -1,4 +1,4 @@ -/* $OpenBSD: x509.h,v 1.26 2016/12/27 16:05:57 jsing Exp $ */ +/* $OpenBSD: x509.h,v 1.27 2018/02/14 16:18:10 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -888,6 +888,8 @@ 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); +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);