diff options
author | tb <> | 2018-08-24 19:55:58 +0000 |
---|---|---|
committer | tb <> | 2018-08-24 19:55:58 +0000 |
commit | d005d0528a66f69dbf8fb1a50b86c1bf40e135bc (patch) | |
tree | 43973edb20204a6046f729ce0a80ed7b0b283066 /src/lib/libcrypto/x509/x509_set.c | |
parent | bf5473ed3db3f13d45280ab553b3c593d8e311ea (diff) | |
download | openbsd-d005d0528a66f69dbf8fb1a50b86c1bf40e135bc.tar.gz openbsd-d005d0528a66f69dbf8fb1a50b86c1bf40e135bc.tar.bz2 openbsd-d005d0528a66f69dbf8fb1a50b86c1bf40e135bc.zip |
Turn a number of #defines into proper functions with prototypes matching
those that OpenSSL has had for ages.
ok jsing
Diffstat (limited to 'src/lib/libcrypto/x509/x509_set.c')
-rw-r--r-- | src/lib/libcrypto/x509/x509_set.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/lib/libcrypto/x509/x509_set.c b/src/lib/libcrypto/x509/x509_set.c index becdaf6ce5..1a4b583ab7 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.16 2018/02/22 17:09:28 jsing Exp $ */ | 1 | /* $OpenBSD: x509_set.c,v 1.17 2018/08/24 19:55:58 tb 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 | * |
@@ -87,6 +87,12 @@ X509_set_version(X509 *x, long version) | |||
87 | return (ASN1_INTEGER_set(x->cert_info->version, version)); | 87 | return (ASN1_INTEGER_set(x->cert_info->version, version)); |
88 | } | 88 | } |
89 | 89 | ||
90 | long | ||
91 | X509_get_version(const X509 *x) | ||
92 | { | ||
93 | return ASN1_INTEGER_get(x->cert_info->version); | ||
94 | } | ||
95 | |||
90 | int | 96 | int |
91 | X509_set_serialNumber(X509 *x, ASN1_INTEGER *serial) | 97 | X509_set_serialNumber(X509 *x, ASN1_INTEGER *serial) |
92 | { | 98 | { |
@@ -204,3 +210,9 @@ X509_set_pubkey(X509 *x, EVP_PKEY *pkey) | |||
204 | return (0); | 210 | return (0); |
205 | return (X509_PUBKEY_set(&(x->cert_info->key), pkey)); | 211 | return (X509_PUBKEY_set(&(x->cert_info->key), pkey)); |
206 | } | 212 | } |
213 | |||
214 | int | ||
215 | X509_get_signature_type(const X509 *x) | ||
216 | { | ||
217 | return EVP_PKEY_type(OBJ_obj2nid(x->sig_alg->algorithm)); | ||
218 | } | ||