sync code with last fixes and improvements from OpenBSD

This commit is contained in:
purplerain 2023-07-30 17:58:45 +00:00
parent f960599e67
commit 691f97cc10
Signed by: purplerain
GPG key ID: F42C07F07E2E35B7
215 changed files with 1520 additions and 11518 deletions

View file

@ -1,146 +0,0 @@
.\" $OpenBSD: ASN1_BIT_STRING_num_asc.3,v 1.1 2021/11/19 16:00:54 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: November 19 2021 $
.Dt ASN1_BIT_STRING_NUM_ASC 3
.Os
.Sh NAME
.Nm ASN1_BIT_STRING_num_asc ,
.Nm ASN1_BIT_STRING_set_asc ,
.Nm ASN1_BIT_STRING_name_print
.Nd names for individual bits
.Sh SYNOPSIS
.In openssl/asn1.h
.Bd -unfilled
typedef struct {
int bitnum;
const char *lname;
const char *sname;
} BIT_STRING_BITNAME;
.Ed
.Pp
.Ft int
.Fo ASN1_BIT_STRING_num_asc
.Fa "const char *name"
.Fa "BIT_STRING_BITNAME *table"
.Fc
.Ft int
.Fo ASN1_BIT_STRING_set_asc
.Fa "ASN1_BIT_STRING *bitstr"
.Fa "const char *name"
.Fa "int set"
.Fa "BIT_STRING_BITNAME *table"
.Fc
.Ft int
.Fo ASN1_BIT_STRING_name_print
.Fa "BIO *bio"
.Fa "ASN1_BIT_STRING *bitstr"
.Fa "BIT_STRING_BITNAME *table"
.Fa "int indent"
.Fc
.Sh DESCRIPTION
These functions provide access to individual bits of an ASN.1 BIT STRING
based on a
.Fa table
assigning names to individual bits.
The
.Fa table
is a variable-sized array.
Each element contains a long name
.Fa lname
and a short name
.Fa sname
for the bit with the bit number
.Fa bitnum .
The table needs to be terminated with a dummy element containing a
.Dv NULL
pointer in the
.Fa lname
field.
.Pp
.Fn ASN1_BIT_STRING_num_asc
retrieves the
.Fa bitnum
from the first element in the
.Fa table
where at least one of the names matches the
.Fa name
argument in the sense of
.Xr strcmp 3 .
That bit number can then be used for
.Xr ASN1_BIT_STRING_get_bit 3 .
.Pp
.Fn ASN1_BIT_STRING_set_asc
converts the
.Fa name
to a bit number using
.Fn ASN1_BIT_STRING_num_asc
and sets or clears that bit in
.Fa bitstr
according to the
.Fa set
argument, using
.Xr ASN1_BIT_STRING_set_bit 3 .
If
.Fa bitstr
is a
.Dv NULL
pointer, no action occurs.
.Pp
.Fn ASN1_BIT_STRING_name_print
prints a single line of text to the given
.Fa BIO .
The line starts with
.Fa indent
space characters, contains the long names of the bit contained in the
.Fa table
that are set in
.Fa bitstr ,
separated by commas, and ends with a newline character.
If any bits are set in
.Fa bitstr
that have no corresponding entries in the
.Fa table ,
those bits are silently ignored and nothing is printed for them.
.Sh RETURN VALUES
.Fn ASN1_BIT_STRING_num_asc
returns a non-negative bit number or \-1 if the
.Fa name
is not found in the
.Fa table .
.Pp
.Fn ASN1_BIT_STRING_set_asc
returns 1 on success or 0 if the
.Fa name
is not found in the
.Fa table
or if memory allocation fails.
.Pp
.Fn ASN1_BIT_STRING_name_print
is intended to return 1 for success or 0 for failure.
.Sh SEE ALSO
.Xr ASN1_BIT_STRING_new 3 ,
.Xr ASN1_BIT_STRING_set 3 ,
.Xr BIO_new 3 ,
.Xr strcmp 3
.Sh HISTORY
These functions first appeared in OpenSSL 0.9.5
and have been available since
.Ox 2.7 .
.Sh BUGS
.Fn ASN1_BIT_STRING_name_print
ignores all errors and always returns 1,
even if nothing or only part of the desired output was printed.

