diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2011-12-10 01:37:22 +0100 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2011-12-10 01:37:22 +0100 |
commit | 16363c0165aa75331594496f3c0e2b0d6cd31519 (patch) | |
tree | 01cbac991d00da6dc5e4931330c19b5b259c1e85 /apps | |
parent | perlasm/x86gas.pl: give a hand old assemblers assembling loop instruction. (diff) | |
download | openssl-16363c0165aa75331594496f3c0e2b0d6cd31519.tar.xz openssl-16363c0165aa75331594496f3c0e2b0d6cd31519.zip |
implement -attime option as a verify parameter then it works with all relevant applications
Diffstat (limited to 'apps')
-rw-r--r-- | apps/apps.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/apps/apps.c b/apps/apps.c index fdfa362f7c..b9df6f9e2d 100644 --- a/apps/apps.c +++ b/apps/apps.c @@ -2257,6 +2257,7 @@ int args_verify(char ***pargs, int *pargc, char **oldargs = *pargs; char *arg = **pargs, *argn = (*pargs)[1]; const X509_VERIFY_PARAM *vpm = NULL; + time_t at_time = 0; if (!strcmp(arg, "-policy")) { if (!argn) @@ -2324,6 +2325,26 @@ int args_verify(char ***pargs, int *pargc, } (*pargs)++; } + else if (strcmp(arg,"-attime") == 0) + { + if (!argn) + *badarg = 1; + else + { + long timestamp; + /* interpret argument as seconds since Epoch */ + if (sscanf(argn, "%li", ×tamp) != 1) + { + BIO_printf(bio_err, + "Error parsing timestamp %s\n", + argn); + *badarg = 1; + } + /* on some platforms time_t may be a float */ + at_time = (time_t) timestamp; + } + (*pargs)++; + } else if (!strcmp(arg, "-ignore_critical")) flags |= X509_V_FLAG_IGNORE_CRITICAL; else if (!strcmp(arg, "-issuer_checks")) @@ -2383,6 +2404,9 @@ int args_verify(char ***pargs, int *pargc, if (depth >= 0) X509_VERIFY_PARAM_set_depth(*pm, depth); + if (at_time) + X509_VERIFY_PARAM_set_time(*pm, at_time); + end: (*pargs)++; |