summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo Buehler <tb@cvs.openbsd.org>2023-05-22 14:56:01 +0000
committerTheo Buehler <tb@cvs.openbsd.org>2023-05-22 14:56:01 +0000
commite72887be1955493a8f813edb82f8e113d07620e4 (patch)
tree4a0583b332d9df61103ce23af548e97f1ae6d428
parenta608274406fc6ff767d43a857b54bfdf2d739fde (diff)
Avoid use of LibreSSL-specific ASN1_time_tm_cmp() API
We convert these struct tm into time_t in the next few lines, so we can simply use > instead. ok claudio job
-rw-r--r--usr.sbin/rpki-client/mft.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/usr.sbin/rpki-client/mft.c b/usr.sbin/rpki-client/mft.c
index f702caf3b7a..0c1dea58d16 100644
--- a/usr.sbin/rpki-client/mft.c
+++ b/usr.sbin/rpki-client/mft.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mft.c,v 1.91 2023/04/26 16:32:41 claudio Exp $ */
+/* $OpenBSD: mft.c,v 1.92 2023/05/22 14:56:00 tb Exp $ */
/*
* Copyright (c) 2022 Theo Buehler <tb@openbsd.org>
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
@@ -124,16 +124,15 @@ mft_parse_time(const ASN1_GENERALIZEDTIME *from,
return 0;
}
- /* check that until is not before from */
- if (ASN1_time_tm_cmp(&tm_until, &tm_from) < 0) {
- warnx("%s: bad update interval", p->fn);
- return 0;
- }
-
if ((p->res->thisupdate = timegm(&tm_from)) == -1 ||
(p->res->nextupdate = timegm(&tm_until)) == -1)
errx(1, "%s: timegm failed", p->fn);
+ if (p->res->thisupdate > p->res->nextupdate) {
+ warnx("%s: bad update interval", p->fn);
+ return 0;
+ }
+
return 1;
}