diff options
author | Theo Buehler <tb@cvs.openbsd.org> | 2023-06-07 11:09:09 +0000 |
---|---|---|
committer | Theo Buehler <tb@cvs.openbsd.org> | 2023-06-07 11:09:09 +0000 |
commit | b4b0c9f22957699447e026835395f1cf8e9634d9 (patch) | |
tree | 4a4070749407c795f75996e27d92152430a0e872 /usr.sbin/rpki-client/validate.c | |
parent | ca91cdcc58cf1944bee5aea56c23b97081a45cb6 (diff) |
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
Diffstat (limited to 'usr.sbin/rpki-client/validate.c')
-rw-r--r-- | usr.sbin/rpki-client/validate.c | 10 |
1 files changed, 7 insertions, 3 deletions
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 <kristaps@bsd.lv> * @@ -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); |