From: tb Date: Fri, 24 Aug 2018 19:59:32 +0000 (+0000) Subject: Provide X509_get0_serialNumber() X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=478031058cd0de9cbca134b217521c57a97fcc19;p=openbsd Provide X509_get0_serialNumber() tested in a bulk by sthen ok jsing --- diff --git a/lib/libcrypto/Symbols.list b/lib/libcrypto/Symbols.list index dc11ea497fc..191e967e345 100644 --- a/lib/libcrypto/Symbols.list +++ b/lib/libcrypto/Symbols.list @@ -3016,6 +3016,7 @@ X509_get_ext_d2i X509_get_issuer_name X509_get_pubkey X509_get_pubkey_parameters +X509_get0_serialNumber X509_get_serialNumber X509_get_signature_nid X509_get_signature_type diff --git a/lib/libcrypto/x509/x509.h b/lib/libcrypto/x509/x509.h index e6b205b7fce..25af8314b24 100644 --- a/lib/libcrypto/x509/x509.h +++ b/lib/libcrypto/x509/x509.h @@ -1,4 +1,4 @@ -/* $OpenBSD: x509.h,v 1.70 2018/08/24 19:55:58 tb Exp $ */ +/* $OpenBSD: x509.h,v 1.71 2018/08/24 19:59:32 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -979,6 +979,7 @@ int X509_set_version(X509 *x, long version); long X509_get_version(const X509 *x); int X509_set_serialNumber(X509 *x, ASN1_INTEGER *serial); ASN1_INTEGER * X509_get_serialNumber(X509 *x); +const ASN1_INTEGER *X509_get0_serialNumber(const X509 *x); int X509_set_issuer_name(X509 *x, X509_NAME *name); X509_NAME * X509_get_issuer_name(const X509 *a); int X509_set_subject_name(X509 *x, X509_NAME *name); diff --git a/lib/libcrypto/x509/x509_cmp.c b/lib/libcrypto/x509/x509_cmp.c index 6819c3b1f7a..2141f871e5e 100644 --- a/lib/libcrypto/x509/x509_cmp.c +++ b/lib/libcrypto/x509/x509_cmp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x509_cmp.c,v 1.33 2018/05/18 19:24:08 tb Exp $ */ +/* $OpenBSD: x509_cmp.c,v 1.34 2018/08/24 19:59:32 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -176,6 +176,12 @@ X509_get_serialNumber(X509 *a) return (a->cert_info->serialNumber); } +const ASN1_INTEGER * +X509_get0_serialNumber(const X509 *a) +{ + return (a->cert_info->serialNumber); +} + unsigned long X509_subject_name_hash(X509 *x) {