summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJob Snijders <job@cvs.openbsd.org>2023-03-09 15:48:52 +0000
committerJob Snijders <job@cvs.openbsd.org>2023-03-09 15:48:52 +0000
commit247b27868d074e1f20776fbdbdaa649afb79c867 (patch)
tree3848365cdb1d8e9965c628ae1c7017ec71ae3479
parent75e0516e4c146dad5d91c4286978ce0a1d4aed8d (diff)
Fix segfault in filemode for TAK objects
-rw-r--r--usr.sbin/rpki-client/tak.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.sbin/rpki-client/tak.c b/usr.sbin/rpki-client/tak.c
index 24313d958fd..768a6cec54a 100644
--- a/usr.sbin/rpki-client/tak.c
+++ b/usr.sbin/rpki-client/tak.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tak.c,v 1.3 2023/03/09 09:46:21 job Exp $ */
+/* $OpenBSD: tak.c,v 1.4 2023/03/09 15:48:51 job Exp $ */
/*
* Copyright (c) 2022 Job Snijders <job@fastly.com>
* Copyright (c) 2022 Theo Buehler <tb@openbsd.org>
@@ -231,18 +231,20 @@ tak_parse(X509 **x509, const char *fn, const unsigned char *der, size_t len)
unsigned char *cms;
size_t cmsz;
const ASN1_TIME *at;
+ time_t signtime;
int rc = 0;
memset(&p, 0, sizeof(struct parse));
p.fn = fn;
cms = cms_parse_validate(x509, fn, der, len, tak_oid, &cmsz,
- &p.res->signtime);
+ &signtime);
if (cms == NULL)
return NULL;
if ((p.res = calloc(1, sizeof(struct tak))) == NULL)
err(1, NULL);
+ p.res->signtime = signtime;
if (!x509_get_aia(*x509, fn, &p.res->aia))
goto out;