summaryrefslogtreecommitdiffstats
path: root/apps/lib/apps.c
diff options
context:
space:
mode:
authorWilliam Edmisten <wcedmisten@gmail.com>2021-03-01 18:33:29 -0500
committerTomas Mraz <tomas@openssl.org>2021-06-11 12:39:46 +0200
commit8c5bff2220c4f39b48660afda40005871f53250d (patch)
treebc1d608ac356c10b1e460a296f4200dd310505e3 /apps/lib/apps.c
parent3eb4b5bfe66ba0911fffa05ff1e3a00f4c54d641 (diff)
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 'apps/lib/apps.c')
-rw-r--r--apps/lib/apps.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/apps/lib/apps.c b/apps/lib/apps.c
index 9aae725fc6..79fe4f8409 100644
--- a/apps/lib/apps.c
+++ b/apps/lib/apps.c
@@ -1214,6 +1214,15 @@ int set_name_ex(unsigned long *flags, const char *arg)
return 1;
}
+int set_dateopt(unsigned long *dateopt, const char *arg)
+{
+ if (strcasecmp(arg, "rfc_822") == 0)
+ *dateopt = ASN1_DTFLGS_RFC822;
+ else if (strcasecmp(arg, "iso_8601") == 0)
+ *dateopt = ASN1_DTFLGS_ISO8601;
+ return 0;
+}
+
int set_ext_copy(int *copy_type, const char *arg)
{
if (strcasecmp(arg, "none") == 0)