This commit is contained in:
purplerain 2023-07-10 00:10:46 +00:00
parent 2a351e0cdc
commit f57be82572
Signed by: purplerain
GPG key ID: F42C07F07E2E35B7
704 changed files with 20524 additions and 10572 deletions

View file

@ -1,119 +0,0 @@
.\" $OpenBSD: ASN1_bn_print.3,v 1.2 2022/12/14 20:27:28 schwarze Exp $
.\"
.\" Copyright (c) 2021 Ingo Schwarze <schwarze@openbsd.org>
.\"
.\" Permission to use, copy, modify, and distribute this software for any
.\" purpose with or without fee is hereby granted, provided that the above
.\" copyright notice and this permission notice appear in all copies.
.\"
.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
.Dd $Mdocdate: December 14 2022 $
.Dt ASN1_BN_PRINT 3
.Os
.Sh NAME
.Nm ASN1_bn_print
.Nd pretty-print a BIGNUM object
.Sh SYNOPSIS
.In openssl/asn1.h
.Ft int
.Fo ASN1_bn_print
.Fa "BIO *bio_out"
.Fa "const char *label"
.Fa "const BIGNUM *bn"
.Fa "unsigned char *buffer"
.Fa "int indent"
.Fc
.Sh DESCRIPTION
.Fn ASN1_bn_print
prints
.Fa bn
to
.Fa bio_out
in human-readable form.
Despite its name and the header file,
this function has nothing to do with ASN.1.
.Pp
The caller is responsible for providing a
.Fa buffer
that is at least
.Fn BN_num_bytes bn
+ 1 bytes long.
To avoid a buffer overrun, be careful to not forget the
.Dq plus one .
It is unspecified what the buffer may contain after the function returns.
.Pp
If
.Fa indent
is greater than zero,
.Fa indent
space characters are printed first, but not more than 128.
.Pp
The NUL-terminated
.Fa label
is printed next.
.Pp
After that, there are three cases:
.Bl -bullet
.It
If
.Fa bn
represents the number zero,
.Qq 0
is printed.
.It
If
.Fa bn
can be represented by the data type
.Vt unsigned long ,
it is printed in decimal notation,
followed by hexadecimal notation in parentheses,
both optionally preceded by a minus sign.
.It
Otherwise, the string
.Qq Pq Negative
is printed if appropriate, a new output line is started,
and the indentation is increased by four space characters.
The bytes of the value of
.Fa bn
are then printed in big-endian order, each byte represented
by a two-digit hexadecimal number,
and each but the last byte followed by a colon.
A new output line is started after every group of 15 bytes.
.El
.Pp
Finally, a newline character is printed to end the output.
.Pp
If
.Fa bn
is a
.Dv NULL
pointer, all arguments are ignored and nothing is printed.
.Sh RETURN VALUES
.Fn ASN1_bn_print
returns 1
if successful or if
.Fa bn
is a
.Dv NULL
pointer.
It returns 0 if printing fails.
.Sh SEE ALSO
.Xr ASN1_buf_print 3 ,
.Xr BIO_new 3 ,
.Xr BIO_write 3 ,
.Xr BN_is_negative 3 ,
.Xr BN_is_zero 3 ,
.Xr BN_new 3 ,
.Xr BN_num_bytes 3 ,
.Xr BN_print 3
.Sh HISTORY
.Fn ASN1_bn_print
first appeared in OpenSSL 1.0.0 and has been available since
.Ox 4.9 .

View file

@ -1,4 +1,4 @@
.\" $OpenBSD: ASN1_buf_print.3,v 1.1 2022/12/14 20:27:28 schwarze Exp $
.\" $OpenBSD: ASN1_buf_print.3,v 1.2 2023/07/09 06:45:03 tb Exp $
.\"
.\" Copyright (c) 2022 Ingo Schwarze <schwarze@openbsd.org>
.\"
@ -14,7 +14,7 @@
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
.Dd $Mdocdate: December 14 2022 $
.Dd $Mdocdate: July 9 2023 $
.Dt ASN1_BUF_PRINT 3
.Os
.Sh NAME
@ -58,7 +58,6 @@ space characters, but not by more than 64 characters.
.Fn ASN1_buf_print
returns 1 if successful or 0 if printing fails.
.Sh SEE ALSO
.Xr ASN1_bn_print 3 ,
.Xr ASN1_item_print 3 ,
.Xr ASN1_STRING_print_ex 3 ,
.Xr ASN1_TIME_print 3 ,

View file

