summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjsing <>2018-02-22 17:06:42 +0000
committerjsing <>2018-02-22 17:06:42 +0000
commit26cd94af21f5006f80cc6b25e56eb31b2431ee6a (patch)
treebb53ea4de33ac6f3174b631b55b72b7afee1c289
parent4a2e703021eacb933a1599516f6fc8c54d296bc4 (diff)
downloadopenbsd-26cd94af21f5006f80cc6b25e56eb31b2431ee6a.tar.gz
openbsd-26cd94af21f5006f80cc6b25e56eb31b2431ee6a.tar.bz2
openbsd-26cd94af21f5006f80cc6b25e56eb31b2431ee6a.zip
Provide X509_set1_notBefore() and X509_set1_notAfter().
-rw-r--r--src/lib/libcrypto/Symbols.list2
-rw-r--r--src/lib/libcrypto/x509/x509.h4
-rw-r--r--src/lib/libcrypto/x509/x509_set.c14
3 files changed, 18 insertions, 2 deletions
diff --git a/src/lib/libcrypto/Symbols.list b/src/lib/libcrypto/Symbols.list
index 15cc4710be..c4daf0e768 100644
--- a/src/lib/libcrypto/Symbols.list
+++ b/src/lib/libcrypto/Symbols.list
@@ -3013,6 +3013,8 @@ X509_print_ex_fp
3013X509_print_fp 3013X509_print_fp
3014X509_pubkey_digest 3014X509_pubkey_digest
3015X509_reject_clear 3015X509_reject_clear
3016X509_set1_notAfter
3017X509_set1_notBefore
3016X509_set_ex_data 3018X509_set_ex_data
3017X509_set_issuer_name 3019X509_set_issuer_name
3018X509_set_notAfter 3020X509_set_notAfter
diff --git a/src/lib/libcrypto/x509/x509.h b/src/lib/libcrypto/x509/x509.h
index 1dafabe971..cfa08b41b1 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.38 2018/02/22 17:05:35 jsing Exp $ */ 1/* $OpenBSD: x509.h,v 1.39 2018/02/22 17:06: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 *
@@ -987,7 +987,9 @@ X509_NAME * X509_get_issuer_name(X509 *a);
987int X509_set_subject_name(X509 *x, X509_NAME *name); 987int X509_set_subject_name(X509 *x, X509_NAME *name);
988X509_NAME * X509_get_subject_name(X509 *a); 988X509_NAME * X509_get_subject_name(X509 *a);
989int X509_set_notBefore(X509 *x, const ASN1_TIME *tm); 989int X509_set_notBefore(X509 *x, const ASN1_TIME *tm);
990int X509_set1_notBefore(X509 *x, const ASN1_TIME *tm);
990int X509_set_notAfter(X509 *x, const ASN1_TIME *tm); 991int X509_set_notAfter(X509 *x, const ASN1_TIME *tm);
992int X509_set1_notAfter(X509 *x, const ASN1_TIME *tm);
991const ASN1_TIME *X509_get0_notBefore(const X509 *x); 993const ASN1_TIME *X509_get0_notBefore(const X509 *x);
992ASN1_TIME *X509_getm_notBefore(const X509 *x); 994ASN1_TIME *X509_getm_notBefore(const X509 *x);
993const ASN1_TIME *X509_get0_notAfter(const X509 *x); 995const ASN1_TIME *X509_get0_notAfter(const X509 *x);
diff --git a/src/lib/libcrypto/x509/x509_set.c b/src/lib/libcrypto/x509/x509_set.c
index a43f009930..06ff12c146 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.14 2018/02/17 15:50:42 jsing Exp $ */ 1/* $OpenBSD: x509_set.c,v 1.15 2018/02/22 17:06: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 *
@@ -147,6 +147,12 @@ X509_set_notBefore(X509 *x, const ASN1_TIME *tm)
147 return (in != NULL); 147 return (in != NULL);
148} 148}
149 149
150int
151X509_set1_notBefore(X509 *x, const ASN1_TIME *tm)
152{
153 return X509_set_notBefore(x, tm);
154}
155
150const ASN1_TIME * 156const ASN1_TIME *
151X509_get0_notAfter(const X509 *x) 157X509_get0_notAfter(const X509 *x)
152{ 158{
@@ -180,6 +186,12 @@ X509_set_notAfter(X509 *x, const ASN1_TIME *tm)
180} 186}
181 187
182int 188int
189X509_set1_notAfter(X509 *x, const ASN1_TIME *tm)
190{
191 return X509_set_notAfter(x, tm);
192}
193
194int
183X509_set_pubkey(X509 *x, EVP_PKEY *pkey) 195X509_set_pubkey(X509 *x, EVP_PKEY *pkey)
184{ 196{
185 if ((x == NULL) || (x->cert_info == NULL)) 197 if ((x == NULL) || (x->cert_info == NULL))