summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/x509/x509_internal.h
diff options
context:
space:
mode:
authortb <>2022-03-14 21:15:49 +0000
committertb <>2022-03-14 21:15:49 +0000
commitcdd92616160505c509e5c7f6736fcbaadcdd9afc (patch)
treecf453def12c05205d1d4cc78cc18a174a34edfe0 /src/lib/libcrypto/x509/x509_internal.h
parentfb6d4ea1385d6b1032c9c040a2b756900f3afbb8 (diff)
downloadopenbsd-cdd92616160505c509e5c7f6736fcbaadcdd9afc.tar.gz
openbsd-cdd92616160505c509e5c7f6736fcbaadcdd9afc.tar.bz2
openbsd-cdd92616160505c509e5c7f6736fcbaadcdd9afc.zip
Rework ownership handling in x509_constraints_validate()
Instead of having the caller allocate and pass in a new x509_constraints_name struct, handle allocation inside x509_constraints_validate(). Also make the error optional. All this is done to simplify the call sites and to make it more obvious that there are no leaks. ok jsing
Diffstat (limited to 'src/lib/libcrypto/x509/x509_internal.h')
-rw-r--r--src/lib/libcrypto/x509/x509_internal.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lib/libcrypto/x509/x509_internal.h b/src/lib/libcrypto/x509/x509_internal.h
index c64992a9ee..c6ce5229ad 100644
--- a/src/lib/libcrypto/x509/x509_internal.h
+++ b/src/lib/libcrypto/x509/x509_internal.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509_internal.h,v 1.17 2022/03/13 17:08:04 tb Exp $ */ 1/* $OpenBSD: x509_internal.h,v 1.18 2022/03/14 21:15:49 tb Exp $ */
2/* 2/*
3 * Copyright (c) 2020 Bob Beck <beck@openbsd.org> 3 * Copyright (c) 2020 Bob Beck <beck@openbsd.org>
4 * 4 *
@@ -101,6 +101,7 @@ time_t x509_verify_asn1_time_to_time_t(const ASN1_TIME *atime, int notafter);
101struct x509_verify_ctx *x509_verify_ctx_new_from_xsc(X509_STORE_CTX *xsc); 101struct x509_verify_ctx *x509_verify_ctx_new_from_xsc(X509_STORE_CTX *xsc);
102 102
103void x509_constraints_name_clear(struct x509_constraints_name *name); 103void x509_constraints_name_clear(struct x509_constraints_name *name);
104void x509_constraints_name_free(struct x509_constraints_name *name);
104int x509_constraints_names_add(struct x509_constraints_names *names, 105int x509_constraints_names_add(struct x509_constraints_names *names,
105 struct x509_constraints_name *name); 106 struct x509_constraints_name *name);
106struct x509_constraints_names *x509_constraints_names_dup( 107struct x509_constraints_names *x509_constraints_names_dup(
@@ -127,7 +128,7 @@ int x509_constraints_extract_constraints(X509 *cert,
127 struct x509_constraints_names *permitted, 128 struct x509_constraints_names *permitted,
128 struct x509_constraints_names *excluded, int *error); 129 struct x509_constraints_names *excluded, int *error);
129int x509_constraints_validate(GENERAL_NAME *constraint, 130int x509_constraints_validate(GENERAL_NAME *constraint,
130 struct x509_constraints_name *name, int *error); 131 struct x509_constraints_name **out_name, int *error);
131int x509_constraints_check(struct x509_constraints_names *names, 132int x509_constraints_check(struct x509_constraints_names *names,
132 struct x509_constraints_names *permitted, 133 struct x509_constraints_names *permitted,
133 struct x509_constraints_names *excluded, int *error); 134 struct x509_constraints_names *excluded, int *error);