summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbeck <>2022-06-27 15:03:11 +0000
committerbeck <>2022-06-27 15:03:11 +0000
commit63d6cdd50ac3d7dec72bc659f9c851f2d7ef2f5e (patch)
tree00cecd6f9f6f38e75e94b7b51c8016fa671b64b9
parent8e6dc8be0d509f0dba848241ad747ada917f218d (diff)
downloadopenbsd-63d6cdd50ac3d7dec72bc659f9c851f2d7ef2f5e.tar.gz
openbsd-63d6cdd50ac3d7dec72bc659f9c851f2d7ef2f5e.tar.bz2
openbsd-63d6cdd50ac3d7dec72bc659f9c851f2d7ef2f5e.zip
Correct misleading comment for URI parsing
ok jsing@
-rw-r--r--src/lib/libcrypto/x509/x509_constraints.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/lib/libcrypto/x509/x509_constraints.c b/src/lib/libcrypto/x509/x509_constraints.c
index c68f282a05..8cd8413dfa 100644
--- a/src/lib/libcrypto/x509/x509_constraints.c
+++ b/src/lib/libcrypto/x509/x509_constraints.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509_constraints.c,v 1.27 2022/06/26 11:29:27 beck Exp $ */ 1/* $OpenBSD: x509_constraints.c,v 1.28 2022/06/27 15:03:11 beck Exp $ */
2/* 2/*
3 * Copyright (c) 2020 Bob Beck <beck@openbsd.org> 3 * Copyright (c) 2020 Bob Beck <beck@openbsd.org>
4 * 4 *
@@ -455,9 +455,15 @@ x509_constraints_valid_domain_constraint(uint8_t *constraint, size_t len)
455} 455}
456 456
457/* 457/*
458 * Extract the host part of a URI, returns the host part as a c string 458 * Extract the host part of a URI. On failure to parse a valid host part of the
459 * the caller must free, or or NULL if it could not be found or is 459 * URI, 0 is returned indicating an invalid URI. If the host part parses as
460 * invalid. 460 * valid, or is not present, 1 is returned indicating a possibly valid URI.
461 *
462 * In the case of a valid URI, *hostpart will be set to a copy of the host part
463 * of the URI, or the empty string if no URI is present. If memory allocation
464 * fails *hostpart will be set to NULL, even though we returned 1. It is the
465 * caller's responsibility to indicate an error for memory allocation failure,
466 * and the callers responsibility to free *hostpart.
461 * 467 *
462 * RFC 3986: 468 * RFC 3986:
463 * the authority part of a uri starts with // and is terminated with 469 * the authority part of a uri starts with // and is terminated with