From: tb Date: Mon, 22 May 2023 14:56:00 +0000 (+0000) Subject: Avoid use of LibreSSL-specific ASN1_time_tm_cmp() API X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=72287b466b1a87960eaa307238a78816fd7dfd9d;p=openbsd 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 --- 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 * Copyright (c) 2019 Kristaps Dzonsons @@ -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; }