From 6de5d2cdb4806af4f35c08854b9609ca82035014 Mon Sep 17 00:00:00 2001 From: tb Date: Wed, 11 May 2022 09:07:04 +0000 Subject: [PATCH] Move sbgp_addr() down to the other sbgp_addr_* functions. ok claudio job --- usr.sbin/rpki-client/cert.c | 46 ++++++++++++++++++------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/usr.sbin/rpki-client/cert.c b/usr.sbin/rpki-client/cert.c index 26700bfb1a6..c2be7c00c45 100644 --- a/usr.sbin/rpki-client/cert.c +++ b/usr.sbin/rpki-client/cert.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cert.c,v 1.75 2022/05/11 08:59:00 tb Exp $ */ +/* $OpenBSD: cert.c,v 1.76 2022/05/11 09:07:04 tb Exp $ */ /* * Copyright (c) 2021 Job Snijders * Copyright (c) 2019 Kristaps Dzonsons @@ -94,28 +94,6 @@ append_as(struct parse *p, const struct cert_as *as) return 1; } -/* - * Construct a RFC 3779 2.2.3.8 range from its bit string. - * Returns zero on failure, non-zero on success. - */ -static int -sbgp_addr(struct parse *p, struct cert_ip *ip, const ASN1_BIT_STRING *bs) -{ - if (!ip_addr_parse(bs, ip->afi, p->fn, &ip->ip)) { - warnx("%s: RFC 3779 section 2.2.3.8: IPAddress: " - "invalid IP address", p->fn); - return 0; - } - - if (!ip_cert_compose_ranges(ip)) { - warnx("%s: RFC 3779 section 2.2.3.8: IPAddress: " - "IP address range reversed", p->fn); - return 0; - } - - return append_ip(p, ip); -} - /* * Parse a range of addresses as in 3.2.3.8. * Returns zero on failure, non-zero on success. @@ -269,6 +247,28 @@ sbgp_assysnum(struct parse *p, X509_EXTENSION *ext) return rc; } +/* + * Construct a RFC 3779 2.2.3.8 range from its bit string. + * Returns zero on failure, non-zero on success. + */ +static int +sbgp_addr(struct parse *p, struct cert_ip *ip, const ASN1_BIT_STRING *bs) +{ + if (!ip_addr_parse(bs, ip->afi, p->fn, &ip->ip)) { + warnx("%s: RFC 3779 section 2.2.3.8: IPAddress: " + "invalid IP address", p->fn); + return 0; + } + + if (!ip_cert_compose_ranges(ip)) { + warnx("%s: RFC 3779 section 2.2.3.8: IPAddress: " + "IP address range reversed", p->fn); + return 0; + } + + return append_ip(p, ip); +} + /* * Parse RFC 3779 2.2.3.9 range of addresses. * Returns zero on failure, non-zero on success. -- 2.20.1