diff options
author | cvs2svn <admin@example.com> | 2025-04-14 17:32:06 +0000 |
---|---|---|
committer | cvs2svn <admin@example.com> | 2025-04-14 17:32:06 +0000 |
commit | eb8dd9dca1228af0cd132f515509051ecfabf6f6 (patch) | |
tree | edb6da6af7e865d488dc1a29309f1e1ec226e603 /src/lib/libcrypto/man/a2i_ipadd.3 | |
parent | 247f0352e0ed72a4f476db9dc91f4d982bc83eb2 (diff) | |
download | openbsd-tb_20250414.tar.gz openbsd-tb_20250414.tar.bz2 openbsd-tb_20250414.zip |
This commit was manufactured by cvs2git to create tag 'tb_20250414'.tb_20250414
Diffstat (limited to 'src/lib/libcrypto/man/a2i_ipadd.3')
-rw-r--r-- | src/lib/libcrypto/man/a2i_ipadd.3 | 136 |
1 files changed, 0 insertions, 136 deletions
diff --git a/src/lib/libcrypto/man/a2i_ipadd.3 b/src/lib/libcrypto/man/a2i_ipadd.3 deleted file mode 100644 index 1372b2acfd..0000000000 --- a/src/lib/libcrypto/man/a2i_ipadd.3 +++ /dev/null | |||
@@ -1,136 +0,0 @@ | |||
1 | .\" $OpenBSD: a2i_ipadd.3,v 1.1 2024/12/27 15:30:17 schwarze Exp $ | ||
2 | .\" | ||
3 | .\" Copyright (c) 2024 Ingo Schwarze <schwarze@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: December 27 2024 $ | ||
18 | .Dt A2I_IPADD 3 | ||
19 | .Os | ||
20 | .Sh NAME | ||
21 | .Nm a2i_ipadd , | ||
22 | .Nm a2i_IPADDRESS , | ||
23 | .Nm a2i_IPADDRESS_NC | ||
24 | .Nd parse Internet Protocol addresses into ASN.1 OCTET STRINGs for X.509 | ||
25 | .Sh SYNOPSIS | ||
26 | .In openssl/x509v3.h | ||
27 | .Ft int | ||
28 | .Fo a2i_ipadd | ||
29 | .Fa "unsigned char *ipout" | ||
30 | .Fa "const char *ipasc" | ||
31 | .Fc | ||
32 | .Ft ASN1_OCTET_STRING * | ||
33 | .Fo a2i_IPADDRESS | ||
34 | .Fa "const char *ipasc" | ||
35 | .Fc | ||
36 | .Ft ASN1_OCTET_STRING * | ||
37 | .Fo a2i_IPADDRESS_NC | ||
38 | .Fa "const char *ipasc" | ||
39 | .Fc | ||
40 | .Sh DESCRIPTION | ||
41 | .Fn a2i_ipadd | ||
42 | and | ||
43 | .Fn a2i_IPADDRESS | ||
44 | parse the string | ||
45 | .Fa ipasc | ||
46 | containing an IPv4 or IPv6 address | ||
47 | in one of the following formats: | ||
48 | .Bd -literal -offset indent | ||
49 | d.d.d.d | ||
50 | x:x:x:x:x:x:x:x (exactly 8 words) | ||
51 | (x:)*x::x(:x)* (less than 8 words) | ||
52 | (x:)*x:: (less than 8 words) | ||
53 | ::x(:x)* (less than 8 words) | ||
54 | :: | ||
55 | (x:)*d.d.d.d (up to 6 hexadecimal words, :: can be used) | ||
56 | .Ed | ||
57 | .Pp | ||
58 | where each | ||
59 | .Ar d | ||
60 | represents a non-negative decimal number less than 256 | ||
61 | with one, two or three digits and each | ||
62 | .Ar x | ||
63 | represents a non-negative hexadecimal number | ||
64 | with one, two, three, or four digits. | ||
65 | Both the lower case letters a-f and the upper case letters A-F can be used. | ||
66 | .Pp | ||
67 | .Fn a2i_ipadd | ||
68 | stores the bytes of the address in network byte order (big endian) starting at | ||
69 | .Fa ipout . | ||
70 | The caller is responsible for providing sufficient space; | ||
71 | always providing a buffer of at least 16 bytes is recommended, | ||
72 | even if an IPv4 address is expected, to avoid buffer overruns in case | ||
73 | .Fa ipasc | ||
74 | is malformed. | ||
75 | .Pp | ||
76 | .Fn a2i_IPADDRESS | ||
77 | stores the address in a newly allocated ASN.1 | ||
78 | .Vt OCTET STRING . | ||
79 | .Pp | ||
80 | .Fn a2i_IPADDRESS_NC | ||
81 | expects | ||
82 | .Fa ipasc | ||
83 | to contain two addresses of the same address family in the above form, | ||
84 | separated by a slash | ||
85 | .Pq Sq / | ||
86 | character, and stores the concatenation of both addresses | ||
87 | in a newly allocated ASN.1 | ||
88 | .Vt OCTET STRING , | ||
89 | which is typically used for address/mask pairs | ||
90 | in name constraint extensions of CA certificates. | ||
91 | .Sh RETURN VALUES | ||
92 | .Fn a2i_ipadd | ||
93 | returns the number of bytes written to | ||
94 | .Fa ipout | ||
95 | in case of success, i.e. 4 for an IPv4 or 16 for an IPv6 address, | ||
96 | or 0 if parsing failed. | ||
97 | .Pp | ||
98 | .Fn a2i_IPADDRESS | ||
99 | and | ||
100 | .Fn a2i_IPADDRESS_NC | ||
101 | return the new object or | ||
102 | .Dv NULL | ||
103 | if parsing or memory allocation failed. | ||
104 | .Sh SEE ALSO | ||
105 | .Xr a2i_ASN1_STRING 3 , | ||
106 | .Xr ASN1_OCTET_STRING_new 3 , | ||
107 | .Xr ASN1_OCTET_STRING_set 3 , | ||
108 | .Xr GENERAL_NAME_new 3 , | ||
109 | .Xr IPAddressRange_new 3 , | ||
110 | .Xr NAME_CONSTRAINTS_new 3 , | ||
111 | .Xr s2i_ASN1_OCTET_STRING 3 , | ||
112 | .Xr X509_EXTENSION_new 3 | ||
113 | .Sh STANDARDS | ||
114 | RFC 5280: Internet X.509 Public Key Infrastructure Certificate and | ||
115 | Certificate Revocation List (CRL) Profile | ||
116 | .Bl -dash -width 1n -compact | ||
117 | .It | ||
118 | section 4.2.1.6: Subject Alternative Name | ||
119 | .It | ||
120 | section 4.2.1.10: Name Constraints | ||
121 | .El | ||
122 | .Sh HISTORY | ||
123 | .Fn a2i_IPADDRESS | ||
124 | and | ||
125 | .Fn a2i_IPADDRESS_NC | ||
126 | first appeared in OpenSSL 0.9.8 and | ||
127 | .Fn a2i_ipadd | ||
128 | in OpenSSL 0.9.8e. | ||
129 | They have been available since | ||
130 | .Ox 4.5 . | ||
131 | .Sh CAVEATS | ||
132 | While some syntax errors are caught, only minimal validation takes place, | ||
133 | and these functions often return objects that make no sense, in particular | ||
134 | in the context of IPv6. | ||
135 | For example, the trailing :d.d.d.d syntax can be appended | ||
136 | to a hexadecimal part that results in twelve arbitrary bytes. | ||