From b21ba6f885d14cdb277fd98cc2bd85b638e91364 Mon Sep 17 00:00:00 2001 From: jsing Date: Thu, 22 Feb 2018 17:06:42 +0000 Subject: [PATCH] Provide X509_set1_notBefore() and X509_set1_notAfter(). --- lib/libcrypto/Symbols.list | 2 ++ lib/libcrypto/x509/x509.h | 4 +++- lib/libcrypto/x509/x509_set.c | 14 +++++++++++++- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/lib/libcrypto/Symbols.list b/lib/libcrypto/Symbols.list index 15cc4710be3..c4daf0e7680 100644 --- a/lib/libcrypto/Symbols.list +++ b/lib/libcrypto/Symbols.list @@ -3013,6 +3013,8 @@ X509_print_ex_fp X509_print_fp X509_pubkey_digest X509_reject_clear +X509_set1_notAfter +X509_set1_notBefore X509_set_ex_data X509_set_issuer_name X509_set_notAfter 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) { @@ -179,6 +185,12 @@ X509_set_notAfter(X509 *x, const ASN1_TIME *tm) return (in != NULL); } +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) { -- 2.20.1