diff options
Diffstat (limited to 'src/lib/libcrypto/man')
| -rw-r--r-- | src/lib/libcrypto/man/ASN1_bn_print.3 | 118 | ||||
| -rw-r--r-- | src/lib/libcrypto/man/BN_bn2bin.3 | 5 | ||||
| -rw-r--r-- | src/lib/libcrypto/man/BN_new.3 | 5 | ||||
| -rw-r--r-- | src/lib/libcrypto/man/Makefile | 3 |
4 files changed, 126 insertions, 5 deletions
diff --git a/src/lib/libcrypto/man/ASN1_bn_print.3 b/src/lib/libcrypto/man/ASN1_bn_print.3 new file mode 100644 index 0000000000..75944917de --- /dev/null +++ b/src/lib/libcrypto/man/ASN1_bn_print.3 | |||
| @@ -0,0 +1,118 @@ | |||
| 1 | .\" $OpenBSD: ASN1_bn_print.3,v 1.1 2021/12/08 21:52:29 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: December 8 2021 $ | ||
| 18 | .Dt ASN1_BN_PRINT 3 | ||
| 19 | .Os | ||
| 20 | .Sh NAME | ||
| 21 | .Nm ASN1_bn_print | ||
| 22 | .Nd pretty-print a BIGNUM object | ||
| 23 | .Sh SYNOPSIS | ||
| 24 | .In openssl/asn1.h | ||
| 25 | .Ft int | ||
| 26 | .Fo ASN1_bn_print | ||
| 27 | .Fa "BIO *bio_out" | ||
| 28 | .Fa "const char *label" | ||
| 29 | .Fa "const BIGNUM *bn" | ||
| 30 | .Fa "unsigned char *buffer" | ||
| 31 | .Fa "int indent" | ||
| 32 | .Fc | ||
| 33 | .Sh DESCRIPTION | ||
| 34 | .Fn ASN1_bn_print | ||
| 35 | prints | ||
| 36 | .Fa bn | ||
| 37 | to | ||
| 38 | .Fa bio_out | ||
| 39 | in human-readable form. | ||
| 40 | Despite its name and the header file, | ||
| 41 | this function has nothing to do with ASN.1. | ||
| 42 | .Pp | ||
| 43 | The caller is responsible for providing a | ||
| 44 | .Fa buffer | ||
| 45 | that is at least | ||
| 46 | .Fn BN_num_bytes bn | ||
| 47 | + 1 bytes long. | ||
| 48 | To avoid a buffer overrun, be careful to not forget the | ||
| 49 | .Dq plus one . | ||
| 50 | It is unspecified what the buffer may contain after the function returns. | ||
| 51 | .Pp | ||
| 52 | If | ||
| 53 | .Fa indent | ||
| 54 | is greater than zero, | ||
| 55 | .Fa indent | ||
| 56 | space characters are printed first, but not more than 128. | ||
| 57 | .Pp | ||
| 58 | The NUL-terminated | ||
| 59 | .Fa label | ||
| 60 | is printed next. | ||
| 61 | .Pp | ||
| 62 | After that, there are three cases: | ||
| 63 | .Bl -bullet | ||
| 64 | .It | ||
| 65 | If | ||
| 66 | .Fa bn | ||
| 67 | represents the number zero, | ||
| 68 | .Qq 0 | ||
| 69 | is printed. | ||
| 70 | .It | ||
| 71 | If | ||
| 72 | .Fa bn | ||
| 73 | can be represented by the data type | ||
| 74 | .Vt unsigned long , | ||
| 75 | it is printed in decimal notation, | ||
| 76 | followed by hexadecimal notation in parentheses, | ||
| 77 | both optionally preceded by a minus sign. | ||
| 78 | .It | ||
| 79 | Otherwise, the string | ||
| 80 | .Qq Pq Negative | ||
| 81 | is printed if appropriate, a new output line is started, | ||
| 82 | and the indentation is increased by four space characters. | ||
| 83 | The bytes of the value of | ||
| 84 | .Fa bn | ||
| 85 | are then printed in big-endian order, each byte represented | ||
| 86 | by a two-digit hexadecimal number, | ||
| 87 | and each but the last byte followed by a colon. | ||
| 88 | A new output line is started after every group of 15 bytes. | ||
| 89 | .El | ||
| 90 | .Pp | ||
| 91 | Finally, a newline character is printed to end the output. | ||
| 92 | .Pp | ||
| 93 | If | ||
| 94 | .Fa bn | ||
| 95 | is a | ||
| 96 | .Dv NULL | ||
| 97 | pointer, all arguments are ignored and nothing is printed. | ||
| 98 | .Sh RETURN VALUES | ||
| 99 | .Fn ASN1_bn_print | ||
| 100 | returns 1 | ||
| 101 | if successful or if | ||
| 102 | .Fa bn | ||
| 103 | is a | ||
| 104 | .Dv NULL | ||
| 105 | pointer. | ||
| 106 | It returns 0 if printing fails. | ||
| 107 | .Sh SEE ALSO | ||
| 108 | .Xr BIO_new 3 , | ||
| 109 | .Xr BIO_write 3 , | ||
| 110 | .Xr BN_is_negative 3 , | ||
| 111 | .Xr BN_is_zero 3 , | ||
| 112 | .Xr BN_new 3 , | ||
| 113 | .Xr BN_num_bytes 3 , | ||
| 114 | .Xr BN_print 3 | ||
| 115 | .Sh HISTORY | ||
| 116 | .Fn ASN1_bn_print | ||
| 117 | first appeared in OpenSSL 1.0.0 and has been available since | ||
| 118 | .Ox 4.9 . | ||
diff --git a/src/lib/libcrypto/man/BN_bn2bin.3 b/src/lib/libcrypto/man/BN_bn2bin.3 index 48d350ab48..ec69909d9d 100644 --- a/src/lib/libcrypto/man/BN_bn2bin.3 +++ b/src/lib/libcrypto/man/BN_bn2bin.3 | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | .\" $OpenBSD: BN_bn2bin.3,v 1.14 2021/09/11 08:45:47 schwarze Exp $ | 1 | .\" $OpenBSD: BN_bn2bin.3,v 1.15 2021/12/08 21:52:29 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 was written by Ulf Moeller <ulf@openssl.org> | 4 | .\" This file was written by Ulf Moeller <ulf@openssl.org> |
| @@ -49,7 +49,7 @@ | |||
| 49 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | 49 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED |
| 50 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. | 50 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. |
| 51 | .\" | 51 | .\" |
| 52 | .Dd $Mdocdate: September 11 2021 $ | 52 | .Dd $Mdocdate: December 8 2021 $ |
| 53 | .Dt BN_BN2BIN 3 | 53 | .Dt BN_BN2BIN 3 |
| 54 | .Os | 54 | .Os |
| 55 | .Sh NAME | 55 | .Sh NAME |
| @@ -353,6 +353,7 @@ on error. | |||
| 353 | The error codes can be obtained by | 353 | The error codes can be obtained by |
| 354 | .Xr ERR_get_error 3 . | 354 | .Xr ERR_get_error 3 . |
| 355 | .Sh SEE ALSO | 355 | .Sh SEE ALSO |
| 356 | .Xr ASN1_bn_print 3 , | ||
| 356 | .Xr ASN1_INTEGER_to_BN 3 , | 357 | .Xr ASN1_INTEGER_to_BN 3 , |
| 357 | .Xr BN_new 3 , | 358 | .Xr BN_new 3 , |
| 358 | .Xr BN_num_bytes 3 , | 359 | .Xr BN_num_bytes 3 , |
diff --git a/src/lib/libcrypto/man/BN_new.3 b/src/lib/libcrypto/man/BN_new.3 index bb637a974f..ada4acf175 100644 --- a/src/lib/libcrypto/man/BN_new.3 +++ b/src/lib/libcrypto/man/BN_new.3 | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | .\" $OpenBSD: BN_new.3,v 1.16 2019/06/10 09:49:48 schwarze Exp $ | 1 | .\" $OpenBSD: BN_new.3,v 1.17 2021/12/08 21:52:29 schwarze Exp $ |
| 2 | .\" full merge up to: OpenSSL man3/BN_new 2457c19d Mar 6 08:43:36 2004 +0000 | 2 | .\" full merge up to: OpenSSL man3/BN_new 2457c19d Mar 6 08:43:36 2004 +0000 |
| 3 | .\" selective merge up to: man3/BN_new 681acb31 Sep 29 13:10:34 2017 +0200 | 3 | .\" selective merge up to: man3/BN_new 681acb31 Sep 29 13:10:34 2017 +0200 |
| 4 | .\" full merge up to: OpenSSL man7/bn 05ea606a May 20 20:52:46 2016 -0400 | 4 | .\" full merge up to: OpenSSL man7/bn 05ea606a May 20 20:52:46 2016 -0400 |
| @@ -50,7 +50,7 @@ | |||
| 50 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | 50 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED |
| 51 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. | 51 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. |
| 52 | .\" | 52 | .\" |
| 53 | .Dd $Mdocdate: June 10 2019 $ | 53 | .Dd $Mdocdate: December 8 2021 $ |
| 54 | .Dt BN_NEW 3 | 54 | .Dt BN_NEW 3 |
| 55 | .Os | 55 | .Os |
| 56 | .Sh NAME | 56 | .Sh NAME |
| @@ -144,6 +144,7 @@ If the allocation fails, it returns | |||
| 144 | and sets an error code that can be obtained by | 144 | and sets an error code that can be obtained by |
| 145 | .Xr ERR_get_error 3 . | 145 | .Xr ERR_get_error 3 . |
| 146 | .Sh SEE ALSO | 146 | .Sh SEE ALSO |
| 147 | .Xr ASN1_bn_print 3 , | ||
| 147 | .Xr BN_add 3 , | 148 | .Xr BN_add 3 , |
| 148 | .Xr BN_add_word 3 , | 149 | .Xr BN_add_word 3 , |
| 149 | .Xr BN_BLINDING_new 3 , | 150 | .Xr BN_BLINDING_new 3 , |
diff --git a/src/lib/libcrypto/man/Makefile b/src/lib/libcrypto/man/Makefile index 6d5f8d982b..91c763c8ed 100644 --- a/src/lib/libcrypto/man/Makefile +++ b/src/lib/libcrypto/man/Makefile | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | # $OpenBSD: Makefile,v 1.221 2021/11/27 16:18:03 schwarze Exp $ | 1 | # $OpenBSD: Makefile,v 1.222 2021/12/08 21:52:29 schwarze Exp $ |
| 2 | 2 | ||
| 3 | .include <bsd.own.mk> | 3 | .include <bsd.own.mk> |
| 4 | 4 | ||
| @@ -18,6 +18,7 @@ MAN= \ | |||
| 18 | ASN1_TIME_set.3 \ | 18 | ASN1_TIME_set.3 \ |
| 19 | ASN1_TYPE_get.3 \ | 19 | ASN1_TYPE_get.3 \ |
| 20 | ASN1_UNIVERSALSTRING_to_string.3 \ | 20 | ASN1_UNIVERSALSTRING_to_string.3 \ |
| 21 | ASN1_bn_print.3 \ | ||
| 21 | ASN1_generate_nconf.3 \ | 22 | ASN1_generate_nconf.3 \ |
| 22 | ASN1_get_object.3 \ | 23 | ASN1_get_object.3 \ |
| 23 | ASN1_item_d2i.3 \ | 24 | ASN1_item_d2i.3 \ |
