summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortb <>2023-09-26 20:42:45 +0000
committertb <>2023-09-26 20:42:45 +0000
commit69bb4041f1907aa069bdef3c3f546e3d34b5470b (patch)
treeb97d15e08bb4f538df6cfd69070f7d55ef5d434a /src
parent2fb34de3060792a0eb0a3d391d55a8644cbae70b (diff)
downloadopenbsd-69bb4041f1907aa069bdef3c3f546e3d34b5470b.tar.gz
openbsd-69bb4041f1907aa069bdef3c3f546e3d34b5470b.tar.bz2
openbsd-69bb4041f1907aa069bdef3c3f546e3d34b5470b.zip
Document X509v3_{addr,asid}_inherits(3)
Also note another bug in X509v3_asid_{canonize,is_canonical}(3).
Diffstat (limited to 'src')
-rw-r--r--src/lib/libcrypto/man/ASIdentifiers_new.33
-rw-r--r--src/lib/libcrypto/man/IPAddressRange_new.33
-rw-r--r--src/lib/libcrypto/man/Makefile3
-rw-r--r--src/lib/libcrypto/man/X509_new.34
-rw-r--r--src/lib/libcrypto/man/X509v3_addr_inherits.3106
-rw-r--r--src/lib/libcrypto/man/X509v3_asid_add_id_or_range.326
6 files changed, 140 insertions, 5 deletions
diff --git a/src/lib/libcrypto/man/ASIdentifiers_new.3 b/src/lib/libcrypto/man/ASIdentifiers_new.3
index a67c54434c..613fd3ce80 100644
--- a/src/lib/libcrypto/man/ASIdentifiers_new.3
+++ b/src/lib/libcrypto/man/ASIdentifiers_new.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: ASIdentifiers_new.3,v 1.5 2023/09/26 15:34:23 tb Exp $ 1.\" $OpenBSD: ASIdentifiers_new.3,v 1.6 2023/09/26 20:42:45 tb Exp $
2.\" 2.\"
3.\" Copyright (c) 2021 Theo Buehler <tb@openbsd.org> 3.\" Copyright (c) 2021 Theo Buehler <tb@openbsd.org>
4.\" 4.\"
@@ -113,6 +113,7 @@ or a value <= 0 if an error occurs.
113.Xr IPAddressRange_new 3 , 113.Xr IPAddressRange_new 3 ,
114.Xr X509_new 3 , 114.Xr X509_new 3 ,
115.Xr X509v3_asid_add_id_or_range 3 115.Xr X509v3_asid_add_id_or_range 3
116.Xr X509v3_asid_inherits 3
116.Sh STANDARDS 117.Sh STANDARDS
117RFC 3779: X.509 Extensions for IP Addresses and AS Identifiers: 118RFC 3779: X.509 Extensions for IP Addresses and AS Identifiers:
118.Bl -dash -compact 119.Bl -dash -compact
diff --git a/src/lib/libcrypto/man/IPAddressRange_new.3 b/src/lib/libcrypto/man/IPAddressRange_new.3
index 262cbd8c81..bee18bc0b4 100644
--- a/src/lib/libcrypto/man/IPAddressRange_new.3
+++ b/src/lib/libcrypto/man/IPAddressRange_new.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: IPAddressRange_new.3,v 1.2 2023/09/26 18:35:34 tb Exp $ 1.\" $OpenBSD: IPAddressRange_new.3,v 1.3 2023/09/26 20:42:45 tb Exp $
2.\" 2.\"
3.\" Copyright (c) 2023 Theo Buehler <tb@openbsd.org> 3.\" Copyright (c) 2023 Theo Buehler <tb@openbsd.org>
4.\" 4.\"
@@ -464,6 +464,7 @@ or a value <= 0 if an error occurs.
464.Xr crypto 3 , 464.Xr crypto 3 ,
465.Xr X509_new 3 , 465.Xr X509_new 3 ,
466.Xr X509v3_addr_add_inherit 3 , 466.Xr X509v3_addr_add_inherit 3 ,
467.Xr X509v3_addr_inherits 3
467.Sh STANDARDS 468.Sh STANDARDS
468RFC 3779: X.509 Extensions for IP Addresses and AS Identifiers: 469RFC 3779: X.509 Extensions for IP Addresses and AS Identifiers:
469.Bl -dash -compact 470.Bl -dash -compact
diff --git a/src/lib/libcrypto/man/Makefile b/src/lib/libcrypto/man/Makefile
index 9ab2a34823..9bf40343e4 100644
--- a/src/lib/libcrypto/man/Makefile
+++ b/src/lib/libcrypto/man/Makefile
@@ -1,4 +1,4 @@
1# $OpenBSD: Makefile,v 1.273 2023/09/26 18:35:34 tb Exp $ 1# $OpenBSD: Makefile,v 1.274 2023/09/26 20:42:45 tb Exp $
2 2
3.include <bsd.own.mk> 3.include <bsd.own.mk>
4 4
@@ -394,6 +394,7 @@ MAN= \
394 X509at_get_attr.3 \ 394 X509at_get_attr.3 \
395 X509v3_addr_add_inherit.3 \ 395 X509v3_addr_add_inherit.3 \
396 X509v3_addr_get_range.3 \ 396 X509v3_addr_get_range.3 \
397 X509v3_addr_inherits.3 \
397 X509v3_asid_add_id_or_range.3 \ 398 X509v3_asid_add_id_or_range.3 \
398 X509v3_asid_add_id_or_range.3 \ 399 X509v3_asid_add_id_or_range.3 \
399 X509v3_get_ext_by_NID.3 \ 400 X509v3_get_ext_by_NID.3 \
diff --git a/src/lib/libcrypto/man/X509_new.3 b/src/lib/libcrypto/man/X509_new.3
index ebffc7e69b..dea1b256ce 100644
--- a/src/lib/libcrypto/man/X509_new.3
+++ b/src/lib/libcrypto/man/X509_new.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: X509_new.3,v 1.40 2023/09/26 15:34:23 tb Exp $ 1.\" $OpenBSD: X509_new.3,v 1.41 2023/09/26 20:42:45 tb Exp $
2.\" full merge up to: OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400 2.\" full merge up to: OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400
3.\" 3.\"
4.\" This file is a derived work. 4.\" This file is a derived work.
@@ -243,6 +243,8 @@ if an error occurs.
243.Xr X509_STORE_new 3 , 243.Xr X509_STORE_new 3 ,
244.Xr X509_TRUST_set 3 , 244.Xr X509_TRUST_set 3 ,
245.Xr X509v3_addr_add_inherit 3 , 245.Xr X509v3_addr_add_inherit 3 ,
246.Xr X509v3_addr_get_range 3 ,
247.Xr X509v3_addr_inherits 3 ,
246.Xr X509v3_asid_add_id_or_range 3 248.Xr X509v3_asid_add_id_or_range 3
247.Sh STANDARDS 249.Sh STANDARDS
248RFC 5280: Internet X.509 Public Key Infrastructure Certificate and 250RFC 5280: Internet X.509 Public Key Infrastructure Certificate and
diff --git a/src/lib/libcrypto/man/X509v3_addr_inherits.3 b/src/lib/libcrypto/man/X509v3_addr_inherits.3
new file mode 100644
index 0000000000..a8465afb38
--- /dev/null
+++ b/src/lib/libcrypto/man/X509v3_addr_inherits.3
@@ -0,0 +1,106 @@
1.\" $OpenBSD: X509v3_addr_inherits.3,v 1.1 2023/09/26 20:42:45 tb Exp $
2.\"
3.\" Copyright (c) 2023 Theo Buehler <tb@openbsd.org>
4.\"
5.\" Permission to use, copy, modify, and distribute this software for any
6.\" purpose with or without fee is hereby granted, provided that the above
7.\" copyright notice and this permission notice appear in all copies.
8.\"
9.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16.\"
17.Dd $Mdocdate: September 26 2023 $
18.Dt X509V3_ADDR_INHERITS 3
19.Os
20.Sh NAME
21.Nm X509v3_addr_inherits ,
22.Nm X509v3_asid_inherits
23.Nd inheritance for the IP address and AS number delegation extensions
24.Sh SYNOPSIS
25.In openssl/x509v3.h
26.Ft int
27.Fn X509v3_addr_inherits "IPAddrBlocks *addrblocks"
28.Ft int
29.Fn X509v3_asid_inherits "ASIdentifiers *asids"
30.Sh DESCRIPTION
31.Fn X509v3_addr_inherits
32determines if there is at least one address family in
33.Fa addrblocks
34that uses inheritance.
35.Pp
36.Fn X509v3_asid_inherits
37is intended to determine if at least one of
38the list of autonomous system numbers or
39the list of routing domain identifiers
40uses inheritance.
41.Sh RETURN VALUES
42.Fn X509v3_addr_inherits
43returns 1 if and only if
44.Fa addrblocks
45contains at least one
46.Fa IPAddressFamily
47object that is correctly marked
48.Dq inherit :
49its
50.Fa IPAddressChoice
51is of
52.Fa type
53.Dv IPAddressChoice_inherit
54and its
55.Fa inherit
56element is present.
57Otherwise it returns 0.
58.Pp
59.Fn X509v3_asid_inherits
60returns 1 if and only if
61at least one of the
62.Fa asnum
63or the
64.Fa rdi
65lists has
66.Fa type
67.Dv ASIdentifierChoice_inherit .
68Otherwise
69.Fn X509v3_asid_inherits 3
70returns 0.
71.Sh SEE ALSO
72.Xr ASIdentifiers_new 3 ,
73.Xr ASRange_new 3 ,
74.Xr crypto 3 ,
75.Xr IPAddressRange_new 3 ,
76.Xr X509_new 3 ,
77.Xr X509v3_addr_add_inherit 3 ,
78.Xr X509v3_asid_add_inherit 3
79.Sh STANDARDS
80RFC 3779: X.509 Extensions for IP Addresses and AS Identifiers:
81.Bl -dash -compact
82.It
83section 2: IP Address delegation extension
84.It
85section 2.2.3.5: Element inherit
86.It
87section 3: AS identifiers delegation extension
88.It
89section 3.2.3.3: Element inherit
90.El
91.Sh HISTORY
92These functions first appeared in OpenSSL 0.9.8e
93and have been available since
94.Ox 7.1 .
95.Sh BUGS
96.Fn X509v3_asid_inherits
97ignores whether the
98.Fa inherit
99is present or absent in the list that is considered to use inheritance.
100.Pp
101There is no API that determines whether all lists contained in an
102.Vt ASIdentifiers
103or an
104.Vt IPAddrBlocks
105objects inherit.
106See RFC 9287, 5.1.2 for an example where this is relevant.
diff --git a/src/lib/libcrypto/man/X509v3_asid_add_id_or_range.3 b/src/lib/libcrypto/man/X509v3_asid_add_id_or_range.3
index 272acc31e2..6d554e6a20 100644
--- a/src/lib/libcrypto/man/X509v3_asid_add_id_or_range.3
+++ b/src/lib/libcrypto/man/X509v3_asid_add_id_or_range.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: X509v3_asid_add_id_or_range.3,v 1.3 2023/09/26 08:56:18 tb Exp $ 1.\" $OpenBSD: X509v3_asid_add_id_or_range.3,v 1.4 2023/09/26 20:42:45 tb Exp $
2.\" 2.\"
3.\" Copyright (c) 2021-2023 Theo Buehler <tb@openbsd.org> 3.\" Copyright (c) 2021-2023 Theo Buehler <tb@openbsd.org>
4.\" 4.\"
@@ -297,3 +297,27 @@ does not prefer either representation over the other.
297The encodings of the two representations produced by 297The encodings of the two representations produced by
298.Xr i2d_ASIdentifiers 3 298.Xr i2d_ASIdentifiers 3
299are distinct. 299are distinct.
300.Pp
301.Fn X509v3_asid_is_canonical
302does not fully check inheriting lists to be well formed.
303It only checks the
304.Fa type
305to be
306.Dv ASIdentifierChoice_inherit
307and ignores the presence or absence of the
308.Fa inherit
309element.
310.Fn X509v3_asid_canonize
311does not fix that up.
312This can lead to incorrect or unexpected DER encoding of
313.Dq canonical
314.Vt ASIdentifiers
315objects.
316In particular, it is possible to construct an
317.Vt ASIdentifiers
318object for which both
319.Fn X509v3_asid_is_canonical
320and
321.Xr X509v3_asid_inherits 3
322return 1, and after a round trip through DER the latter
323returns 0.