Provide X509_get0_serialNumber()
authortb <tb@openbsd.org>
Fri, 24 Aug 2018 19:59:32 +0000 (19:59 +0000)
committertb <tb@openbsd.org>
Fri, 24 Aug 2018 19:59:32 +0000 (19:59 +0000)
tested in a bulk by sthen
ok jsing

lib/libcrypto/Symbols.list
lib/libcrypto/x509/x509.h
lib/libcrypto/x509/x509_cmp.c

index dc11ea4..191e967 100644 (file)
@@ -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
index e6b205b..25af831 100644 (file)
@@ -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);
index 6819c3b..2141f87 100644 (file)
@@ -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)
 {