diff options
author | Rich Salz <rsalz@openssl.org> | 2017-06-11 16:36:07 -0400 |
---|---|---|
committer | Rich Salz <rsalz@openssl.org> | 2017-06-11 16:36:07 -0400 |
commit | 04e62715db684d83bffac53793ff4cfac51e047a (patch) | |
tree | b286fb5cda68811e59d3bc5779cec8b9ff2e14ed /apps/ca.c | |
parent | 7aefa75490991d71e190be38457223704fefff34 (diff) |
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/ca.c')
-rw-r--r-- | apps/ca.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -805,7 +805,7 @@ end_of_options: if (startdate == NULL) ERR_clear_error(); } - if (startdate && !ASN1_TIME_set_string(NULL, startdate)) { + if (startdate && !ASN1_TIME_set_string_X509(NULL, startdate)) { BIO_printf(bio_err, "start date is invalid, it should be YYMMDDHHMMSSZ or YYYYMMDDHHMMSSZ\n"); goto end; @@ -818,7 +818,7 @@ end_of_options: if (enddate == NULL) ERR_clear_error(); } - if (enddate && !ASN1_TIME_set_string(NULL, enddate)) { + if (enddate && !ASN1_TIME_set_string_X509(NULL, enddate)) { BIO_printf(bio_err, "end date is invalid, it should be YYMMDDHHMMSSZ or YYYYMMDDHHMMSSZ\n"); goto end; |