-/* $OpenBSD: cms.c,v 1.32 2023/03/12 11:45:52 tb Exp $ */
+/* $OpenBSD: cms.c,v 1.33 2023/03/13 19:46:55 job Exp $ */
/*
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
*
int i, nattrs, nid;
int has_ct = 0, has_md = 0, has_st = 0,
has_bst = 0;
+ time_t notafter;
int rc = 0;
*xp = NULL;
goto out;
}
+ if (!x509_get_notafter(*xp, fn, ¬after))
+ goto out;
+ if (*signtime > notafter) {
+ warnx("%s: dating issue: CMS signing-time after X.509 notAfter",
+ fn);
+ goto out;
+ }
+
if (CMS_SignerInfo_get0_signer_id(si, &kid, NULL, NULL) != 1 ||
kid == NULL) {
warnx("%s: RFC 6488: could not extract SKI from SID", fn);