summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortb <>2023-04-28 15:16:48 +0000
committertb <>2023-04-28 15:16:48 +0000
commit7d7b55682de108a2561a680b7c0883797b13553d (patch)
tree9737c99a446bbed70d74396e9f557a2c0255d550 /src
parenta2b081201e022ffc9dfcfaff6d936181b0a25681 (diff)
downloadopenbsd-7d7b55682de108a2561a680b7c0883797b13553d.tar.gz
openbsd-7d7b55682de108a2561a680b7c0883797b13553d.tar.bz2
openbsd-7d7b55682de108a2561a680b7c0883797b13553d.zip
Deassert x509_policy_new()
Turn the check into an error which will make all callers error. with beck ok jsing
Diffstat (limited to 'src')
-rw-r--r--src/lib/libcrypto/x509/x509_policy.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/lib/libcrypto/x509/x509_policy.c b/src/lib/libcrypto/x509/x509_policy.c
index 32ee4e9f4f..c8f9447e4f 100644
--- a/src/lib/libcrypto/x509/x509_policy.c
+++ b/src/lib/libcrypto/x509/x509_policy.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509_policy.c,v 1.16 2023/04/28 09:56:09 tb Exp $ */ 1/* $OpenBSD: x509_policy.c,v 1.17 2023/04/28 15:16:48 tb Exp $ */
2/* 2/*
3 * Copyright (c) 2022, Google Inc. 3 * Copyright (c) 2022, Google Inc.
4 * 4 *
@@ -203,9 +203,10 @@ x509_policy_node_free(X509_POLICY_NODE *node)
203static X509_POLICY_NODE * 203static X509_POLICY_NODE *
204x509_policy_node_new(const ASN1_OBJECT *policy) 204x509_policy_node_new(const ASN1_OBJECT *policy)
205{ 205{
206 assert(!is_any_policy(policy)); 206 X509_POLICY_NODE *node = NULL;
207 X509_POLICY_NODE *node;
208 207
208 if (is_any_policy(policy))
209 goto err;
209 if ((node = calloc(1, sizeof(*node))) == NULL) 210 if ((node = calloc(1, sizeof(*node))) == NULL)
210 goto err; 211 goto err;
211 if ((node->policy = OBJ_dup(policy)) == NULL) 212 if ((node->policy = OBJ_dup(policy)) == NULL)