summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorTheo Buehler <tb@cvs.openbsd.org>2024-06-17 18:52:51 +0000
committerTheo Buehler <tb@cvs.openbsd.org>2024-06-17 18:52:51 +0000
commit0f87b58f2244533c9c5347830cfff94bebb6dc66 (patch)
tree5a9ebc040b0e809167566e9587d1a65d5d5f86b4 /usr.sbin
parent410fb30ec74e6d08024d04ddcc63c57e74cec43c (diff)
Put back NULL checks in crl_get() and build_chain()
Turns out filemode still relies on these. Rather than adding to the spaghetti in filemode.c, begrudgingly put back the NULL checks with an additional XXX. ok claudio job
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/rpki-client/crl.c6
-rw-r--r--usr.sbin/rpki-client/validate.c6
2 files changed, 10 insertions, 2 deletions
diff --git a/usr.sbin/rpki-client/crl.c b/usr.sbin/rpki-client/crl.c
index 0cf97caff99..fddd27aee5a 100644
--- a/usr.sbin/rpki-client/crl.c
+++ b/usr.sbin/rpki-client/crl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: crl.c,v 1.41 2024/06/12 10:03:09 tb Exp $ */
+/* $OpenBSD: crl.c,v 1.42 2024/06/17 18:52:50 tb Exp $ */
/*
* Copyright (c) 2024 Theo Buehler <tb@openbsd.org>
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
@@ -296,6 +296,10 @@ crl_get(struct crl_tree *crlt, const struct auth *a)
{
struct crl find;
+ /* XXX - this should be removed, but filemode relies on it. */
+ if (a == NULL)
+ return NULL;
+
find.aki = a->cert->ski;
find.mftpath = a->cert->mft;
diff --git a/usr.sbin/rpki-client/validate.c b/usr.sbin/rpki-client/validate.c
index f4c6e7c260f..bcbf9cbc5fb 100644
--- a/usr.sbin/rpki-client/validate.c
+++ b/usr.sbin/rpki-client/validate.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: validate.c,v 1.75 2024/06/12 10:03:09 tb Exp $ */
+/* $OpenBSD: validate.c,v 1.76 2024/06/17 18:52:50 tb Exp $ */
/*
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
*
@@ -304,6 +304,10 @@ build_chain(const struct auth *a, STACK_OF(X509) **intermediates,
*intermediates = NULL;
*root = NULL;
+ /* XXX - this should be removed, but filemode relies on it. */
+ if (a == NULL)
+ return;
+
if ((*intermediates = sk_X509_new_null()) == NULL)
err(1, "sk_X509_new_null");
if ((*root = sk_X509_new_null()) == NULL)