diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/libcrypto/man/X509v3_addr_subset.3 | 176 |
1 files changed, 176 insertions, 0 deletions
diff --git a/src/lib/libcrypto/man/X509v3_addr_subset.3 b/src/lib/libcrypto/man/X509v3_addr_subset.3 new file mode 100644 index 0000000000..8107eb8884 --- /dev/null +++ b/src/lib/libcrypto/man/X509v3_addr_subset.3 | |||
| @@ -0,0 +1,176 @@ | |||
| 1 | .\" $OpenBSD: X509v3_addr_subset.3,v 1.1 2023/09/28 12:36:36 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 28 2023 $ | ||
| 18 | .Dt X509V3_ADDR_SUBSET 3 | ||
| 19 | .Os | ||
| 20 | .Sh NAME | ||
| 21 | .Nm X509v3_addr_subset , | ||
| 22 | .Nm X509v3_asid_subset | ||
| 23 | .Nd RFC 3779 subset relationship | ||
| 24 | .Sh SYNOPSIS | ||
| 25 | .In openssl/x509v3.h | ||
| 26 | .Ft int | ||
| 27 | .Fn X509v3_addr_subset "IPAddrBlocks *child" "IPAddrBlocks *parent" | ||
| 28 | .Ft int | ||
| 29 | .Fn X509v3_asid_subset "ASIdentifiers *child" "ASIdentifiers *parent" | ||
| 30 | .Sh DESCRIPTION | ||
| 31 | .Fn X509v3_addr_subset | ||
| 32 | determines if all IP address resources present in | ||
| 33 | .Fa child | ||
| 34 | are contained in the corresponding resources in | ||
| 35 | .Fa parent . | ||
| 36 | .Pp | ||
| 37 | The implementation assumes but does not ensure that both | ||
| 38 | .Fa child | ||
| 39 | and | ||
| 40 | .Fa parent | ||
| 41 | are in canonical form as described in | ||
| 42 | .Xr X509v3_addr_is_canonical 3 . | ||
| 43 | In particular, both | ||
| 44 | .Fa child | ||
| 45 | and | ||
| 46 | .Fa parent | ||
| 47 | are sorted appropriately and they contain at most one | ||
| 48 | .Vt IPAddressFamily | ||
| 49 | object per address family identifier (AFI) and optional | ||
| 50 | subsequent address family identifier (SAFI). | ||
| 51 | .Pp | ||
| 52 | The checks are, in order: | ||
| 53 | .Bl -enum | ||
| 54 | .It | ||
| 55 | If | ||
| 56 | .Fa child | ||
| 57 | is | ||
| 58 | .Dv NULL | ||
| 59 | or identical to | ||
| 60 | .Fa parent | ||
| 61 | then | ||
| 62 | .Fa child | ||
| 63 | is a subset of | ||
| 64 | .Fa parent . | ||
| 65 | (In particular, a | ||
| 66 | .Dv NULL | ||
| 67 | .Fa parent | ||
| 68 | is allowed for a | ||
| 69 | .Dv NULL | ||
| 70 | .Fa child Ns .) | ||
| 71 | .It | ||
| 72 | If | ||
| 73 | .Fa parent | ||
| 74 | is | ||
| 75 | .Dv NULL | ||
| 76 | then | ||
| 77 | .Fa child | ||
| 78 | is not a subset of | ||
| 79 | .Fa parent . | ||
| 80 | .It | ||
| 81 | If | ||
| 82 | .Xr X509v3_addr_inherits 3 | ||
| 83 | determines that | ||
| 84 | .Fa child | ||
| 85 | inherits or that | ||
| 86 | .Fa parent | ||
| 87 | inherits | ||
| 88 | then | ||
| 89 | .Fa child | ||
| 90 | is not a subset of | ||
| 91 | .Fa parent . | ||
| 92 | .It | ||
| 93 | Each address prefix or range in | ||
| 94 | .Fa child | ||
| 95 | must be a subset of an address prefix or range in the | ||
| 96 | .Fa parent , | ||
| 97 | taking AFI and optional SAFI into account: | ||
| 98 | .Bl -bullet -compact | ||
| 99 | .It | ||
| 100 | For each | ||
| 101 | .Vt IPAddressFamily | ||
| 102 | of | ||
| 103 | .Fa child | ||
| 104 | there must be an | ||
| 105 | .Vt IPAddressFamily | ||
| 106 | of | ||
| 107 | .Fa parent | ||
| 108 | with the same AFI and optional SAFI. | ||
| 109 | .It | ||
| 110 | Since the address prefixes and ranges in corresponding | ||
| 111 | .Vt IPAddressFamily | ||
| 112 | objects in | ||
| 113 | .Fa child | ||
| 114 | and | ||
| 115 | .Fa parent | ||
| 116 | are sorted in ascending order, | ||
| 117 | and do not overlap, | ||
| 118 | they can be traversed simultaneously in linear time. | ||
| 119 | For each prefix or range in | ||
| 120 | .Fa child | ||
| 121 | there must be a prefix or range in | ||
| 122 | .Fa parent | ||
| 123 | whose minimal address is smaller | ||
| 124 | and whose maximal address is larger. | ||
| 125 | .El | ||
| 126 | If any of these steps fails, | ||
| 127 | .Fa child | ||
| 128 | is not a subset of | ||
| 129 | .Fa parent . | ||
| 130 | .El | ||
| 131 | .Pp | ||
| 132 | .Fn X509v3_asid_subset | ||
| 133 | determines if all AS identifier resources in | ||
| 134 | .Fa child | ||
| 135 | are contained in the corresponding resources in | ||
| 136 | .Fa parent . | ||
| 137 | .Pp | ||
| 138 | The description for | ||
| 139 | .Fn X509v3_addr_subset | ||
| 140 | applies mutatis mutandis. | ||
| 141 | In particular, | ||
| 142 | .Fa child | ||
| 143 | and | ||
| 144 | .Fa parent | ||
| 145 | must be in canonical form per | ||
| 146 | .Xr X509v3_asid_is_canonical 3 , | ||
| 147 | but this is not enforced. | ||
| 148 | .Sh RETURN VALUES | ||
| 149 | .Fn X509v3_addr_subset | ||
| 150 | and | ||
| 151 | .Fn X509v3_asid_subset | ||
| 152 | return 1 if and only if | ||
| 153 | .Fa child | ||
| 154 | is a subset of | ||
| 155 | .Fa parent , | ||
| 156 | otherwise they return 0. | ||
| 157 | If both | ||
| 158 | .Fa child | ||
| 159 | and | ||
| 160 | .Fa parent | ||
| 161 | are in canonical form, | ||
| 162 | they cannot fail. | ||
| 163 | .Sh SEE ALSO | ||
| 164 | .Xr ASIdentifiers_new 3 , | ||
| 165 | .Xr ASRange_new 3 , | ||
| 166 | .Xr crypto 3 , | ||
| 167 | .Xr IPAddressRange_new 3 , | ||
| 168 | .Xr X509_new 3 , | ||
| 169 | .Xr X509v3_addr_add_inherit 3 , | ||
| 170 | .Xr X509v3_asid_add_inherit 3 | ||
| 171 | .Sh STANDARDS | ||
| 172 | RFC 3779: X.509 Extensions for IP Addresses and AS Identifiers. | ||
| 173 | .Sh HISTORY | ||
| 174 | These functions first appeared in OpenSSL 0.9.8e | ||
| 175 | and have been available since | ||
| 176 | .Ox 7.1 . | ||
