summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjsing <>2018-02-17 15:50:42 +0000
committerjsing <>2018-02-17 15:50:42 +0000
commit03a712df0b3b84b1cbf608cae685e0abab3d4820 (patch)
treea1a8d00a0481732fb7c3778126076a12781f423c /src
parent3a5371ec683ea0509dc8876c66b1132bc8eab086 (diff)
downloadopenbsd-03a712df0b3b84b1cbf608cae685e0abab3d4820.tar.gz
openbsd-03a712df0b3b84b1cbf608cae685e0abab3d4820.tar.bz2
openbsd-03a712df0b3b84b1cbf608cae685e0abab3d4820.zip
Provide X509_get0_extensions() and X509_get0_signature()
Diffstat (limited to 'src')
-rw-r--r--src/lib/libcrypto/Symbols.list8
-rw-r--r--src/lib/libcrypto/asn1/x_x509.c12
-rw-r--r--src/lib/libcrypto/x509/x509.h6
-rw-r--r--src/lib/libcrypto/x509/x509_set.c8
4 files changed, 27 insertions, 7 deletions
diff --git a/src/lib/libcrypto/Symbols.list b/src/lib/libcrypto/Symbols.list
index d633575397..85c65a8ca8 100644
--- a/src/lib/libcrypto/Symbols.list
+++ b/src/lib/libcrypto/Symbols.list
@@ -1352,13 +1352,13 @@ EVP_PKEY_encrypt_init
1352EVP_PKEY_encrypt_old 1352EVP_PKEY_encrypt_old
1353EVP_PKEY_free 1353EVP_PKEY_free
1354EVP_PKEY_get0 1354EVP_PKEY_get0
1355EVP_PKEY_get0_asn1
1356EVP_PKEY_get0_DH 1355EVP_PKEY_get0_DH
1357EVP_PKEY_get1_DH
1358EVP_PKEY_get0_DSA 1356EVP_PKEY_get0_DSA
1357EVP_PKEY_get0_RSA
1358EVP_PKEY_get0_asn1
1359EVP_PKEY_get1_DH
1359EVP_PKEY_get1_DSA 1360EVP_PKEY_get1_DSA
1360EVP_PKEY_get1_EC_KEY 1361EVP_PKEY_get1_EC_KEY
1361EVP_PKEY_get0_RSA
1362EVP_PKEY_get1_RSA 1362EVP_PKEY_get1_RSA
1363EVP_PKEY_get_attr 1363EVP_PKEY_get_attr
1364EVP_PKEY_get_attr_by_NID 1364EVP_PKEY_get_attr_by_NID
@@ -2885,9 +2885,11 @@ X509_email_free
2885X509_find_by_issuer_and_serial 2885X509_find_by_issuer_and_serial
2886X509_find_by_subject 2886X509_find_by_subject
2887X509_free 2887X509_free
2888X509_get0_extensions
2888X509_get0_notAfter 2889X509_get0_notAfter
2889X509_get0_notBefore 2890X509_get0_notBefore
2890X509_get0_pubkey_bitstr 2891X509_get0_pubkey_bitstr
2892X509_get0_signature
2891X509_get1_email 2893X509_get1_email
2892X509_get1_ocsp 2894X509_get1_ocsp
2893X509_get_default_cert_area 2895X509_get_default_cert_area
diff --git a/src/lib/libcrypto/asn1/x_x509.c b/src/lib/libcrypto/asn1/x_x509.c
index c82301a891..6a56a795c0 100644
--- a/src/lib/libcrypto/asn1/x_x509.c
+++ b/src/lib/libcrypto/asn1/x_x509.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x_x509.c,v 1.25 2018/02/14 16:18:10 jsing Exp $ */ 1/* $OpenBSD: x_x509.c,v 1.26 2018/02/17 15:50:42 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -345,6 +345,16 @@ i2d_X509_AUX(X509 *a, unsigned char **pp)
345 return length; 345 return length;
346} 346}
347 347
348void
349X509_get0_signature(const ASN1_BIT_STRING **psig, const X509_ALGOR **palg,
350 const X509 *x)
351{
352 if (psig != NULL)
353 *psig = x->signature;
354 if (palg != NULL)
355 *palg = x->sig_alg;
356}
357
348int 358int
349X509_get_signature_nid(const X509 *x) 359X509_get_signature_nid(const X509 *x)
350{ 360{
diff --git a/src/lib/libcrypto/x509/x509.h b/src/lib/libcrypto/x509/x509.h
index 0cb9e2826a..6d6451171c 100644
--- a/src/lib/libcrypto/x509/x509.h
+++ b/src/lib/libcrypto/x509/x509.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509.h,v 1.28 2018/02/14 16:57:25 jsing Exp $ */ 1/* $OpenBSD: x509.h,v 1.29 2018/02/17 15:50:42 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -887,7 +887,8 @@ int X509_set_ex_data(X509 *r, int idx, void *arg);
887void *X509_get_ex_data(X509 *r, int idx); 887void *X509_get_ex_data(X509 *r, int idx);
888int i2d_X509_AUX(X509 *a,unsigned char **pp); 888int i2d_X509_AUX(X509 *a,unsigned char **pp);
889X509 * d2i_X509_AUX(X509 **a,const unsigned char **pp,long length); 889X509 * d2i_X509_AUX(X509 **a,const unsigned char **pp,long length);
890 890void X509_get0_signature(const ASN1_BIT_STRING **psig,
891 const X509_ALGOR **palg, const X509 *x);
891int X509_get_signature_nid(const X509 *x); 892int X509_get_signature_nid(const X509 *x);
892 893
893int X509_alias_set1(X509 *x, unsigned char *name, int len); 894int X509_alias_set1(X509 *x, unsigned char *name, int len);
@@ -960,6 +961,7 @@ int ASN1_item_sign_ctx(const ASN1_ITEM *it,
960 ASN1_BIT_STRING *signature, void *asn, EVP_MD_CTX *ctx); 961 ASN1_BIT_STRING *signature, void *asn, EVP_MD_CTX *ctx);
961#endif 962#endif
962 963
964const STACK_OF(X509_EXTENSION) *X509_get0_extensions(const X509 *x);
963int X509_set_version(X509 *x,long version); 965int X509_set_version(X509 *x,long version);
964int X509_set_serialNumber(X509 *x, ASN1_INTEGER *serial); 966int X509_set_serialNumber(X509 *x, ASN1_INTEGER *serial);
965ASN1_INTEGER * X509_get_serialNumber(X509 *x); 967ASN1_INTEGER * X509_get_serialNumber(X509 *x);
diff --git a/src/lib/libcrypto/x509/x509_set.c b/src/lib/libcrypto/x509/x509_set.c
index e60d6f967a..a43f009930 100644
--- a/src/lib/libcrypto/x509/x509_set.c
+++ b/src/lib/libcrypto/x509/x509_set.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509_set.c,v 1.13 2018/02/14 16:57:25 jsing Exp $ */ 1/* $OpenBSD: x509_set.c,v 1.14 2018/02/17 15:50:42 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -63,6 +63,12 @@
63#include <openssl/objects.h> 63#include <openssl/objects.h>
64#include <openssl/x509.h> 64#include <openssl/x509.h>
65 65
66const STACK_OF(X509_EXTENSION) *
67X509_get0_extensions(const X509 *x)
68{
69 return x->cert_info->extensions;
70}
71
66int 72int
67X509_set_version(X509 *x, long version) 73X509_set_version(X509 *x, long version)
68{ 74{