@ -1,4 +1,4 @@
.\" $OpenBSD: BN_bn2bin.3,v 1.15 2021/12/08 21:52:29 schwarze Exp $
.\" $OpenBSD: BN_bn2bin.3,v 1.16 2023/07/09 06:45:03 tb Exp $
.\" full merge up to: OpenSSL 24a535ea Sep 22 13:14:20 2020 +0100
.\"
.\" This file was written by Ulf Moeller <ulf@openssl.org>
@ -49,7 +49,7 @@
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
.\" OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
.Dd $Mdocdate: December 8 2021 $
.Dd $Mdocdate: July 9 2023 $
.Dt BN_BN2BIN 3
.Os
.Sh NAME
@ -353,7 +353,6 @@ on error.
The error codes can be obtained by
.Xr ERR_get_error 3 .
.Sh SEE ALSO
.Xr ASN1_bn_print 3 ,
.Xr ASN1_INTEGER_to_BN 3 ,
.Xr BN_new 3 ,
.Xr BN_num_bytes 3 ,

View file

@ -1,4 +1,4 @@
.\" $OpenBSD: BN_new.3,v 1.27 2023/04/28 16:39:19 schwarze Exp $
.\" $OpenBSD: BN_new.3,v 1.28 2023/07/09 06:45:03 tb Exp $
.\" full merge up to: OpenSSL man3/BN_new 2457c19d Mar 6 08:43:36 2004 +0000
.\" selective merge up to: man3/BN_new 681acb31 Sep 29 13:10:34 2017 +0200
.\" full merge up to: OpenSSL man7/bn 05ea606a May 20 20:52:46 2016 -0400
@ -50,7 +50,7 @@
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
.\" OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
.Dd $Mdocdate: April 28 2023 $
.Dd $Mdocdate: July 9 2023 $
.Dt BN_NEW 3
.Os
.Sh NAME
@ -133,7 +133,6 @@ If the allocation fails, it returns
and sets an error code that can be obtained by
.Xr ERR_get_error 3 .
.Sh SEE ALSO
.Xr ASN1_bn_print 3 ,
.Xr BN_add 3 ,
.Xr BN_add_word 3 ,
.Xr BN_BLINDING_new 3 ,

View file

