summaryrefslogtreecommitdiff
path: root/usr.sbin/rpki-client
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2020-10-24 08:12:01 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2020-10-24 08:12:01 +0000
commitee45e065fdaa0970fe887f9de9693a38add5b03e (patch)
treec74d52dadac7a618a8143402eda4bf4279c82d59 /usr.sbin/rpki-client
parentb0440494eb2be94ea45c38ec1a187b770f36882b (diff)
queue_add_from_cert() and queue_add_from_tal() are both called with properly
validated certs / tals and there is no need to double check if the URIs point to the right resource again. rtype_resolve() is now unused and can be removed. OK tb@
Diffstat (limited to 'usr.sbin/rpki-client')
-rw-r--r--usr.sbin/rpki-client/main.c27
1 files changed, 3 insertions, 24 deletions
diff --git a/usr.sbin/rpki-client/main.c b/usr.sbin/rpki-client/main.c
index c57508ebd08..51c24422ede 100644
--- a/usr.sbin/rpki-client/main.c
+++ b/usr.sbin/rpki-client/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.83 2020/10/11 12:35:24 claudio Exp $ */
+/* $OpenBSD: main.c,v 1.84 2020/10/24 08:12:00 claudio Exp $ */
/*
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
*
@@ -202,19 +202,6 @@ filepath_exists(char *file)
RB_GENERATE(filepath_tree, filepath, entry, filepathcmp);
-/*
- * Resolve the media type of a resource by looking at its suffice.
- * Returns the type of RTYPE_EOF if not found.
- */
-static enum rtype
-rtype_resolve(const char *uri)
-{
- enum rtype rp;
-
- rsync_uri_parse(NULL, NULL, NULL, NULL, NULL, NULL, &rp, uri);
- return rp;
-}
-
static void
entity_free(struct entity *ent)
{
@@ -580,8 +567,6 @@ queue_add_from_tal(int proc, int rsync, struct entityq *q,
errx(1, "TAL file has no rsync:// URI");
/* Look up the repository. */
- assert(rtype_resolve(uri) == RTYPE_CER);
-
repo = repo_lookup(rsync, uri);
nfile = repo_filename(repo, uri);
@@ -590,29 +575,23 @@ queue_add_from_tal(int proc, int rsync, struct entityq *q,
}
/*
- * Add a manifest (MFT) or CRL found in an X509 certificate, RFC 6487.
+ * Add a manifest (MFT) found in an X509 certificate, RFC 6487.
*/
static void
queue_add_from_cert(int proc, int rsync, struct entityq *q,
const char *rsyncuri, const char *rrdpuri, size_t *eid)
{
char *nfile;
- enum rtype type;
const struct repo *repo;
if (rsyncuri == NULL)
return;
- if ((type = rtype_resolve(rsyncuri)) == RTYPE_EOF)
- errx(1, "%s: unknown file type", rsyncuri);
- if (type != RTYPE_MFT)
- errx(1, "%s: invalid file type", rsyncuri);
/* Look up the repository. */
-
repo = repo_lookup(rsync, rsyncuri);
nfile = repo_filename(repo, rsyncuri);
- entityq_add(proc, q, nfile, type, repo, NULL, NULL, 0, NULL, eid);
+ entityq_add(proc, q, nfile, RTYPE_MFT, repo, NULL, NULL, 0, NULL, eid);
}
/*