summaryrefslogtreecommitdiff
path: root/src/pkcs11.c
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2019-05-08 21:52:54 +0200
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2019-05-09 21:34:10 +0200
commite71be4a1f94e917eaa6480bbd1ae00a8b81a7517 (patch)
tree734ca3680ec784a38a8dda611abc81ff377c7548 /src/pkcs11.c
parent3c74d27ddcde16062992bac93ddcf0e270adb144 (diff)
downloadgnutls-e71be4a1f94e917eaa6480bbd1ae00a8b81a7517.tar.gz
tools: suppress ctime() error from static analysers
This function is not thread safe and can be easily misused even in single threaded scenarios (one such minor bug fixed). Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
Diffstat (limited to 'src/pkcs11.c')
-rw-r--r--src/pkcs11.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/pkcs11.c b/src/pkcs11.c
index bb4acd66ce..d938231c35 100644
--- a/src/pkcs11.c
+++ b/src/pkcs11.c
@@ -281,6 +281,7 @@ pkcs11_list(FILE * outfile, const char *url, int type, unsigned int flags,
unsigned int oflags;
const char *vendor;
char *objurl;
+ char timebuf[SIMPLE_CTIME_BUF_SIZE];
ret =
gnutls_pkcs11_obj_export_url(crt_list[i], detailed,
@@ -326,7 +327,7 @@ pkcs11_list(FILE * outfile, const char *url, int type, unsigned int flags,
}
if (otype == GNUTLS_PKCS11_OBJ_X509_CRT && exp != -1) {
- fprintf(outfile, "\tExpires: %s", ctime(&exp));
+ fprintf(outfile, "\tExpires: %s\n", simple_ctime(&exp, timebuf));
}
gnutls_free(output);