@ -0,0 +1,292 @@
.\" $OpenBSD: EVP_MD_meth_new.3,v 1.2 2023/07/09 06:47:51 tb Exp $
.\" selective merge up to:
.\" OpenSSL man3/EVP_MD_meth_new 0388d212 Dec 14 12:47:07 2018 -0800
.\"
.\" This file was written by Richard Levitte <levitte@openssl.org>
.\" Copyright (c) 2015 The OpenSSL Project. All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\"
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\"
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in
.\" the documentation and/or other materials provided with the
.\" distribution.
.\"
.\" 3. All advertising materials mentioning features or use of this
.\" software must display the following acknowledgment:
.\" "This product includes software developed by the OpenSSL Project
.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
.\"
.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
.\" endorse or promote products derived from this software without
.\" prior written permission. For written permission, please contact
.\" openssl-core@openssl.org.
.\"
.\" 5. Products derived from this software may not be called "OpenSSL"
.\" nor may "OpenSSL" appear in their names without prior written
.\" permission of the OpenSSL Project.
.\"
.\" 6. Redistributions of any form whatsoever must retain the following
.\" acknowledgment:
.\" "This product includes software developed by the OpenSSL Project
.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
.\" OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
.Dd $Mdocdate: July 9 2023 $
.Dt EVP_MD_METH_NEW 3
.Os
.Sh NAME
.Nm EVP_MD_meth_dup ,
.Nm EVP_MD_meth_new ,
.Nm EVP_MD_meth_free ,
.Nm EVP_MD_meth_set_input_blocksize ,
.Nm EVP_MD_meth_set_result_size ,
.Nm EVP_MD_meth_set_app_datasize ,
.Nm EVP_MD_meth_set_flags ,
.Nm EVP_MD_meth_set_init ,
.Nm EVP_MD_meth_set_update ,
.Nm EVP_MD_meth_set_final ,
.Nm EVP_MD_meth_set_copy ,
.Nm EVP_MD_meth_set_cleanup ,
.Nm EVP_MD_meth_set_ctrl
.Nd Routines to build up EVP_MD methods
.Sh SYNOPSIS
.In openssl/evp.h
.Ft EVP_MD *
.Fo EVP_MD_meth_new
.Fa "int md_type"
.Fa "int pkey_type"
.Fc
.Ft void
.Fo EVP_MD_meth_free
.Fa "EVP_MD *md"
.Fc
.Ft EVP_MD *
.Fo EVP_MD_meth_dup
.Fa "const EVP_MD *md"
.Fc
.Ft int
.Fo EVP_MD_meth_set_input_blocksize
.Fa "EVP_MD *md"
.Fa "int blocksize"
.Fc
.Ft int
.Fo EVP_MD_meth_set_result_size
.Fa "EVP_MD *md"
.Fa "int resultsize"
.Fc
.Ft int
.Fo EVP_MD_meth_set_app_datasize
.Fa "EVP_MD *md"
.Fa "int datasize"
.Fc
.Ft int
.Fo EVP_MD_meth_set_flags
.Fa "EVP_MD *md"
.Fa "unsigned long flags"
.Fc
.Ft int
.Fo EVP_MD_meth_set_init
.Fa "EVP_MD *md"
.Fa "int (*init)(EVP_MD_CTX *ctx)"
.Fc
.Ft int
.Fo EVP_MD_meth_set_update
.Fa "EVP_MD *md"
.Fa "int (*update)(EVP_MD_CTX *ctx, const void *data, size_t count)"
.Fc
.Ft int
.Fo EVP_MD_meth_set_final
.Fa "EVP_MD *md"
.Fa "int (*final)(EVP_MD_CTX *ctx, unsigned char *md)"
.Fc
.Ft int
.Fo EVP_MD_meth_set_copy
.Fa "EVP_MD *md"
.Fa "int (*copy)(EVP_MD_CTX *to, const EVP_MD_CTX *from)"
.Fc
.Ft int
.Fo EVP_MD_meth_set_cleanup
.Fa "EVP_MD *md"
.Fa "int (*cleanup)(EVP_MD_CTX *ctx)"
.Fc
.Ft int
.Fo EVP_MD_meth_set_ctrl
.Fa "EVP_MD *md"
.Fa "int (*ctrl)(EVP_MD_CTX *ctx, int cmd, int p1, void *p2)"
.Fc
.Sh DESCRIPTION
The
.Vt EVP_MD
type is a structure for digest method implementation.
It can also have associated public/private key signing and verifying
routines.
.Pp
.Fn EVP_MD_meth_new
creates a new
.Vt EVP_MD
structure.
.Pp
.Fn EVP_MD_meth_dup
creates a copy of
.Fa md .
.Pp
.Fn EVP_MD_meth_free
destroys a
.Vt EVP_MD
structure.
.Pp
.Fn EVP_MD_meth_set_input_blocksize
sets the internal input block size for the method
.Fa md
to
.Fa blocksize
bytes.
.Pp
.Fn EVP_MD_meth_set_result_size
sets the size of the result that the digest method in
.Fa md
is expected to produce to
.Fa resultsize
bytes.
.Pp
The digest method may have its own private data, which OpenSSL will
allocate for it.
.Fn EVP_MD_meth_set_app_datasize
should be used to set the size for it to
.Fa datasize .
.Pp
.Fn EVP_MD_meth_set_flags
sets the flags to describe optional behaviours in the particular
.Fa md .
Several flags can be or'd together.
The available flags are:
.Bl -tag -width Ds
.It EVP_MD_FLAG_ONESHOT
This digest method can only handle one block of input.
.It EVP_MD_FLAG_DIGALGID_NULL
When setting up a DigestAlgorithmIdentifier, this flag will have the
parameter set to NULL by default.
Use this for PKCS#1.
.Em Note: if combined with EVP_MD_FLAG_DIGALGID_ABSENT, the latter will override.
.It EVP_MD_FLAG_DIGALGID_ABSENT
When setting up a DigestAlgorithmIdentifier, this flag will have the
parameter be left absent by default.
.Em Note: if combined with EVP_MD_FLAG_DIGALGID_NULL, the latter will be overridden.
.It EVP_MD_FLAG_DIGALGID_CUSTOM
Custom DigestAlgorithmIdentifier handling via ctrl, with
.Sy EVP_MD_FLAG_DIGALGID_ABSENT
as default.
.Em Note: if combined with EVP_MD_FLAG_DIGALGID_NULL, the latter will be overridden.
Currently unused.
.It EVP_MD_FLAG_FIPS
This digest method is suitable for use in FIPS mode.
Currently unused.
.El
.Pp
.Fn EVP_MD_meth_set_init
sets the digest init function for
.Fa md .
The digest init function is called by
.Xr EVP_Digest 3 ,
.Xr EVP_DigestInit 3 ,
.Xr EVP_DigestInit_ex 3 ,
EVP_SignInit,
.Xr EVP_SignInit_ex 3 ,
.Xr EVP_VerifyInit 3
and
.Xr EVP_VerifyInit_ex 3 .
.Pp
.Fn EVP_MD_meth_set_update
sets the digest update function for
.Fa md .
The digest update function is called by
.Xr EVP_Digest 3 ,
.Xr EVP_DigestUpdate 3
and
.Xr EVP_SignUpdate 3 .
.Pp
.Fn EVP_MD_meth_set_final
sets the digest final function for
.Fa md .
The digest final function is called by
.Xr EVP_Digest 3 ,
.Xr EVP_DigestFinal 3 ,
.Xr EVP_DigestFinal_ex 3 ,
.Xr EVP_SignFinal 3
and
.Xr EVP_VerifyFinal 3 .
.Pp
.Fn EVP_MD_meth_set_copy
sets the function for
.Fa md
to do extra computations after the method's private data structure has
been copied from one
.Vt EVP_MD_CTX
object to another.
If all that's needed is to copy the data, there is no need for this copy
function.
The copy function is passed two
.Vt EVP_MD_CTX
objects, the private data structure is then available with
.Xr EVP_MD_CTX_md_data 3 .
This copy function is called by
.Xr EVP_MD_CTX_copy 3
and
.Xr EVP_MD_CTX_copy_ex 3 .
.Pp
.Fn EVP_MD_meth_set_cleanup
sets the function for
.Fa md
to do extra cleanup before the method's private data structure is
cleaned out and freed.
The cleanup function is passed an
.Vt EVP_MD_CTX
object, the private data structure is then available with
.Xr EVP_MD_CTX_md_data 3 .
This cleanup function is called by
.Xr EVP_MD_CTX_reset 3
and
.Xr EVP_MD_CTX_free 3 .
.Pp
.Fn EVP_MD_meth_set_ctrl
sets the control function for
.Fa md .
See
.Xr EVP_MD_CTX_ctrl 3
for the available controls.
.Sh RETURN VALUES
.Fn EVP_MD_meth_new
and
.Fn EVP_MD_meth_dup
return a pointer to a newly created
.Vt EVP_MD ,
or NULL on failure.
All
.Fn EVP_MD_meth_set_*
functions return 1.
.Sh SEE ALSO
.Xr EVP_DigestInit 3 ,
.Xr EVP_SignInit 3 ,
.Xr EVP_VerifyInit 3
.Sh HISTORY
All these functions
first appeared in OpenSSL 1.1.0 and have been available since
.Ox 7.1 .