View file

@ -1,4 +1,4 @@
.\" $OpenBSD: ASN1_BIT_STRING_set.3,v 1.2 2021/11/19 16:00:54 schwarze Exp $
.\" $OpenBSD: ASN1_BIT_STRING_set.3,v 1.4 2023/07/28 05:53:10 tb Exp $
.\"
.\" Copyright (c) 2021 Ingo Schwarze <schwarze@openbsd.org>
.\"
@ -14,14 +14,13 @@
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
.Dd $Mdocdate: November 19 2021 $
.Dd $Mdocdate: July 28 2023 $
.Dt ASN1_BIT_STRING_SET 3
.Os
.Sh NAME
.Nm ASN1_BIT_STRING_set ,
.Nm ASN1_BIT_STRING_set_bit ,
.Nm ASN1_BIT_STRING_get_bit ,
.Nm ASN1_BIT_STRING_check
.Nm ASN1_BIT_STRING_get_bit
.Nd ASN.1 BIT STRING accessors
.Sh SYNOPSIS
.In openssl/asn1.h
@ -42,12 +41,6 @@
.Fa "ASN1_BIT_STRING *bitstr"
.Fa "int bitnumber"
.Fc
.Ft int
.Fo ASN1_BIT_STRING_check
.Fa "ASN1_BIT_STRING *bitstr"
.Fa "const unsigned char *goodbits"
.Fa "int goodbits_len"
.Fc
.Sh DESCRIPTION
.Fn ASN1_BIT_STRING_set
sets the length attribute of
@ -99,21 +92,6 @@ checks that the bit with the given
.Fa bitnumber
is set in
.Fa bitstr .
.Pp
.Fn ASN1_BIT_STRING_check
checks that all bits set in
.Fa bitstr
are also set in
.Fa goodbits .
Expressed symbolically, it evaluates:
.Pp
.D1 Po Fa bitstr No & Pf \(ti Fa goodbits Pc == 0
.Pp
The buffer
.Fa goodbits
is expected to contain
.Fa goodbits_len
bytes.
.Sh RETURN VALUES
.Fn ASN1_BIT_STRING_set
returns 1 on success or 0 if memory allocation fails or if
@ -145,23 +123,8 @@ if
points beyond the last data byte in
.Fa bitstr ,
or if the requested bit is not set.
.Pp
.Fn ASN1_BIT_STRING_check
returns 0
if at least one bit is set in
.Fa bitstr
that is not set in
.Fa goodbits ,
or 1 otherwise.
In particular, it returns 1 if
.Fa bitstr
is
.Dv NULL
or if no bit is set in
.Fa bitstr .
.Sh SEE ALSO
.Xr ASN1_BIT_STRING_new 3 ,
.Xr ASN1_BIT_STRING_num_asc 3 ,
.Xr ASN1_STRING_set 3 ,
.Xr d2i_ASN1_BIT_STRING 3
.Sh HISTORY
@ -173,7 +136,3 @@ and
first appeared in SSLeay 0.9.0.
These functions have been available since
.Ox 2.4 .
.Pp
.Fn ASN1_BIT_STRING_check
first appeared in OpenSSL 1.0.0 and has have been available since
.Ox 4.9 .

View file

@ -1,4 +1,4 @@
.\" $OpenBSD: ASN1_STRING_new.3,v 1.24 2021/12/14 19:36:18 schwarze Exp $
.\" $OpenBSD: ASN1_STRING_new.3,v 1.25 2023/07/28 05:48:33 tb Exp $
.\" OpenSSL 99d63d46 Tue Mar 24 07:52:24 2015 -0400
.\"
.\" Copyright (c) 2017 Ingo Schwarze <schwarze@openbsd.org>
@ -15,7 +15,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 2021 $
.Dd $Mdocdate: July 28 2023 $
.Dt ASN1_STRING_NEW 3
.Os
.Sh NAME
@ -205,7 +205,6 @@ object if successful; otherwise
is returned and an error code can be retrieved with
.Xr ERR_get_error 3 .
.Sh SEE ALSO
.Xr ASN1_BIT_STRING_num_asc 3 ,
.Xr ASN1_BIT_STRING_set 3 ,
.Xr ASN1_INTEGER_get 3 ,
.Xr ASN1_item_pack 3 ,

View file

@ -1,4 +1,4 @@
.\" $OpenBSD: BF_set_key.3,v 1.10 2019/06/06 01:06:58 schwarze Exp $
.\" $OpenBSD: BF_set_key.3,v 1.11 2023/07/29 03:05:35 tb Exp $
.\" OpenSSL 99d63d46 Jul 19 09:27:53 2016 -0400
.\"
.\" This file was written by Richard Levitte <levitte@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: June 6 2019 $
.Dd $Mdocdate: July 29 2023 $
.Dt BF_SET_KEY 3
.Os
.Sh NAME
@ -60,7 +60,6 @@
.Nm BF_cbc_encrypt ,
.Nm BF_cfb64_encrypt ,
.Nm BF_ofb64_encrypt ,
.Nm BF_options
.Nd Blowfish encryption
.Sh SYNOPSIS
.In openssl/blowfish.h
@ -115,10 +114,6 @@
.Fa "unsigned char *ivec"
.Fa "int *num"
.Fc
.Ft const char *
.Fo BF_options
.Fa void
.Fc
.Sh DESCRIPTION
This library implements the Blowfish cipher,
which was invented and defined by
@ -265,9 +260,8 @@ and big-endian on big-endian ones.
.Fn BF_ecb_encrypt ,
.Fn BF_cbc_encrypt ,
.Fn BF_cfb64_encrypt ,
.Fn BF_ofb64_encrypt ,
and
.Fn BF_options
.Fn BF_ofb64_encrypt
first appeared in SSLeay 0.6.6.
.Fn BF_decrypt
first appeared in SSLeay 0.9.0.

View file

@ -1,4 +1,4 @@
.\" $OpenBSD: CRYPTO_set_ex_data.3,v 1.13 2022/03/31 17:27:16 naddy Exp $
.\" $OpenBSD: CRYPTO_set_ex_data.3,v 1.14 2023/07/28 14:34:54 tb Exp $
.\" full merge up to:
.\" OpenSSL CRYPTO_get_ex_new_index 9e183d22 Mar 11 08:56:44 2017 -0500
.\" selective merge up to: 72a7a702 Feb 26 14:05:09 2019 +0000
@ -52,7 +52,7 @@
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
.\" OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
.Dd $Mdocdate: March 31 2022 $
.Dd $Mdocdate: July 28 2023 $
.Dt CRYPTO_SET_EX_DATA 3
.Os
.Sh NAME
@ -161,9 +161,6 @@ retrieved as a
.Vt void *
type.
.Pp
The
.Vt CRYPTO_EX_DATA
type is opaque.
To initialize the exdata part of a structure, call
.Fn CRYPTO_new_ex_data .
.Pp

View file

@ -1,11 +1,10 @@
# $OpenBSD: Makefile,v 1.258 2023/07/26 20:08:59 tb Exp $
# $OpenBSD: Makefile,v 1.259 2023/07/28 05:48:33 tb Exp $
.include <bsd.own.mk>
MAN= \
ACCESS_DESCRIPTION_new.3 \
AES_encrypt.3 \
ASN1_BIT_STRING_num_asc.3 \
ASN1_BIT_STRING_set.3 \
ASN1_INTEGER_get.3 \
ASN1_NULL_new.3 \