diff options
author | William Edmisten <wcedmisten@gmail.com> | 2021-03-02 00:33:29 +0100 |
---|---|---|
committer | Tomas Mraz <tomas@openssl.org> | 2021-06-11 12:39:46 +0200 |
commit | 8c5bff2220c4f39b48660afda40005871f53250d (patch) | |
tree | bc1d608ac356c10b1e460a296f4200dd310505e3 /include | |
parent | Update krb5 module and re-enable pkinit tests (diff) | |
download | openssl-8c5bff2220c4f39b48660afda40005871f53250d.tar.xz openssl-8c5bff2220c4f39b48660afda40005871f53250d.zip |
Add support for ISO 8601 datetime format
Fixes #5430
Added the configuration file option "date_opt" to the openssl applications ca,
crl and x509.
Added ASN1_TIME_print_ex which supports the new datetime format using the
flag ASN1_DTFLGS_ISO8601
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14384)
Diffstat (limited to 'include')
-rw-r--r-- | include/crypto/asn1.h | 2 | ||||
-rw-r--r-- | include/openssl/asn1.h.in | 8 |
2 files changed, 8 insertions, 2 deletions
diff --git a/include/crypto/asn1.h b/include/crypto/asn1.h index dd0b54aad6..ec76ae6fc6 100644 --- a/include/crypto/asn1.h +++ b/include/crypto/asn1.h @@ -140,7 +140,7 @@ int ossl_x509_algor_new_from_md(X509_ALGOR **palg, const EVP_MD *md); const EVP_MD *ossl_x509_algor_get_md(X509_ALGOR *alg); X509_ALGOR *ossl_x509_algor_mgf1_decode(X509_ALGOR *alg); int ossl_x509_algor_md_to_mgf1(X509_ALGOR **palg, const EVP_MD *mgf1md); -int ossl_asn1_time_print_ex(BIO *bp, const ASN1_TIME *tm); +int ossl_asn1_time_print_ex(BIO *bp, const ASN1_TIME *tm, unsigned long flags); EVP_PKEY * ossl_d2i_PrivateKey_legacy(int keytype, EVP_PKEY **a, const unsigned char **pp, long length, diff --git a/include/openssl/asn1.h.in b/include/openssl/asn1.h.in index 40b43a227a..6d5094a3ff 100644 --- a/include/openssl/asn1.h.in +++ b/include/openssl/asn1.h.in @@ -391,6 +391,11 @@ typedef const ASN1_ITEM *ASN1_ITEM_EXP (void); # define ASN1_STRFLGS_ESC_CTRL 2 # define ASN1_STRFLGS_ESC_MSB 4 +/* Lower 8 bits are reserved as an output type specifier */ +# define ASN1_DTFLGS_TYPE_MASK 0x0FUL +# define ASN1_DTFLGS_RFC822 0x00UL +# define ASN1_DTFLGS_ISO8601 0x01UL + /* * This flag determines how we do escaping: normally RC2253 backslash only, * set this to use backslash and quote. @@ -800,7 +805,8 @@ int ASN1_item_i2d_bio(const ASN1_ITEM *it, BIO *out, const void *x); BIO *ASN1_item_i2d_mem_bio(const ASN1_ITEM *it, const ASN1_VALUE *val); int ASN1_UTCTIME_print(BIO *fp, const ASN1_UTCTIME *a); int ASN1_GENERALIZEDTIME_print(BIO *fp, const ASN1_GENERALIZEDTIME *a); -int ASN1_TIME_print(BIO *fp, const ASN1_TIME *a); +int ASN1_TIME_print(BIO *bp, const ASN1_TIME *tm); +int ASN1_TIME_print_ex(BIO *bp, const ASN1_TIME *tm, unsigned long flags); int ASN1_STRING_print(BIO *bp, const ASN1_STRING *v); int ASN1_STRING_print_ex(BIO *out, const ASN1_STRING *str, unsigned long flags); int ASN1_buf_print(BIO *bp, const unsigned char *buf, size_t buflen, int off); |