View file

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.251 2023/05/01 07:28:11 tb Exp $
# $OpenBSD: Makefile,v 1.253 2023/07/09 06:45:03 tb Exp $
.include <bsd.own.mk>
@ -18,7 +18,6 @@ MAN= \
ASN1_TIME_set.3 \
ASN1_TYPE_get.3 \
ASN1_UNIVERSALSTRING_to_string.3 \
ASN1_bn_print.3 \
ASN1_buf_print.3 \
ASN1_generate_nconf.3 \
ASN1_get_object.3 \
@ -174,6 +173,7 @@ MAN= \
EVP_DigestVerifyInit.3 \
EVP_EncodeInit.3 \
EVP_EncryptInit.3 \
EVP_MD_meth_new.3 \
EVP_OpenInit.3 \
EVP_PKCS82PKEY.3 \
EVP_PKEY_CTX_ctrl.3 \

View file

@ -1,4 +1,4 @@
.\" $OpenBSD: evp.3,v 1.14 2019/08/25 17:08:20 schwarze Exp $
.\" $OpenBSD: evp.3,v 1.15 2023/07/09 06:49:25 tb Exp $
.\" OpenSSL a9c85cea Nov 11 09:33:55 2016 +0100
.\"
.\" This file was written by Ulf Moeller <ulf@openssl.org>,
@ -51,7 +51,7 @@
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
.\" OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
.Dd $Mdocdate: August 25 2019 $
.Dd $Mdocdate: July 9 2023 $
.Dt EVP 3
.Os
.Sh NAME
@ -192,6 +192,7 @@ operations are more efficient using the high level interfaces.
.Xr EVP_DigestSignInit 3 ,
.Xr EVP_EncodeInit 3 ,
.Xr EVP_EncryptInit 3 ,
.Xr EVP_MD_meth_new 3 ,
.Xr EVP_OpenInit 3 ,
.Xr EVP_PKEY_decrypt 3 ,
.Xr EVP_PKEY_derive 3 ,