diff options
author | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2016-10-18 10:02:29 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2016-10-18 12:58:36 +0200 |
commit | 08a8f68e38c1c6491db4997140a0d43711b54830 (patch) | |
tree | 2af943f220132abd9e295030520410768c93a944 /tests/pkcs7-gen.c | |
parent | e93c96952b8bccedc23014fcbc7b9c0a52b2b559 (diff) | |
download | gnutls-08a8f68e38c1c6491db4997140a0d43711b54830.tar.gz |
tests: introduced verification constraints checks for PKCS#7 structures
That is, key purpose checks and more elaborate time checks.
Diffstat (limited to 'tests/pkcs7-gen.c')
-rw-r--r-- | tests/pkcs7-gen.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/pkcs7-gen.c b/tests/pkcs7-gen.c index f7c51a9afc..a96cef7f58 100644 --- a/tests/pkcs7-gen.c +++ b/tests/pkcs7-gen.c @@ -68,6 +68,16 @@ static char pem1_key[] = const gnutls_datum_t cert = {(void *) pem1_cert, sizeof(pem1_cert)-1}; const gnutls_datum_t key = {(void *) pem1_key, sizeof(pem1_key)-1}; +static time_t mytime(time_t * t) +{ + time_t then = 1199142000; + + if (t) + *t = then; + + return then; +} + static void tls_log_func(int level, const char *str) { fprintf(stderr, "%s |<%d>| %s", "err", level, str); @@ -89,6 +99,7 @@ void doit(void) char *oid; gnutls_datum_t data; + gnutls_global_set_time_function(mytime); gnutls_global_set_log_function(tls_log_func); if (debug) gnutls_global_set_log_level(6); |