diff options
Diffstat (limited to 'src/lib/libcrypto/man/s2i_ASN1_INTEGER.3')
| -rw-r--r-- | src/lib/libcrypto/man/s2i_ASN1_INTEGER.3 | 215 |
1 files changed, 0 insertions, 215 deletions
diff --git a/src/lib/libcrypto/man/s2i_ASN1_INTEGER.3 b/src/lib/libcrypto/man/s2i_ASN1_INTEGER.3 deleted file mode 100644 index a2105bc4bc..0000000000 --- a/src/lib/libcrypto/man/s2i_ASN1_INTEGER.3 +++ /dev/null | |||
| @@ -1,215 +0,0 @@ | |||
| 1 | .\" $OpenBSD: s2i_ASN1_INTEGER.3,v 1.9 2024/12/27 15:30:17 schwarze 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: December 27 2024 $ | ||
| 18 | .Dt S2I_ASN1_INTEGER 3 | ||
| 19 | .Os | ||
| 20 | .Sh NAME | ||
| 21 | .Nm i2s_ASN1_ENUMERATED , | ||
| 22 | .Nm i2s_ASN1_ENUMERATED_TABLE , | ||
| 23 | .Nm i2s_ASN1_INTEGER , | ||
| 24 | .Nm s2i_ASN1_INTEGER , | ||
| 25 | .Nm i2s_ASN1_OCTET_STRING , | ||
| 26 | .Nm s2i_ASN1_OCTET_STRING | ||
| 27 | .Nd ASN.1 data type conversion utilities for certificate extensions | ||
| 28 | .Sh SYNOPSIS | ||
| 29 | .In openssl/asn1.h | ||
| 30 | .In openssl/x509v3.h | ||
| 31 | .Ft "char *" | ||
| 32 | .Fo i2s_ASN1_ENUMERATED | ||
| 33 | .Fa "X509V3_EXT_METHOD *method" | ||
| 34 | .Fa "const ASN1_ENUMERATED *a" | ||
| 35 | .Fc | ||
| 36 | .Ft "char *" | ||
| 37 | .Fo i2s_ASN1_INTEGER | ||
| 38 | .Fa "X509V3_EXT_METHOD *method" | ||
| 39 | .Fa "const ASN1_INTEGER *a" | ||
| 40 | .Fc | ||
| 41 | .Ft "ASN1_INTEGER *" | ||
| 42 | .Fo s2i_ASN1_INTEGER | ||
| 43 | .Fa "X509V3_EXT_METHOD *method" | ||
| 44 | .Fa "const char *value" | ||
| 45 | .Fc | ||
| 46 | .Ft "char *" | ||
| 47 | .Fo i2s_ASN1_OCTET_STRING | ||
| 48 | .Fa "X509V3_EXT_METHOD *method" | ||
| 49 | .Fa "const ASN1_OCTET_STRING *aos" | ||
| 50 | .Fc | ||
| 51 | .Ft "ASN1_OCTET_STRING *" | ||
| 52 | .Fo s2i_ASN1_OCTET_STRING | ||
| 53 | .Fa "X509V3_EXT_METHOD *method" | ||
| 54 | .Fa "X509V3_CTX *ctx" | ||
| 55 | .Fa "const char *value" | ||
| 56 | .Fc | ||
| 57 | .Ft "char *" | ||
| 58 | .Fo i2s_ASN1_ENUMERATED_TABLE | ||
| 59 | .Fa "X509V3_EXT_METHOD *method" | ||
| 60 | .Fa "const ASN1_ENUMERATED *a" | ||
| 61 | .Fc | ||
| 62 | .Sh DESCRIPTION | ||
| 63 | These functions convert to and from | ||
| 64 | .Vt ASN1_ENUMERATED , | ||
| 65 | .Vt ASN1_INTEGER , | ||
| 66 | and | ||
| 67 | .Vt ASN1_OCTET_STRING | ||
| 68 | objects. | ||
| 69 | They are primarily used internally for parsing configuration files and | ||
| 70 | displaying X.509v3 certificate extensions. | ||
| 71 | With the exception of | ||
| 72 | .Fn i2s_ASN1_ENUMERATED_TABLE , | ||
| 73 | these functions ignore the | ||
| 74 | .Fa method | ||
| 75 | argument. | ||
| 76 | Any object or string returned by these functions must be freed by the caller. | ||
| 77 | .Pp | ||
| 78 | .Fn i2s_ASN1_ENUMERATED | ||
| 79 | and | ||
| 80 | .Fn i2s_ASN1_INTEGER | ||
| 81 | first convert | ||
| 82 | .Fa a | ||
| 83 | into a | ||
| 84 | .Vt BIGNUM | ||
| 85 | object with | ||
| 86 | .Xr ASN1_ENUMERATED_to_BN 3 | ||
| 87 | or | ||
| 88 | .Xr ASN1_INTEGER_to_BN 3 | ||
| 89 | and then derive a string representation using | ||
| 90 | .Xr BN_bn2dec 3 | ||
| 91 | or | ||
| 92 | .Xr BN_bn2hex 3 . | ||
| 93 | Decimal representation is used if the number has less than 128 bits, | ||
| 94 | otherwise hexadecimal representation is used to avoid excessive conversion cost. | ||
| 95 | .Pp | ||
| 96 | .Fn s2i_ASN1_INTEGER | ||
| 97 | converts the NUL-terminated decimal or hexadecimal string representation of | ||
| 98 | an integer in | ||
| 99 | .Fa value | ||
| 100 | into an | ||
| 101 | .Vt ASN1_INTEGER | ||
| 102 | object. | ||
| 103 | A sign prefix of | ||
| 104 | .Sq - | ||
| 105 | indicates a negative number and the base prefixes | ||
| 106 | .Sq 0x | ||
| 107 | and | ||
| 108 | .Sq 0X | ||
| 109 | indicate hexadecimal representation, | ||
| 110 | otherwise decimal representation is assumed. | ||
| 111 | After skipping the sign and base prefixes, an intermediate conversion into a | ||
| 112 | .Vt BIGNUM | ||
| 113 | is performed using | ||
| 114 | .Xr BN_dec2bn 3 | ||
| 115 | or | ||
| 116 | .Xr BN_hex2bn 3 | ||
| 117 | and the | ||
| 118 | .Vt ASN1_INTEGER | ||
| 119 | is then obtained with | ||
| 120 | .Xr BN_to_ASN1_INTEGER 3 . | ||
| 121 | .Pp | ||
| 122 | .Fn i2s_ASN1_OCTET_STRING | ||
| 123 | converts the octets in | ||
| 124 | .Fa aos | ||
| 125 | into a string where the octets are colon-separated and | ||
| 126 | represented as pairs of uppercase hexadecimal digits. | ||
| 127 | .Pp | ||
| 128 | .Fn s2i_ASN1_OCTET_STRING | ||
| 129 | converts the NUL-terminated string | ||
| 130 | .Fa str | ||
| 131 | into an | ||
| 132 | .Vt ASN1_OCTET_STRING . | ||
| 133 | The | ||
| 134 | .Fa method | ||
| 135 | and | ||
| 136 | .Fa ctx | ||
| 137 | arguments are ignored. | ||
| 138 | Every pair of hexadecimal digits is converted into an octet. | ||
| 139 | Colons are ignored if they are at the start, the end or | ||
| 140 | if they separate two pairs of digits. | ||
| 141 | .Pp | ||
| 142 | .Fn i2s_ASN1_ENUMERATED_TABLE | ||
| 143 | looks up the value of | ||
| 144 | .Fa a | ||
| 145 | in the | ||
| 146 | .Fa usr_data | ||
| 147 | field of the | ||
| 148 | .Pf non- Dv NULL | ||
| 149 | .Fa method | ||
| 150 | and returns a copy of the associated long name. | ||
| 151 | If no match is found, | ||
| 152 | .Fa a | ||
| 153 | is passed to | ||
| 154 | .Fn i2s_ASN1_ENUMERATED . | ||
| 155 | The | ||
| 156 | .Fa method | ||
| 157 | argument can be provided by application programs or it can be a | ||
| 158 | default method obtained from | ||
| 159 | .Xr X509V3_EXT_get_nid 3 . | ||
| 160 | The default | ||
| 161 | .Fa methods | ||
| 162 | corresponding to the following | ||
| 163 | .Fa nid | ||
| 164 | arguments have strings configured in their usr_data field: | ||
| 165 | .Pp | ||
| 166 | .Bl -column NID_netscape_cert_type "Netscape certificate type (obsolete)" -compact | ||
| 167 | .It Dv NID_crl_reason Ta reason codes, RFC 5280, 5.3.1 | ||
| 168 | .It Dv NID_key_usage Ta key usage, RFC 5280, 4.2.1.3 | ||
| 169 | .It Dv NID_netscape_cert_type Ta Netscape certificate type (obsolete) | ||
| 170 | .El | ||
| 171 | .Sh RETURN VALUES | ||
| 172 | .Fn i2s_ASN1_ENUMERATED , | ||
| 173 | .Fn i2s_ASN1_ENUMERATED_TABLE , | ||
| 174 | .Fn i2s_ASN1_INTEGER , | ||
| 175 | and | ||
| 176 | .Fn i2s_ASN1_OCTET_STRING | ||
| 177 | return a NUL-terminated string, or NULL on memory allocation failure. | ||
| 178 | .Pp | ||
| 179 | .Fn s2i_ASN1_INTEGER | ||
| 180 | returns an | ||
| 181 | .Vt ASN1_INTEGER , | ||
| 182 | or NULL on error. | ||
| 183 | Error conditions are memory allocation failure or if | ||
| 184 | .Fa value | ||
| 185 | is not a valid decimal or hexadecimal encoding of an integer. | ||
| 186 | .Pp | ||
| 187 | .Fn s2i_ASN1_OCTET_STRING | ||
| 188 | returns an | ||
| 189 | .Vt ASN1_OCTET_STRING , | ||
| 190 | or NULL on error. | ||
| 191 | Error conditions are memory allocation failure or if | ||
| 192 | .Fa value | ||
| 193 | contains an odd number of hexadecimal digits or anything except | ||
| 194 | colons at the start, the end or between pairs of hexadecimal digits. | ||
| 195 | .Pp | ||
| 196 | Error codes can sometimes be obtained by | ||
| 197 | .Xr ERR_get_error 3 . | ||
| 198 | .Sh SEE ALSO | ||
| 199 | .Xr a2i_ASN1_INTEGER 3 , | ||
| 200 | .Xr a2i_ipadd 3 , | ||
| 201 | .Xr ASN1_INTEGER_new 3 , | ||
| 202 | .Xr ASN1_INTEGER_to_BN 3 , | ||
| 203 | .Xr ASN1_OCTET_STRING_new 3 , | ||
| 204 | .Xr crypto 3 , | ||
| 205 | .Xr v2i_ASN1_BIT_STRING 3 , | ||
| 206 | .Xr X509V3_get_d2i 3 | ||
| 207 | .Sh HISTORY | ||
| 208 | These functions first appeared in OpenSSL 0.9.4 and | ||
| 209 | have been available since | ||
| 210 | .Ox 2.6 . | ||
| 211 | .Sh BUGS | ||
| 212 | Of these functions at least | ||
| 213 | .Fn i2s_ASN1_ENUMERATED_TABLE | ||
| 214 | can succeed while setting an error and fail without setting an error | ||
| 215 | on the error stack. | ||
