-/* $OpenBSD: extern.h,v 1.195 2023/11/24 14:05:47 job Exp $ */
+/* $OpenBSD: extern.h,v 1.196 2023/12/11 19:05:20 job Exp $ */
/*
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
*
char *sia; /* SIA signedObject */
char *ski; /* SKI */
char *crl; /* CRL file name */
+ unsigned char mfthash[SHA256_DIGEST_LENGTH];
unsigned char crlhash[SHA256_DIGEST_LENGTH];
time_t signtime; /* CMS signing-time attribute */
time_t thisupdate; /* from the eContent */
-/* $OpenBSD: parser.c,v 1.102 2023/12/11 15:50:23 job Exp $ */
+/* $OpenBSD: parser.c,v 1.103 2023/12/11 19:05:20 job Exp $ */
/*
* Copyright (c) 2019 Claudio Jeker <claudio@openbsd.org>
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
free(der);
return NULL;
}
+
+ if (!EVP_Digest(der, len, mft->mfthash, NULL, EVP_sha256(), NULL))
+ errx(1, "EVP_Digest failed");
+
free(der);
*crl = parse_load_crl_from_mft(entp, mft, DIR_TEMP, crlfile);
warnx("%s: manifest replay detected (expected >= #%s, got #%s)",
file1, mft2->seqnum, mft1->seqnum);
+ if (r == 0 && memcmp(mft1->mfthash, mft2->mfthash,
+ SHA256_DIGEST_LENGTH) != 0)
+ warnx("%s: manifest misissuance, #%s was recycled",
+ file1, mft1->seqnum);
+
if (r == 1) {
*mp = proc_parser_mft_post(file1, mft1, entp->path, err1,
&warned);