From: jsing Date: Thu, 22 Feb 2018 17:09:28 +0000 (+0000) Subject: Provide X509_get0_tbs_sigalg(). X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=f5f16abc2d28c2f448ad2402d19c9d509be8e5cd;p=openbsd Provide X509_get0_tbs_sigalg(). --- diff --git a/lib/libcrypto/Symbols.list b/lib/libcrypto/Symbols.list index c4daf0e7680..fe4c0d1c4ed 100644 --- a/lib/libcrypto/Symbols.list +++ b/lib/libcrypto/Symbols.list @@ -2958,6 +2958,7 @@ X509_get0_notBefore X509_get0_pubkey X509_get0_pubkey_bitstr X509_get0_signature +X509_get0_tbs_sigalg X509_get1_email X509_get1_ocsp X509_get_default_cert_area diff --git a/lib/libcrypto/x509/x509.h b/lib/libcrypto/x509/x509.h index cfa08b41b1b..92f012ea6d2 100644 --- a/lib/libcrypto/x509/x509.h +++ b/lib/libcrypto/x509/x509.h @@ -1,4 +1,4 @@ -/* $OpenBSD: x509.h,v 1.39 2018/02/22 17:06:42 jsing Exp $ */ +/* $OpenBSD: x509.h,v 1.40 2018/02/22 17:09:28 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -979,7 +979,8 @@ int ASN1_item_sign_ctx(const ASN1_ITEM *it, #endif const STACK_OF(X509_EXTENSION) *X509_get0_extensions(const X509 *x); -int X509_set_version(X509 *x,long version); +const X509_ALGOR *X509_get0_tbs_sigalg(const X509 *x); +int X509_set_version(X509 *x, long version); int X509_set_serialNumber(X509 *x, ASN1_INTEGER *serial); ASN1_INTEGER * X509_get_serialNumber(X509 *x); int X509_set_issuer_name(X509 *x, X509_NAME *name); diff --git a/lib/libcrypto/x509/x509_set.c b/lib/libcrypto/x509/x509_set.c index 06ff12c1467..becdaf6ce5b 100644 --- a/lib/libcrypto/x509/x509_set.c +++ b/lib/libcrypto/x509/x509_set.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x509_set.c,v 1.15 2018/02/22 17:06:42 jsing Exp $ */ +/* $OpenBSD: x509_set.c,v 1.16 2018/02/22 17:09:28 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -69,6 +69,12 @@ X509_get0_extensions(const X509 *x) return x->cert_info->extensions; } +const X509_ALGOR * +X509_get0_tbs_sigalg(const X509 *x) +{ + return x->cert_info->signature; +} + int X509_set_version(X509 *x, long version) {