summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortb <>2023-04-21 13:08:16 +0000
committertb <>2023-04-21 13:08:16 +0000
commit0155dac48763d956dd69098e2dcc51f72a2b0a0c (patch)
tree5378724491c336dc6852a16228629263aa3a1d69 /src
parent9e44b5bdb73c1bb4f878ccaee7bf50c523f95983 (diff)
downloadopenbsd-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.328
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
68objects. 68objects.
69They are primarily used internally for parsing configuration files and 69They are primarily used internally for parsing configuration files and
70displaying of X.509v3 certificate extensions. 70displaying X.509v3 certificate extensions.
71With the exception of 71With the exception of
72.Fn i2s_ASN1_ENUMERATED_TABLE , 72.Fn i2s_ASN1_ENUMERATED_TABLE ,
73these functions ignore the 73these functions ignore the
@@ -94,14 +94,15 @@ Decimal representation is used if the number has less than 128 bits,
94otherwise hexadecimal representation is used to avoid excessive conversion cost. 94otherwise hexadecimal representation is used to avoid excessive conversion cost.
95.Pp 95.Pp
96.Fn s2i_ASN1_INTEGER 96.Fn s2i_ASN1_INTEGER
97converts a NUL-terminated decimal or hexadecimal string representation of 97converts the NUL-terminated decimal or hexadecimal string representation of
98an integer into an 98an integer in
99.Fa value
100into an
99.Vt ASN1_INTEGER 101.Vt ASN1_INTEGER
100object. 102object.
101A sign prefix of 103A sign prefix of
102.Sq - 104.Sq -
103indicates a negative number 105indicates a negative number and the base prefixes
104and
105.Sq 0x 106.Sq 0x
106and 107and
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 ,
170and 171and
171.Fn i2s_ASN1_OCTET_STRING 172.Fn i2s_ASN1_OCTET_STRING
172return a NUL-terminated string, or NULL on error, 173return a NUL-terminated string, or NULL on memory allocation failure.
173usually memory allocation failure.
174.Pp 174.Pp
175.Fn s2i_ASN1_INTEGER 175.Fn s2i_ASN1_INTEGER
176returns an 176returns an
177.Vt ASN1_INTEGER , 177.Vt ASN1_INTEGER ,
178or NULL on error. 178or NULL on error.
179Error conditions are memory allocation failure or if
180.Fa value
181is 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
181returns an 184returns an
182.Vt ASN1_OCTET_STRING , 185.Vt ASN1_OCTET_STRING ,
183or NULL on error. 186or NULL on error.
187Error conditions are memory allocation failure or if
188.Fa value
189contains an odd number of hexadecimal digits or anything except
190colons between pairs of hexadecimal digits.
184.Pp 191.Pp
185Error codes can sometimes be obtained by 192Error 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
197Of these functions at least 204Of these functions at least
198.Fn s2i_ASN1_OCTET_STRING 205.Fn i2s_ASN1_ENUMERATED_TABLE
199can succeed while setting an error and fail without setting an error. 206can succeed while setting an error and fail without setting an error
207on the error stack.