From: tb Date: Wed, 7 Jun 2023 11:09:08 +0000 (+0000) Subject: Cosmetic tweak for previous X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=76b147501602ba0185d1d6c173b97b4335c54b37;p=openbsd Cosmetic tweak for previous Once we expect ASPA version 1 and someone sends us version 0, make that explicit instead of complaining about ASN1_INTEGER_get_uint64() failing. ok job --- diff --git a/usr.sbin/rpki-client/validate.c b/usr.sbin/rpki-client/validate.c index 3ed0f0372d8..7865a93d012 100644 --- a/usr.sbin/rpki-client/validate.c +++ b/usr.sbin/rpki-client/validate.c @@ -1,4 +1,4 @@ -/* $OpenBSD: validate.c,v 1.64 2023/06/07 10:46:34 job Exp $ */ +/* $OpenBSD: validate.c,v 1.65 2023/06/07 11:09:08 tb Exp $ */ /* * Copyright (c) 2019 Kristaps Dzonsons * @@ -519,8 +519,12 @@ valid_econtent_version(const char *fn, const ASN1_INTEGER *aint, { uint64_t version; - if (expected == 0 && aint == NULL) - return 1; + if (aint == NULL) { + if (expected == 0) + return 1; + warnx("%s: unexpected version 0", fn); + return 0; + } if (!ASN1_INTEGER_get_uint64(&version, aint)) { warnx("%s: ASN1_INTEGER_get_uint64 failed", fn);