diff options
author | Rich Salz <rsalz@openssl.org> | 2017-06-11 22:36:07 +0200 |
---|---|---|
committer | Rich Salz <rsalz@openssl.org> | 2017-06-11 22:36:07 +0200 |
commit | 04e62715db684d83bffac53793ff4cfac51e047a (patch) | |
tree | b286fb5cda68811e59d3bc5779cec8b9ff2e14ed /apps/apps.c | |
parent | doc/man3: use the documented coding style in the example code (diff) | |
download | openssl-04e62715db684d83bffac53793ff4cfac51e047a.tar.xz openssl-04e62715db684d83bffac53793ff4cfac51e047a.zip |
Introduce ASN1_TIME_set_string_X509 API
Make funcs to deal with non-null-term'd string
in both asn1_generalizedtime_to_tm() and asn1_utctime_to_tm().
Fixes issue #3444.
This one is used to enforce strict format (RFC 5280) check and to
convert GeneralizedTime to UTCTime.
apps/ca has been changed to use the new API.
Test cases and documentation are updated/added
Signed-off-by: Paul Yang <paulyang.inf@gmail.com>
Reviewed-by: Kurt Roeckx <kurt@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3566)
Diffstat (limited to 'apps/apps.c')
-rw-r--r-- | apps/apps.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/apps/apps.c b/apps/apps.c index 1a1b7ec309..15cf4a76f0 100644 --- a/apps/apps.c +++ b/apps/apps.c @@ -2662,14 +2662,14 @@ int set_cert_times(X509 *x, const char *startdate, const char *enddate, if (X509_gmtime_adj(X509_getm_notBefore(x), 0) == NULL) return 0; } else { - if (!ASN1_TIME_set_string(X509_getm_notBefore(x), startdate)) + if (!ASN1_TIME_set_string_X509(X509_getm_notBefore(x), startdate)) return 0; } if (enddate == NULL) { if (X509_time_adj_ex(X509_getm_notAfter(x), days, 0, NULL) == NULL) return 0; - } else if (!ASN1_TIME_set_string(X509_getm_notAfter(x), enddate)) { + } else if (!ASN1_TIME_set_string_X509(X509_getm_notAfter(x), enddate)) { return 0; } return 1; |