diff options
author | Joel Sing <jsing@cvs.openbsd.org> | 2018-02-22 17:06:43 +0000 |
---|---|---|
committer | Joel Sing <jsing@cvs.openbsd.org> | 2018-02-22 17:06:43 +0000 |
commit | b04538640f71a870a948e9323fb6b4fdc4567c80 (patch) | |
tree | d8a89e61c665653b84cef78f2e6fb85cac7d7317 /lib/libcrypto/x509 | |
parent | 1fc1769fd2f8ca4e70e5a228566e675229846544 (diff) |
Provide X509_set1_notBefore() and X509_set1_notAfter().
Diffstat (limited to 'lib/libcrypto/x509')
-rw-r--r-- | lib/libcrypto/x509/x509.h | 4 | ||||
-rw-r--r-- | lib/libcrypto/x509/x509_set.c | 14 |
2 files changed, 16 insertions, 2 deletions
diff --git a/lib/libcrypto/x509/x509.h b/lib/libcrypto/x509/x509.h index 1dafabe971b..cfa08b41b1b 100644 --- a/lib/libcrypto/x509/x509.h +++ b/lib/libcrypto/x509/x509.h @@ -1,4 +1,4 @@ -/* $OpenBSD: x509.h,v 1.38 2018/02/22 17:05:35 jsing Exp $ */ +/* $OpenBSD: x509.h,v 1.39 2018/02/22 17:06:42 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -987,7 +987,9 @@ X509_NAME * X509_get_issuer_name(X509 *a); int X509_set_subject_name(X509 *x, X509_NAME *name); X509_NAME * X509_get_subject_name(X509 *a); int X509_set_notBefore(X509 *x, const ASN1_TIME *tm); +int X509_set1_notBefore(X509 *x, const ASN1_TIME *tm); int X509_set_notAfter(X509 *x, const ASN1_TIME *tm); +int X509_set1_notAfter(X509 *x, const ASN1_TIME *tm); const ASN1_TIME *X509_get0_notBefore(const X509 *x); ASN1_TIME *X509_getm_notBefore(const X509 *x); const ASN1_TIME *X509_get0_notAfter(const X509 *x); diff --git a/lib/libcrypto/x509/x509_set.c b/lib/libcrypto/x509/x509_set.c index a43f0099306..06ff12c1467 100644 --- a/lib/libcrypto/x509/x509_set.c +++ b/lib/libcrypto/x509/x509_set.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x509_set.c,v 1.14 2018/02/17 15:50:42 jsing Exp $ */ +/* $OpenBSD: x509_set.c,v 1.15 2018/02/22 17:06:42 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -147,6 +147,12 @@ X509_set_notBefore(X509 *x, const ASN1_TIME *tm) return (in != NULL); } +int +X509_set1_notBefore(X509 *x, const ASN1_TIME *tm) +{ + return X509_set_notBefore(x, tm); +} + const ASN1_TIME * X509_get0_notAfter(const X509 *x) { @@ -180,6 +186,12 @@ X509_set_notAfter(X509 *x, const ASN1_TIME *tm) } int +X509_set1_notAfter(X509 *x, const ASN1_TIME *tm) +{ + return X509_set_notAfter(x, tm); +} + +int X509_set_pubkey(X509 *x, EVP_PKEY *pkey) { if ((x == NULL) || (x->cert_info == NULL)) |