diff options
author | tb <> | 2023-04-21 13:08:16 +0000 |
---|---|---|
committer | tb <> | 2023-04-21 13:08:16 +0000 |
commit | 0155dac48763d956dd69098e2dcc51f72a2b0a0c (patch) | |
tree | 5378724491c336dc6852a16228629263aa3a1d69 /src | |
parent | 9e44b5bdb73c1bb4f878ccaee7bf50c523f95983 (diff) | |
download | openbsd-0155dac48763d956dd69098e2dcc51f72a2b0a0c.tar.gz openbsd-0155dac48763d956dd69098e2dcc51f72a2b0a0c.tar.bz2 openbsd-0155dac48763d956dd69098e2dcc51f72a2b0a0c.zip |
s2i_ASN1_INTEGER: make error conditions more explicit, a few more tweaks
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/libcrypto/man/s2i_ASN1_INTEGER.3 | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/src/lib/libcrypto/man/s2i_ASN1_INTEGER.3 b/src/lib/libcrypto/man/s2i_ASN1_INTEGER.3 index dd990ff7f1..39257d4a13 100644 --- a/src/lib/libcrypto/man/s2i_ASN1_INTEGER.3 +++ b/src/lib/libcrypto/man/s2i_ASN1_INTEGER.3 | |||
@@ -1,4 +1,4 @@ | |||
1 | .\" $OpenBSD: s2i_ASN1_INTEGER.3,v 1.3 2023/04/21 12:28:47 tb Exp $ | 1 | .\" $OpenBSD: s2i_ASN1_INTEGER.3,v 1.4 2023/04/21 13:08:16 tb Exp $ |
2 | .\" | 2 | .\" |
3 | .\" Copyright (c) 2023 Theo Buehler <tb@openbsd.org> | 3 | .\" Copyright (c) 2023 Theo Buehler <tb@openbsd.org> |
4 | .\" | 4 | .\" |
@@ -67,7 +67,7 @@ and | |||
67 | .Vt ASN1_OCTET_STRING | 67 | .Vt ASN1_OCTET_STRING |
68 | objects. | 68 | objects. |
69 | They are primarily used internally for parsing configuration files and | 69 | They are primarily used internally for parsing configuration files and |
70 | displaying of X.509v3 certificate extensions. | 70 | displaying X.509v3 certificate extensions. |
71 | With the exception of | 71 | With the exception of |
72 | .Fn i2s_ASN1_ENUMERATED_TABLE , | 72 | .Fn i2s_ASN1_ENUMERATED_TABLE , |
73 | these functions ignore the | 73 | these functions ignore the |
@@ -94,14 +94,15 @@ Decimal representation is used if the number has less than 128 bits, | |||
94 | otherwise hexadecimal representation is used to avoid excessive conversion cost. | 94 | otherwise hexadecimal representation is used to avoid excessive conversion cost. |
95 | .Pp | 95 | .Pp |
96 | .Fn s2i_ASN1_INTEGER | 96 | .Fn s2i_ASN1_INTEGER |
97 | converts a NUL-terminated decimal or hexadecimal string representation of | 97 | converts the NUL-terminated decimal or hexadecimal string representation of |
98 | an integer into an | 98 | an integer in |
99 | .Fa value | ||
100 | into an | ||
99 | .Vt ASN1_INTEGER | 101 | .Vt ASN1_INTEGER |
100 | object. | 102 | object. |
101 | A sign prefix of | 103 | A sign prefix of |
102 | .Sq - | 104 | .Sq - |
103 | indicates a negative number | 105 | indicates a negative number and the base prefixes |
104 | and | ||
105 | .Sq 0x | 106 | .Sq 0x |
106 | and | 107 | and |
107 | .Sq 0X | 108 | .Sq 0X |
@@ -169,18 +170,24 @@ arguments have strings configured in their usr_data field: | |||
169 | .Fn i2s_ASN1_INTEGER , | 170 | .Fn i2s_ASN1_INTEGER , |
170 | and | 171 | and |
171 | .Fn i2s_ASN1_OCTET_STRING | 172 | .Fn i2s_ASN1_OCTET_STRING |
172 | return a NUL-terminated string, or NULL on error, | 173 | return a NUL-terminated string, or NULL on memory allocation failure. |
173 | usually memory allocation failure. | ||
174 | .Pp | 174 | .Pp |
175 | .Fn s2i_ASN1_INTEGER | 175 | .Fn s2i_ASN1_INTEGER |
176 | returns an | 176 | returns an |
177 | .Vt ASN1_INTEGER , | 177 | .Vt ASN1_INTEGER , |
178 | or NULL on error. | 178 | or NULL on error. |
179 | Error conditions are memory allocation failure or if | ||
180 | .Fa value | ||
181 | is not a valid decimal or hexadecimal encoding of an integer. | ||
179 | .Pp | 182 | .Pp |
180 | .Fn s2i_ASN1_OCTET_STRING | 183 | .Fn s2i_ASN1_OCTET_STRING |
181 | returns an | 184 | returns an |
182 | .Vt ASN1_OCTET_STRING , | 185 | .Vt ASN1_OCTET_STRING , |
183 | or NULL on error. | 186 | or NULL on error. |
187 | Error conditions are memory allocation failure or if | ||
188 | .Fa value | ||
189 | contains an odd number of hexadecimal digits or anything except | ||
190 | colons between pairs of hexadecimal digits. | ||
184 | .Pp | 191 | .Pp |
185 | Error codes can sometimes be obtained by | 192 | Error codes can sometimes be obtained by |
186 | .Xr ERR_get_error 3 . | 193 | .Xr ERR_get_error 3 . |
@@ -195,5 +202,6 @@ have been available since | |||
195 | .Ox 2.6 . | 202 | .Ox 2.6 . |
196 | .Sh BUGS | 203 | .Sh BUGS |
197 | Of these functions at least | 204 | Of these functions at least |
198 | .Fn s2i_ASN1_OCTET_STRING | 205 | .Fn i2s_ASN1_ENUMERATED_TABLE |
199 | can succeed while setting an error and fail without setting an error. | 206 | can succeed while setting an error and fail without setting an error |
207 | on the error stack. | ||