diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2016-08-19 12:39:57 +0100 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2016-08-19 18:40:55 +0100 |
commit | 568ce3a583a17c33feacbf5028ece9f7f0680478 (patch) | |
tree | f55156e99147d3139ad974b7a9c44925982bf987 /crypto/x509/x509_set.c | |
parent | c4fbed6c3139726fc719a703d2195f3b6426b748 (diff) |
Constify certificate and CRL time routines.
Update certificate and CRL time routines to match new standard.
Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'crypto/x509/x509_set.c')
-rw-r--r-- | crypto/x509/x509_set.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/crypto/x509/x509_set.c b/crypto/x509/x509_set.c index 3cebf6ef3b..8bf367b645 100644 --- a/crypto/x509/x509_set.c +++ b/crypto/x509/x509_set.c @@ -71,14 +71,14 @@ int x509_set1_time(ASN1_TIME **ptm, const ASN1_TIME *tm) return (in != NULL); } -int X509_set_notBefore(X509 *x, const ASN1_TIME *tm) +int X509_set1_notBefore(X509 *x, const ASN1_TIME *tm) { if (x == NULL) return 0; return x509_set1_time(&x->cert_info.validity.notBefore, tm); } -int X509_set_notAfter(X509 *x, const ASN1_TIME *tm) +int X509_set1_notAfter(X509 *x, const ASN1_TIME *tm) { if (x == NULL) return 0; @@ -109,7 +109,18 @@ long X509_get_version(const X509 *x) return ASN1_INTEGER_get(x->cert_info.version); } -ASN1_TIME * X509_get_notBefore(const X509 *x) +const ASN1_TIME *X509_get0_notBefore(const X509 *x) +{ + return x->cert_info.validity.notBefore; +} + +const ASN1_TIME *X509_get0_notAfter(const X509 *x) +{ + return x->cert_info.validity.notAfter; +} + +#if OPENSSL_API_COMPAT < 0x10100000L +ASN1_TIME *X509_get_notBefore(const X509 *x) { return x->cert_info.validity.notBefore; } @@ -118,6 +129,7 @@ ASN1_TIME *X509_get_notAfter(const X509 *x) { return x->cert_info.validity.notAfter; } +#endif int X509_get_signature_type(const X509 *x) { |