-/* $OpenBSD: extern.h,v 1.169 2023/03/09 09:46:21 job Exp $ */
+/* $OpenBSD: extern.h,v 1.170 2023/03/09 12:54:28 job Exp $ */
/*
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
*
char *sia; /* SIA signedObject */
char *ski; /* SKI */
time_t signtime; /* CMS signing-time attribute */
+ time_t expires; /* Not After of the GBR EE */
};
struct aspa_provider {
-/* $OpenBSD: gbr.c,v 1.21 2023/03/09 09:46:21 job Exp $ */
+/* $OpenBSD: gbr.c,v 1.22 2023/03/09 12:54:28 job Exp $ */
/*
* Copyright (c) 2020 Claudio Jeker <claudio@openbsd.org>
*
size_t cmsz;
unsigned char *cms;
time_t signtime;
+ const ASN1_TIME *at;
memset(&p, 0, sizeof(struct parse));
p.fn = fn;
goto out;
}
+ at = X509_get0_notAfter(*x509);
+ if (at == NULL) {
+ warnx("%s: X509_get0_notAfter failed", fn);
+ goto out;
+ }
+ if (!x509_get_time(at, &p.res->expires)) {
+ warnx("%s: ASN1_time_parse failed", fn);
+ goto out;
+ }
+
if (!x509_inherits(*x509)) {
warnx("%s: RFC 3779 extension not set to inherit", fn);
goto out;
-/* $OpenBSD: print.c,v 1.28 2023/03/09 09:46:21 job Exp $ */
+/* $OpenBSD: print.c,v 1.29 2023/03/09 12:54:28 job Exp $ */
/*
* Copyright (c) 2021 Claudio Jeker <claudio@openbsd.org>
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
if (p->signtime != 0)
printf("\t\"signing_time\": %lld,\n",
(long long)p->signtime);
+ printf("\t\"valid_until\": %lld,\n", (long long)p->expires);
printf("\t\"vcard\": \"");
for (i = 0; i < strlen(p->vcard); i++) {
if (p->vcard[i] == '"')
if (p->signtime != 0)
printf("Signing time: %s\n",
time2str(p->signtime));
+ printf("GBR valid until: %s\n", time2str(p->expires));
printf("vcard:\n%s", p->vcard);
}
}