-/* $OpenBSD: as.c,v 1.7 2021/12/26 12:32:28 tb Exp $ */
+/* $OpenBSD: as.c,v 1.8 2022/05/15 16:43:34 tb Exp $ */
/*
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
*
if (as[i].type == CERT_AS_INHERIT)
return 0;
amin = as[i].type == CERT_AS_RANGE ?
- as[i].range.min : as[i].id;
- amax = as[i].type == CERT_AS_RANGE?
- as[i].range.max : as[i].id;
+ as[i].range.min : as[i].id;
+ amax = as[i].type == CERT_AS_RANGE ?
+ as[i].range.max : as[i].id;
if (min >= amin && max <= amax)
return 1;
}
-/* $OpenBSD: cms.c,v 1.18 2022/05/15 15:00:53 deraadt Exp $ */
+/* $OpenBSD: cms.c,v 1.19 2022/05/15 16:43:34 tb Exp $ */
/*
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
*
*/
int
ASN1_frame(const char *fn, size_t sz,
- const unsigned char **cnt, long *cntsz, int *tag)
+ const unsigned char **cnt, long *cntsz, int *tag)
{
int ret, pcls;
*/
int
cms_econtent_version(const char *fn, const unsigned char **d, size_t dsz,
- long *version)
+ long *version)
{
ASN1_INTEGER *aint = NULL;
long plen;
-/* $OpenBSD: http.c,v 1.59 2022/05/15 15:00:53 deraadt Exp $ */
+/* $OpenBSD: http.c,v 1.60 2022/05/15 16:43:34 tb Exp $ */
/*
* Copyright (c) 2020 Nils Fisher <nils_fisher@hotmail.com>
* Copyright (c) 2020 Claudio Jeker <claudio@openbsd.org>
static struct http_conn_list active = LIST_HEAD_INITIALIZER(active);
static struct http_conn_list idle = LIST_HEAD_INITIALIZER(idle);
static struct http_req_queue queue = TAILQ_HEAD_INITIALIZER(queue);
-static unsigned int http_conn_count;
+static unsigned int http_conn_count;
static struct msgbuf msgq;
static struct sockaddr_storage http_bindaddr;
static enum res http_connect(struct http_connection *);
static enum res http_request(struct http_connection *);
static enum res http_close(struct http_connection *);
-static enum res http_handle(struct http_connection *);
+static enum res http_handle(struct http_connection *);
/* Internal state functions used by the above functions */
static enum res http_finish_connect(struct http_connection *);
size_t s;
cp += sizeof(CONTENTLEN) - 1;
if ((s = strcspn(cp, " \t")) != 0)
- *(cp+s) = 0;
+ *(cp + s) = 0;
conn->iosz = strtonum(cp, 0, MAX_CONTENTLEN, &errstr);
if (errstr != NULL) {
warnx("Content-Length of %s is %s",
assert(conn->state == STATE_PROXY_REQUEST);
s = write(conn->fd, conn->buf + conn->bufpos,
- conn->bufsz - conn->bufpos);
+ conn->bufsz - conn->bufpos);
if (s == -1) {
warn("%s: write", http_info(conn->host));
return http_failed(conn);
static enum res
http_handle(struct http_connection *conn)
{
- assert (conn->pfd != NULL && conn->pfd->revents != 0);
+ assert(conn->pfd != NULL && conn->pfd->revents != 0);
conn->io_time = 0;
-/* $OpenBSD: io.c,v 1.19 2022/04/20 15:31:48 tb Exp $ */
+/* $OpenBSD: io.c,v 1.20 2022/05/15 16:43:34 tb Exp $ */
/*
* Copyright (c) 2021 Claudio Jeker <claudio@openbsd.org>
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
return NULL;
}
-
/*
* Read data from socket but receive a file descriptor at the same time.
*/
-/* $OpenBSD: ip.c,v 1.24 2022/05/15 15:00:53 deraadt Exp $ */
+/* $OpenBSD: ip.c,v 1.25 2022/05/15 16:43:34 tb Exp $ */
/*
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
*
memcmp(ips[i].min, ip->max, sz) >= 0)
continue;
socktype = (ips[i].afi == AFI_IPV4) ? AF_INET : AF_INET6,
- warnx("%s: RFC 3779 section 2.2.3.5: "
+ warnx("%s: RFC 3779 section 2.2.3.5: "
"cannot have overlapping IP addresses", fn);
ip_addr_print(&ip->ip, ip->afi, buf, sizeof(buf));
warnx("%s: certificate IP: %s", fn, buf);
-/* $OpenBSD: main.c,v 1.203 2022/05/10 07:28:43 job Exp $ */
+/* $OpenBSD: main.c,v 1.204 2022/05/15 16:43:34 tb Exp $ */
/*
* Copyright (c) 2021 Claudio Jeker <claudio@openbsd.org>
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
const char *cachedir = NULL, *outputdir = NULL;
const char *errs, *name;
struct vrp_tree vrps = RB_INITIALIZER(&vrps);
- struct brk_tree brks = RB_INITIALIZER(&brks);
+ struct brk_tree brks = RB_INITIALIZER(&brks);
struct rusage ru;
struct timeval start_time, now_time;
-/* $OpenBSD: output-bird.c,v 1.13 2022/04/20 15:31:48 tb Exp $ */
+/* $OpenBSD: output-bird.c,v 1.14 2022/05/15 16:43:34 tb Exp $ */
/*
* Copyright (c) 2019 Claudio Jeker <claudio@openbsd.org>
* Copyright (c) 2020 Robert Scheck <robert@fedoraproject.org>
if (fprintf(out, "\ndefine force_roa_table_update = %lld;\n\n"
"roa4 table %s4;\nroa6 table %s6;\n\n"
"protocol static {\n\troa4 { table %s4; };\n\n",
- (long long) now, bird_tablename, bird_tablename,
+ (long long)now, bird_tablename, bird_tablename,
bird_tablename) < 0)
return -1;
-/* $OpenBSD: output-json.c,v 1.25 2022/04/20 15:29:24 tb Exp $ */
+/* $OpenBSD: output-json.c,v 1.26 2022/05/15 16:43:34 tb Exp $ */
/*
* Copyright (c) 2019 Claudio Jeker <claudio@openbsd.org>
*
static int
outputheader_json(FILE *out, struct stats *st)
{
- char hn[NI_MAXHOST], tbuf[26];
+ char hn[NI_MAXHOST], tbuf[26];
struct tm *tp;
- time_t t;
- int i;
+ time_t t;
+ int i;
time(&t);
tp = gmtime(&t);
-/* $OpenBSD: print.c,v 1.12 2022/05/15 15:00:53 deraadt Exp $ */
+/* $OpenBSD: print.c,v 1.13 2022/05/15 16:43:34 tb Exp $ */
/*
* Copyright (c) 2021 Claudio Jeker <claudio@openbsd.org>
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
int rder_len;
size_t i;
-
der = p->pkey;
pk = d2i_PUBKEY(NULL, &der, p->pkeysz);
if (pk == NULL)
break;
case CERT_IP_RANGE:
sockt = (p->ips[j].afi == AFI_IPV4) ?
- AF_INET : AF_INET6;
+ AF_INET : AF_INET6;
inet_ntop(sockt, p->ips[j].min, buf1, sizeof(buf1));
inet_ntop(sockt, p->ips[j].max, buf2, sizeof(buf2));
if (outformats & FORMAT_JSON)
if (outformats & FORMAT_JSON)
printf("\t],\n");
-
-
}
void
printf("\t\"vrps\": [\n");
ip_addr_print(&p->ips[i].addr,
- p->ips[i].afi, buf, sizeof(buf));
+ p->ips[i].afi, buf, sizeof(buf));
if (outformats & FORMAT_JSON) {
printf("\t\t{ \"prefix\": \"%s\",", buf);
break;
case CERT_IP_RANGE:
sockt = (p->ips[j].afi == AFI_IPV4) ?
- AF_INET : AF_INET6;
+ AF_INET : AF_INET6;
inet_ntop(sockt, p->ips[j].min, buf1, sizeof(buf1));
inet_ntop(sockt, p->ips[j].max, buf2, sizeof(buf2));
if (outformats & FORMAT_JSON)
-/* $OpenBSD: repo.c,v 1.33 2022/04/20 15:31:48 tb Exp $ */
+/* $OpenBSD: repo.c,v 1.34 2022/05/15 16:43:34 tb Exp $ */
/*
* Copyright (c) 2021 Claudio Jeker <claudio@openbsd.org>
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
assert(file);
if (asprintf(&nfile, "%s%s%s", tr->basedir, file,
- temp ? ".XXXXXXXX": "") == -1)
+ temp ? ".XXXXXXXX" : "") == -1)
err(1, NULL);
return nfile;
char *nfile;
if (asprintf(&nfile, "%s/.state%s", rr->basedir,
- temp ? ".XXXXXXXX": "") == -1)
+ temp ? ".XXXXXXXX" : "") == -1)
err(1, NULL);
return nfile;
warn("mkostemp %s", temp);
goto fail;
}
- (void) fchmod(fd, 0644);
+ (void)fchmod(fd, 0644);
f = fdopen(fd, "w");
if (f == NULL)
err(1, "fdopen");
RB_INIT(&rr->deleted);
-
/* create base directory */
if (mkpath(rr->basedir) == -1) {
warn("mkpath %s", rr->basedir);
}
}
-
-
/*
* Look up a trust anchor, queueing it for download if not found.
*/
-/* $OpenBSD: roa.c,v 1.41 2022/05/10 07:28:43 job Exp $ */
+/* $OpenBSD: roa.c,v 1.42 2022/05/15 16:43:35 tb Exp $ */
/*
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
*
}
free(cms);
return p.res;
-
}
/*
-/* $OpenBSD: rrdp.c,v 1.23 2022/04/04 13:45:02 claudio Exp $ */
+/* $OpenBSD: rrdp.c,v 1.24 2022/05/15 16:43:35 tb Exp $ */
/*
* Copyright (c) 2020 Nils Fisher <nils_fisher@hotmail.com>
* Copyright (c) 2021 Claudio Jeker <claudio@openbsd.org>
struct delta_xml *dxml;
};
-TAILQ_HEAD(,rrdp) states = TAILQ_HEAD_INITIALIZER(states);
+TAILQ_HEAD(, rrdp) states = TAILQ_HEAD_INITIALIZER(states);
char *
xstrdup(const char *s)
-/* $OpenBSD: rrdp_delta.c,v 1.7 2022/02/03 18:19:32 claudio Exp $ */
+/* $OpenBSD: rrdp_delta.c,v 1.8 2022/05/15 16:43:35 tb Exp $ */
/*
* Copyright (c) 2020 Nils Fisher <nils_fisher@hotmail.com>
* Copyright (c) 2021 Claudio Jeker <claudio@openbsd.org>
PARSE_FAIL(p, "parse failed - exited delta "
"elem unexpectedely");
dxml->scope = DELTA_SCOPE_END;
-
}
static void
-/* $OpenBSD: rsc.c,v 1.3 2022/05/15 15:00:53 deraadt Exp $ */
+/* $OpenBSD: rsc.c,v 1.4 2022/05/15 16:43:35 tb Exp $ */
/*
* Copyright (c) 2022 Job Snijders <job@fastly.com>
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
rent = &p->res->files[p->res->filesz++];
rent->filename = fn;
fn = NULL;
- memcpy(rent->hash, hash->value.octet_string->data, SHA256_DIGEST_LENGTH);
+ memcpy(rent->hash, hash->value.octet_string->data,
+ SHA256_DIGEST_LENGTH);
rc = 1;
out:
default:
warnx("%s: want ASN.1 context specific id, have %s"
" (NID %d)", p->fn, ASN1_tag2str(ptag), ptag);
- goto out;
+ goto out;
}
}
if ((seq = d2i_ASN1_SEQUENCE_ANY(NULL, &d, dsz)) == NULL) {
cryptowarnx("%s: RSC: RpkiSignedChecklist: failed ASN.1 "
- "sequence parse", p->fn);
+ "sequence parse", p->fn);
goto out;
}
-/* $OpenBSD: tal.c,v 1.34 2021/11/04 11:32:55 claudio Exp $ */
+/* $OpenBSD: tal.c,v 1.35 2022/05/15 16:43:35 tb Exp $ */
/*
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
*
/* Append to list of URIs. */
tal->uri = reallocarray(tal->uri,
- tal->urisz + 1, sizeof(char *));
+ tal->urisz + 1, sizeof(char *));
if (tal->uri == NULL)
err(1, NULL);
-/* $OpenBSD: validate.c,v 1.37 2022/05/15 16:40:43 tb Exp $ */
+/* $OpenBSD: validate.c,v 1.38 2022/05/15 16:43:35 tb Exp $ */
/*
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
*
int
valid_filehash(int fd, const char *hash, size_t hlen)
{
- SHA256_CTX ctx;
- char filehash[SHA256_DIGEST_LENGTH];
- char buffer[8192];
- ssize_t nr;
+ SHA256_CTX ctx;
+ char filehash[SHA256_DIGEST_LENGTH];
+ char buffer[8192];
+ ssize_t nr;
if (hlen != sizeof(filehash))
errx(1, "bad hash size");
-/* $OpenBSD: x509.c,v 1.44 2022/05/11 21:19:06 job Exp $ */
+/* $OpenBSD: x509.c,v 1.45 2022/05/15 16:43:35 tb Exp $ */
/*
* Copyright (c) 2021 Claudio Jeker <claudio@openbsd.org>
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
if ((rsc_oid = OBJ_txt2obj("1.2.840.113549.1.9.16.1.48", 1)) == NULL)
errx(1, "OBJ_txt2obj for %s failed",
"1.2.840.113549.1.9.16.1.48");
-
}
/*
return 0;
}
return 1;
-
}
/*