diff options
author | schwarze <> | 2021-11-28 17:40:14 +0000 |
---|---|---|
committer | schwarze <> | 2021-11-28 17:40:14 +0000 |
commit | febc5b6e19de9b99232a2be473a31e053a3fafe6 (patch) | |
tree | 1463e00e946035ec624b22d579fe045c961cc960 | |
parent | 1c03917613c5125002c20148a9e7e605fae25a88 (diff) | |
download | openbsd-febc5b6e19de9b99232a2be473a31e053a3fafe6.tar.gz openbsd-febc5b6e19de9b99232a2be473a31e053a3fafe6.tar.bz2 openbsd-febc5b6e19de9b99232a2be473a31e053a3fafe6.zip |
document ASN1_tag2bit(3)
-rw-r--r-- | src/lib/libcrypto/man/ASN1_mbstring_copy.3 | 71 |
1 files changed, 66 insertions, 5 deletions
diff --git a/src/lib/libcrypto/man/ASN1_mbstring_copy.3 b/src/lib/libcrypto/man/ASN1_mbstring_copy.3 index b499c3b8b2..208f472852 100644 --- a/src/lib/libcrypto/man/ASN1_mbstring_copy.3 +++ b/src/lib/libcrypto/man/ASN1_mbstring_copy.3 | |||
@@ -1,4 +1,4 @@ | |||
1 | .\" $OpenBSD: ASN1_mbstring_copy.3,v 1.3 2021/11/15 13:39:40 schwarze Exp $ | 1 | .\" $OpenBSD: ASN1_mbstring_copy.3,v 1.4 2021/11/28 17:40:14 schwarze Exp $ |
2 | .\" | 2 | .\" |
3 | .\" Copyright (c) 2021 Ingo Schwarze <schwarze@openbsd.org> | 3 | .\" Copyright (c) 2021 Ingo Schwarze <schwarze@openbsd.org> |
4 | .\" | 4 | .\" |
@@ -14,7 +14,7 @@ | |||
14 | .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | 14 | .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
15 | .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | 15 | .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
16 | .\" | 16 | .\" |
17 | .Dd $Mdocdate: November 15 2021 $ | 17 | .Dd $Mdocdate: November 28 2021 $ |
18 | .Dt ASN1_MBSTRING_COPY 3 | 18 | .Dt ASN1_MBSTRING_COPY 3 |
19 | .Os | 19 | .Os |
20 | .Sh NAME | 20 | .Sh NAME |
@@ -23,7 +23,8 @@ | |||
23 | .Nm ASN1_STRING_set_by_NID , | 23 | .Nm ASN1_STRING_set_by_NID , |
24 | .Nm ASN1_STRING_set_default_mask , | 24 | .Nm ASN1_STRING_set_default_mask , |
25 | .Nm ASN1_STRING_set_default_mask_asc , | 25 | .Nm ASN1_STRING_set_default_mask_asc , |
26 | .Nm ASN1_STRING_get_default_mask | 26 | .Nm ASN1_STRING_get_default_mask , |
27 | .Nm ASN1_tag2bit | ||
27 | .Nd copy a mutibyte string into an ASN.1 string object | 28 | .Nd copy a mutibyte string into an ASN.1 string object |
28 | .Sh SYNOPSIS | 29 | .Sh SYNOPSIS |
29 | .In openssl/asn1.h | 30 | .In openssl/asn1.h |
@@ -63,6 +64,8 @@ | |||
63 | .Fc | 64 | .Fc |
64 | .Ft unsigned long | 65 | .Ft unsigned long |
65 | .Fn ASN1_STRING_get_default_mask void | 66 | .Fn ASN1_STRING_get_default_mask void |
67 | .Ft unsigned long | ||
68 | .Fn ASN1_tag2bit "int tag" | ||
66 | .Sh DESCRIPTION | 69 | .Sh DESCRIPTION |
67 | .Fn ASN1_mbstring_copy | 70 | .Fn ASN1_mbstring_copy |
68 | interprets | 71 | interprets |
@@ -225,6 +228,49 @@ the rest of it is interpreted as an | |||
225 | .Vt unsigned long | 228 | .Vt unsigned long |
226 | value using | 229 | value using |
227 | .Xr strtoul 3 . | 230 | .Xr strtoul 3 . |
231 | .Pp | ||
232 | .Fn ASN1_tag2bit | ||
233 | translates ASN.1 data types to type bits as follows: | ||
234 | .Bl -column V_ASN1_OBJECT_DESCRIPTOR B_ASN1_UNIVERSALSTRING | ||
235 | .It Fa tag Ta return value | ||
236 | .It Dv V_ASN1_BIT_STRING Ta Dv B_ASN1_BIT_STRING | ||
237 | .It Dv V_ASN1_BMPSTRING Ta Dv B_ASN1_BMPSTRING | ||
238 | .It Dv V_ASN1_BOOLEAN Ta 0 | ||
239 | .It Dv V_ASN1_ENUMERATED Ta Dv B_ASN1_UNKNOWN | ||
240 | .It Dv V_ASN1_EOC Ta 0 | ||
241 | .It Dv V_ASN1_EXTERNAL Ta Dv B_ASN1_UNKNOWN | ||
242 | .It Dv V_ASN1_GENERALIZEDTIME Ta Dv B_ASN1_GENERALIZEDTIME | ||
243 | .It Dv V_ASN1_GENERALSTRING Ta Dv B_ASN1_GENERALSTRING | ||
244 | .It Dv V_ASN1_GRAPHICSTRING Ta Dv B_ASN1_GRAPHICSTRING | ||
245 | .It Dv V_ASN1_IA5STRING Ta Dv B_ASN1_IA5STRING | ||
246 | .It Dv V_ASN1_INTEGER Ta 0 | ||
247 | .It Dv V_ASN1_ISO64STRING Ta Dv B_ASN1_ISO64STRING | ||
248 | .It Dv V_ASN1_NULL Ta 0 | ||
249 | .It Dv V_ASN1_NUMERICSTRING Ta Dv B_ASN1_NUMERICSTRING | ||
250 | .It Dv V_ASN1_OBJECT Ta 0 | ||
251 | .It Dv V_ASN1_OBJECT_DESCRIPTOR Ta Dv B_ASN1_UNKNOWN | ||
252 | .It Dv V_ASN1_OCTET_STRING Ta Dv B_ASN1_OCTET_STRING | ||
253 | .It Dv V_ASN1_PRINTABLESTRING Ta Dv B_ASN1_PRINTABLESTRING | ||
254 | .It Dv V_ASN1_REAL Ta Dv B_ASN1_UNKNOWN | ||
255 | .It Dv V_ASN1_SEQUENCE Ta Dv B_ASN1_SEQUENCE | ||
256 | .It Dv V_ASN1_SET Ta 0 | ||
257 | .It Dv V_ASN1_T61STRING Ta Dv B_ASN1_T61STRING | ||
258 | .It Dv V_ASN1_TELETEXSTRING Ta Dv B_ASN1_TELETEXSTRING | ||
259 | .It Dv V_ASN1_UNDEF Ta 0 | ||
260 | .It Dv V_ASN1_UNIVERSALSTRING Ta Dv B_ASN1_UNIVERSALSTRING | ||
261 | .It Dv V_ASN1_UTCTIME Ta Dv B_ASN1_UTCTIME | ||
262 | .It Dv V_ASN1_UTF8STRING Ta Dv B_ASN1_UTF8STRING | ||
263 | .It Dv V_ASN1_VIDEOTEXSTRING Ta Dv B_ASN1_VIDEOTEXSTRING | ||
264 | .It Dv V_ASN1_VISIBLESTRING Ta Dv B_ASN1_VISIBLESTRING | ||
265 | .It 11, 13, 14, 15, 29 Ta Dv B_ASN1_UNKNOWN | ||
266 | .It Dv other Po < 0, > 30 Pc Ta Dv 0 | ||
267 | .El | ||
268 | .Pp | ||
269 | In typical usage, the calling code calculates the bitwise AND | ||
270 | of the return value and a mask describing data types | ||
271 | that the calling code is willing to use. | ||
272 | If the result of the AND operation is non-zero, the data type is | ||
273 | adequate; otherwise, the calling code may need to raise an error. | ||
228 | .Sh RETURN VALUES | 274 | .Sh RETURN VALUES |
229 | .Fn ASN1_mbstring_copy | 275 | .Fn ASN1_mbstring_copy |
230 | and | 276 | and |
@@ -269,6 +315,11 @@ is invalid. | |||
269 | .Pp | 315 | .Pp |
270 | .Fn ASN1_STRING_get_default_mask | 316 | .Fn ASN1_STRING_get_default_mask |
271 | returns the global mask. | 317 | returns the global mask. |
318 | .Pp | ||
319 | .Fn ASN1_tag2bit | ||
320 | returns a | ||
321 | .Dv B_ASN1_* | ||
322 | constant or 0. | ||
272 | .Sh SEE ALSO | 323 | .Sh SEE ALSO |
273 | .Xr ASN1_PRINTABLE_type 3 , | 324 | .Xr ASN1_PRINTABLE_type 3 , |
274 | .Xr ASN1_STRING_new 3 , | 325 | .Xr ASN1_STRING_new 3 , |
@@ -276,9 +327,19 @@ returns the global mask. | |||
276 | .Xr ASN1_STRING_TABLE_get 3 , | 327 | .Xr ASN1_STRING_TABLE_get 3 , |
277 | .Xr ASN1_UNIVERSALSTRING_to_string 3 | 328 | .Xr ASN1_UNIVERSALSTRING_to_string 3 |
278 | .Sh HISTORY | 329 | .Sh HISTORY |
279 | These functions first appeared in OpenSSL 0.9.5 | 330 | .Fn ASN1_mbstring_copy , |
280 | and have been available since | 331 | .Fn ASN1_mbstring_ncopy , |
332 | .Fn ASN1_STRING_set_by_NID , | ||
333 | .Fn ASN1_STRING_set_default_mask , | ||
334 | .Fn ASN1_STRING_set_default_mask_asc , | ||
335 | and | ||
336 | .Fn ASN1_STRING_get_default_mask | ||
337 | first appeared in OpenSSL 0.9.5 and have been available since | ||
281 | .Ox 2.7 . | 338 | .Ox 2.7 . |
339 | .Pp | ||
340 | .Fn ASN1_tag2bit | ||
341 | first appeared in OpenSSL 0.9.7 and has been available since | ||
342 | .Ox 3.2 . | ||
282 | .Sh BUGS | 343 | .Sh BUGS |
283 | If integer overflow occurs in | 344 | If integer overflow occurs in |
284 | .Fn ASN1_STRING_set_default_mask_asc | 345 | .Fn ASN1_STRING_set_default_mask_asc |