diff options
| author | schwarze <> | 2021-11-15 13:39:40 +0000 |
|---|---|---|
| committer | schwarze <> | 2021-11-15 13:39:40 +0000 |
| commit | fb0279ca0238f1643dfee5564d637f0a5fb8503d (patch) | |
| tree | 1561d94b29789fc5e6f7d399438fe7621295447d | |
| parent | 5b7600bac0ff06b8e2a2676678971fbf519cba88 (diff) | |
| download | openbsd-fb0279ca0238f1643dfee5564d637f0a5fb8503d.tar.gz openbsd-fb0279ca0238f1643dfee5564d637f0a5fb8503d.tar.bz2 openbsd-fb0279ca0238f1643dfee5564d637f0a5fb8503d.zip | |
document ASN1_PRINTABLE_type(3) and ASN1_UNIVERSALSTRING_to_string(3)
| -rw-r--r-- | src/lib/libcrypto/man/ASN1_PRINTABLE_type.3 | 92 | ||||
| -rw-r--r-- | src/lib/libcrypto/man/ASN1_STRING_length.3 | 8 | ||||
| -rw-r--r-- | src/lib/libcrypto/man/ASN1_STRING_new.3 | 4 | ||||
| -rw-r--r-- | src/lib/libcrypto/man/ASN1_UNIVERSALSTRING_to_string.3 | 64 | ||||
| -rw-r--r-- | src/lib/libcrypto/man/ASN1_mbstring_copy.3 | 8 | ||||
| -rw-r--r-- | src/lib/libcrypto/man/Makefile | 4 |
6 files changed, 172 insertions, 8 deletions
diff --git a/src/lib/libcrypto/man/ASN1_PRINTABLE_type.3 b/src/lib/libcrypto/man/ASN1_PRINTABLE_type.3 new file mode 100644 index 0000000000..391dd32e66 --- /dev/null +++ b/src/lib/libcrypto/man/ASN1_PRINTABLE_type.3 | |||
| @@ -0,0 +1,92 @@ | |||
| 1 | .\" $OpenBSD: ASN1_PRINTABLE_type.3,v 1.1 2021/11/15 13:39:40 schwarze Exp $ | ||
| 2 | .\" | ||
| 3 | .\" Copyright (c) 2021 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: November 15 2021 $ | ||
| 18 | .Dt ASN1_PRINTABLE_TYPE 3 | ||
| 19 | .Os | ||
| 20 | .Sh NAME | ||
| 21 | .Nm ASN1_PRINTABLE_type | ||
| 22 | .Nd classify a single-byte character string | ||
| 23 | .Sh SYNOPSIS | ||
| 24 | .In openssl/asn1.h | ||
| 25 | .Ft int | ||
| 26 | .Fo ASN1_PRINTABLE_type | ||
| 27 | .Fa "const unsigned char *string" | ||
| 28 | .Fa "int len" | ||
| 29 | .Fc | ||
| 30 | .Sh DESCRIPTION | ||
| 31 | .Fn ASN1_PRINTABLE_type | ||
| 32 | assumes that the given | ||
| 33 | .Fa string | ||
| 34 | consists of single-byte characters and classifies it | ||
| 35 | according to which kinds characters occur. | ||
| 36 | If | ||
| 37 | .Fa len | ||
| 38 | is greater than 0, at most | ||
| 39 | .Fa len | ||
| 40 | characters are inspected. | ||
| 41 | Otherwise, the | ||
| 42 | .Fa string | ||
| 43 | needs to be NUL-terminated. | ||
| 44 | .Sh RETURN VALUES | ||
| 45 | If the given | ||
| 46 | .Fa string | ||
| 47 | contains a character outside the | ||
| 48 | .Xr ascii 7 | ||
| 49 | range, | ||
| 50 | .Fn ASN1_PRINTABLE_type | ||
| 51 | returns | ||
| 52 | .Dv V_ASN1_T61STRING . | ||
| 53 | .Pp | ||
| 54 | Otherwise, if it contains a character that is neither a letter | ||
| 55 | nor a digit nor the space character | ||
| 56 | .Po | ||
| 57 | .Ql "\ " , | ||
| 58 | ASCII 0x20 | ||
| 59 | .Pc | ||
| 60 | nor the apostrophe quote | ||
| 61 | .Po | ||
| 62 | .Ql \(aq , | ||
| 63 | ASCII 0x27 | ||
| 64 | .Pc | ||
| 65 | nor contained in the set | ||
| 66 | .Qq ()+,\-./:=?\& , | ||
| 67 | it returns | ||
| 68 | .Dv V_ASN1_IA5STRING . | ||
| 69 | .Pp | ||
| 70 | Otherwise, including if | ||
| 71 | .Fa string | ||
| 72 | is a | ||
| 73 | .Dv NULL | ||
| 74 | pointer or points to an empty string, it returns | ||
| 75 | .Dv V_ASN1_PRINTABLESTRING . | ||
| 76 | .Sh SEE ALSO | ||
| 77 | .Xr ASN1_mbstring_copy 3 , | ||
| 78 | .Xr ASN1_STRING_new 3 , | ||
| 79 | .Xr ASN1_STRING_to_UTF8 3 , | ||
| 80 | .Xr isascii 3 , | ||
| 81 | .Xr ascii 7 | ||
| 82 | .Sh HISTORY | ||
| 83 | .Fn ASN1_PRINTABLE_type | ||
| 84 | first appeared in SSLeay 0.4.5d, has been part of the public API | ||
| 85 | since SSLeay 0.5.1, and has been available since | ||
| 86 | .Ox 2.4 . | ||
| 87 | .Sh CAVEATS | ||
| 88 | The ASN.1 notion of what constitutes a | ||
| 89 | .Vt PrintableString | ||
| 90 | is more restrictive than what the C library function | ||
| 91 | .Xr isprint 3 | ||
| 92 | considers printable. | ||
diff --git a/src/lib/libcrypto/man/ASN1_STRING_length.3 b/src/lib/libcrypto/man/ASN1_STRING_length.3 index e24dd18373..5a113ecb22 100644 --- a/src/lib/libcrypto/man/ASN1_STRING_length.3 +++ b/src/lib/libcrypto/man/ASN1_STRING_length.3 | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | .\" $OpenBSD: ASN1_STRING_length.3,v 1.24 2021/11/14 11:22:36 schwarze Exp $ | 1 | .\" $OpenBSD: ASN1_STRING_length.3,v 1.25 2021/11/15 13:39:40 schwarze Exp $ |
| 2 | .\" full merge up to: OpenSSL 24a535ea Sep 22 13:14:20 2020 +0100 | 2 | .\" full merge up to: OpenSSL 24a535ea Sep 22 13:14:20 2020 +0100 |
| 3 | .\" | 3 | .\" |
| 4 | .\" This file is a derived work. | 4 | .\" This file is a derived work. |
| @@ -66,7 +66,7 @@ | |||
| 66 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | 66 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED |
| 67 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. | 67 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. |
| 68 | .\" | 68 | .\" |
| 69 | .Dd $Mdocdate: November 14 2021 $ | 69 | .Dd $Mdocdate: November 15 2021 $ |
| 70 | .Dt ASN1_STRING_LENGTH 3 | 70 | .Dt ASN1_STRING_LENGTH 3 |
| 71 | .Os | 71 | .Os |
| 72 | .Sh NAME | 72 | .Sh NAME |
| @@ -381,7 +381,9 @@ the reason can be determined with | |||
| 381 | .Xr ERR_get_error 3 . | 381 | .Xr ERR_get_error 3 . |
| 382 | .Sh SEE ALSO | 382 | .Sh SEE ALSO |
| 383 | .Xr ASN1_mbstring_copy 3 , | 383 | .Xr ASN1_mbstring_copy 3 , |
| 384 | .Xr ASN1_STRING_new 3 | 384 | .Xr ASN1_PRINTABLE_type 3 , |
| 385 | .Xr ASN1_STRING_new 3 , | ||
| 386 | .Xr ASN1_UNIVERSALSTRING_to_string 3 | ||
| 385 | .Sh HISTORY | 387 | .Sh HISTORY |
| 386 | .Fn ASN1_STRING_cmp , | 388 | .Fn ASN1_STRING_cmp , |
| 387 | .Fn ASN1_STRING_dup , | 389 | .Fn ASN1_STRING_dup , |
diff --git a/src/lib/libcrypto/man/ASN1_STRING_new.3 b/src/lib/libcrypto/man/ASN1_STRING_new.3 index a2cd27ecb8..23679cdb3c 100644 --- a/src/lib/libcrypto/man/ASN1_STRING_new.3 +++ b/src/lib/libcrypto/man/ASN1_STRING_new.3 | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | .\" $OpenBSD: ASN1_STRING_new.3,v 1.20 2021/11/15 11:51:09 schwarze Exp $ | 1 | .\" $OpenBSD: ASN1_STRING_new.3,v 1.21 2021/11/15 13:39:40 schwarze Exp $ |
| 2 | .\" OpenSSL 99d63d46 Tue Mar 24 07:52:24 2015 -0400 | 2 | .\" OpenSSL 99d63d46 Tue Mar 24 07:52:24 2015 -0400 |
| 3 | .\" | 3 | .\" |
| 4 | .\" Copyright (c) 2017 Ingo Schwarze <schwarze@openbsd.org> | 4 | .\" Copyright (c) 2017 Ingo Schwarze <schwarze@openbsd.org> |
| @@ -206,11 +206,13 @@ is returned and an error code can be retrieved with | |||
| 206 | .Xr ASN1_INTEGER_get 3 , | 206 | .Xr ASN1_INTEGER_get 3 , |
| 207 | .Xr ASN1_item_pack 3 , | 207 | .Xr ASN1_item_pack 3 , |
| 208 | .Xr ASN1_mbstring_copy 3 , | 208 | .Xr ASN1_mbstring_copy 3 , |
| 209 | .Xr ASN1_PRINTABLE_type 3 , | ||
| 209 | .Xr ASN1_STRING_length 3 , | 210 | .Xr ASN1_STRING_length 3 , |
| 210 | .Xr ASN1_STRING_print_ex 3 , | 211 | .Xr ASN1_STRING_print_ex 3 , |
| 211 | .Xr ASN1_time_parse 3 , | 212 | .Xr ASN1_time_parse 3 , |
| 212 | .Xr ASN1_TIME_set 3 , | 213 | .Xr ASN1_TIME_set 3 , |
| 213 | .Xr ASN1_TYPE_get 3 , | 214 | .Xr ASN1_TYPE_get 3 , |
| 215 | .Xr ASN1_UNIVERSALSTRING_to_string 3 , | ||
| 214 | .Xr d2i_ASN1_OBJECT 3 , | 216 | .Xr d2i_ASN1_OBJECT 3 , |
| 215 | .Xr d2i_ASN1_OCTET_STRING 3 , | 217 | .Xr d2i_ASN1_OCTET_STRING 3 , |
| 216 | .Xr i2a_ASN1_STRING 3 , | 218 | .Xr i2a_ASN1_STRING 3 , |
diff --git a/src/lib/libcrypto/man/ASN1_UNIVERSALSTRING_to_string.3 b/src/lib/libcrypto/man/ASN1_UNIVERSALSTRING_to_string.3 new file mode 100644 index 0000000000..2af675295b --- /dev/null +++ b/src/lib/libcrypto/man/ASN1_UNIVERSALSTRING_to_string.3 | |||
| @@ -0,0 +1,64 @@ | |||
| 1 | .\" $OpenBSD: ASN1_UNIVERSALSTRING_to_string.3,v 1.1 2021/11/15 13:39:40 schwarze Exp $ | ||
| 2 | .\" | ||
| 3 | .\" Copyright (c) 2021 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: November 15 2021 $ | ||
| 18 | .Dt ASN1_UNIVERSALSTRING_TO_STRING 3 | ||
| 19 | .Os | ||
| 20 | .Sh NAME | ||
| 21 | .Nm ASN1_UNIVERSALSTRING_to_string | ||
| 22 | .Nd recode UTF-32 to ISO Latin-1 | ||
| 23 | .Sh SYNOPSIS | ||
| 24 | .In openssl/asn1.h | ||
| 25 | .Ft int | ||
| 26 | .Fo ASN1_UNIVERSALSTRING_to_string | ||
| 27 | .Fa "ASN1_UNIVERSALSTRING *string" | ||
| 28 | .Fc | ||
| 29 | .Sh DESCRIPTION | ||
| 30 | .Fn ASN1_UNIVERSALSTRING_to_string | ||
| 31 | assumes that the given | ||
| 32 | .Fa string | ||
| 33 | is encoded in UTF-32, recodes it in place to ISO Latin-1, | ||
| 34 | and changes the type according to | ||
| 35 | .Xr ASN1_PRINTABLE_type 3 . | ||
| 36 | .Pp | ||
| 37 | .Fn ASN1_UNIVERSALSTRING_to_string | ||
| 38 | fails and leaves the | ||
| 39 | .Fa string | ||
| 40 | unchanged if its | ||
| 41 | .Xr ASN1_STRING_type 3 | ||
| 42 | is not | ||
| 43 | .Dv V_ASN1_UNIVERSALSTRING , | ||
| 44 | if its | ||
| 45 | .Xr ASN1_STRING_length 3 | ||
| 46 | is not a multiple of four bytes, | ||
| 47 | or if any of its characters cannot be represented in ISO Latin-1. | ||
| 48 | .Pp | ||
| 49 | In case of success, the | ||
| 50 | .Xr ASN1_STRING_length 3 | ||
| 51 | of the | ||
| 52 | .Fa string | ||
| 53 | is reduced by a factor of four. | ||
| 54 | .Sh RETURN VALUES | ||
| 55 | .Fn ASN1_UNIVERSALSTRING_to_string | ||
| 56 | returns 1 on success or 0 on failure. | ||
| 57 | .Sh SEE ALSO | ||
| 58 | .Xr ASN1_mbstring_copy 3 , | ||
| 59 | .Xr ASN1_STRING_new 3 , | ||
| 60 | .Xr ASN1_STRING_to_UTF8 3 | ||
| 61 | .Sh HISTORY | ||
| 62 | .Fn ASN1_UNIVERSALSTRING_to_string | ||
| 63 | first appeared in SSLeay 0.8.0 and has been available since | ||
| 64 | .Ox 2.4 . | ||
diff --git a/src/lib/libcrypto/man/ASN1_mbstring_copy.3 b/src/lib/libcrypto/man/ASN1_mbstring_copy.3 index ce270c8d5e..b499c3b8b2 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.2 2021/10/20 15:54:21 schwarze Exp $ | 1 | .\" $OpenBSD: ASN1_mbstring_copy.3,v 1.3 2021/11/15 13:39:40 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: October 20 2021 $ | 17 | .Dd $Mdocdate: November 15 2021 $ |
| 18 | .Dt ASN1_MBSTRING_COPY 3 | 18 | .Dt ASN1_MBSTRING_COPY 3 |
| 19 | .Os | 19 | .Os |
| 20 | .Sh NAME | 20 | .Sh NAME |
| @@ -270,9 +270,11 @@ is invalid. | |||
| 270 | .Fn ASN1_STRING_get_default_mask | 270 | .Fn ASN1_STRING_get_default_mask |
| 271 | returns the global mask. | 271 | returns the global mask. |
| 272 | .Sh SEE ALSO | 272 | .Sh SEE ALSO |
| 273 | .Xr ASN1_PRINTABLE_type 3 , | ||
| 273 | .Xr ASN1_STRING_new 3 , | 274 | .Xr ASN1_STRING_new 3 , |
| 274 | .Xr ASN1_STRING_set 3 , | 275 | .Xr ASN1_STRING_set 3 , |
| 275 | .Xr ASN1_STRING_TABLE_get 3 | 276 | .Xr ASN1_STRING_TABLE_get 3 , |
| 277 | .Xr ASN1_UNIVERSALSTRING_to_string 3 | ||
| 276 | .Sh HISTORY | 278 | .Sh HISTORY |
| 277 | These functions first appeared in OpenSSL 0.9.5 | 279 | These functions first appeared in OpenSSL 0.9.5 |
| 278 | and have been available since | 280 | and have been available since |
diff --git a/src/lib/libcrypto/man/Makefile b/src/lib/libcrypto/man/Makefile index ab7740054e..2af6c16657 100644 --- a/src/lib/libcrypto/man/Makefile +++ b/src/lib/libcrypto/man/Makefile | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | # $OpenBSD: Makefile,v 1.213 2021/11/15 11:51:09 schwarze Exp $ | 1 | # $OpenBSD: Makefile,v 1.214 2021/11/15 13:39:40 schwarze Exp $ |
| 2 | 2 | ||
| 3 | .include <bsd.own.mk> | 3 | .include <bsd.own.mk> |
| 4 | 4 | ||
| @@ -7,12 +7,14 @@ MAN= \ | |||
| 7 | AES_encrypt.3 \ | 7 | AES_encrypt.3 \ |
| 8 | ASN1_INTEGER_get.3 \ | 8 | ASN1_INTEGER_get.3 \ |
| 9 | ASN1_OBJECT_new.3 \ | 9 | ASN1_OBJECT_new.3 \ |
| 10 | ASN1_PRINTABLE_type.3 \ | ||
| 10 | ASN1_STRING_TABLE_add.3 \ | 11 | ASN1_STRING_TABLE_add.3 \ |
| 11 | ASN1_STRING_length.3 \ | 12 | ASN1_STRING_length.3 \ |
| 12 | ASN1_STRING_new.3 \ | 13 | ASN1_STRING_new.3 \ |
| 13 | ASN1_STRING_print_ex.3 \ | 14 | ASN1_STRING_print_ex.3 \ |
| 14 | ASN1_TIME_set.3 \ | 15 | ASN1_TIME_set.3 \ |
| 15 | ASN1_TYPE_get.3 \ | 16 | ASN1_TYPE_get.3 \ |
| 17 | ASN1_UNIVERSALSTRING_to_string.3 \ | ||
| 16 | ASN1_generate_nconf.3 \ | 18 | ASN1_generate_nconf.3 \ |
| 17 | ASN1_get_object.3 \ | 19 | ASN1_get_object.3 \ |
| 18 | ASN1_item_d2i.3 \ | 20 | ASN1_item_d2i.3 \ |
