sync code with last improvements from OpenBSD

This commit is contained in:
purplerain 2023-10-02 04:00:10 +00:00
parent 0095d6bf71
commit 4366cfe9ca
Signed by: purplerain
GPG key ID: F42C07F07E2E35B7
20 changed files with 247 additions and 44 deletions

View file

@ -1,4 +1,4 @@
/* $OpenBSD: a_time_tm.c,v 1.30 2023/08/30 10:13:12 job Exp $ */
/* $OpenBSD: a_time_tm.c,v 1.31 2023/10/01 22:14:36 tb Exp $ */
/*
* Copyright (c) 2015 Bob Beck <beck@openbsd.org>
*
@ -503,7 +503,7 @@ ASN1_TIME_compare(const ASN1_TIME *t1, const ASN1_TIME *t2)
if (ASN1_time_parse(t1->data, t1->length, &tm1, t1->type) == -1)
return -2;
if (ASN1_time_parse(t1->data, t2->length, &tm2, t2->type) == -1)
if (ASN1_time_parse(t2->data, t2->length, &tm2, t2->type) == -1)
return -2;
return ASN1_time_tm_cmp(&tm1, &tm2);

View file

@ -1,4 +1,4 @@
.\" $OpenBSD: ASRange_new.3,v 1.6 2023/09/28 12:35:31 tb Exp $
.\" $OpenBSD: ASRange_new.3,v 1.7 2023/10/01 05:20:41 tb Exp $
.\"
.\" Copyright (c) 2023 Theo Buehler <tb@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: September 28 2023 $
.Dd $Mdocdate: October 1 2023 $
.Dt ASRANGE_NEW 3
.Os
.Sh NAME
@ -328,7 +328,7 @@ object or
.Dv NULL
if an error occurs.
.Pp
The encoding functions
The decoding functions
.Fn d2i_ASRange ,
.Fn d2i_ASIdOrRange ,
and

View file

@ -1,4 +1,4 @@
.\" $OpenBSD: EVP_CIPHER_CTX_ctrl.3,v 1.1 2023/08/31 17:27:41 schwarze Exp $
.\" $OpenBSD: EVP_CIPHER_CTX_ctrl.3,v 1.2 2023/10/01 18:23:50 tb Exp $
.\" full merge up to: OpenSSL 5211e094 Nov 11 14:39:11 2014 -0800
.\"
.\" This file is a derived work.
@ -67,7 +67,7 @@
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
.\" OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
.Dd $Mdocdate: August 31 2023 $
.Dd $Mdocdate: October 1 2023 $
.Dt EVP_CIPHER_CTX_CTRL 3
.Os
.Sh NAME
@ -178,7 +178,9 @@ return the IV length of a cipher when passed an
.Vt EVP_CIPHER_CTX
or
.Vt EVP_CIPHER .
It will return zero if the cipher does not use an IV.
They will return zero if the cipher does not use an IV.
.Fn EVP_CIPHER_CTX_iv_length
can fail and return \-1.
The constant
.Dv EVP_MAX_IV_LENGTH
is the maximum IV length for all ciphers.
@ -220,6 +222,8 @@ return the key length.
and
.Fn EVP_CIPHER_iv_length
return the IV length or zero if the cipher does not use an IV.
.Fn EVP_CIPHER_CTX_iv_length
can fail and return \-1.
.Sh SEE ALSO
.Xr evp 3 ,
.Xr EVP_CIPHER_nid 3 ,

View file

@ -1,4 +1,4 @@
.\" $OpenBSD: IPAddressRange_new.3,v 1.6 2023/09/30 13:58:29 schwarze Exp $
.\" $OpenBSD: IPAddressRange_new.3,v 1.8 2023/10/01 08:23:58 tb Exp $
.\"
.\" Copyright (c) 2023 Theo Buehler <tb@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: September 30 2023 $
.Dd $Mdocdate: October 1 2023 $
.Dt IPADDRESSRANGE_NEW 3
.Os
.Sh NAME
@ -113,7 +113,8 @@ ASN.1 BIT STRING of bit size 32 or 128 bits, respectively.
The bit size of a prefix is its prefix length;
all insignificant zero bits are omitted
from the encoding.
An address range is expressed as a pair of BIT STRINGs
Per section 2.1.2,
an address range is expressed as a pair of BIT STRINGs
where all the least significant zero bits of the lower bound
and all the least significant one bits of the upper bound are omitted.
.Pp
@ -162,7 +163,7 @@ object with allocated, empty
.Fa min
and
.Fa max ,
thus representing the entire address space.
thus representing the entire address space invalidly as a non-prefix.
.Pp
.Fn IPAddressRange_free
frees
@ -469,6 +470,10 @@ or a value <= 0 if an error occurs.
RFC 3779: X.509 Extensions for IP Addresses and AS Identifiers:
.Bl -dash -compact
.It
section 2.1.1: Encoding of an IP Address or Prefix
.It
section 2.1.2: Encoding of a Range of IP Addresses
.It
section 2.2.3: Syntax
.It
section 2.2.3.1: Type IPAddrBlocks

View file

@ -1,4 +1,4 @@
.\" $OpenBSD: X509v3_addr_add_inherit.3,v 1.9 2023/09/30 16:01:18 tb Exp $
.\" $OpenBSD: X509v3_addr_add_inherit.3,v 1.11 2023/10/01 22:46:21 tb Exp $
.\"
.\" Copyright (c) 2023 Theo Buehler <tb@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: September 30 2023 $
.Dd $Mdocdate: October 1 2023 $
.Dt X509V3_ADDR_ADD_INHERIT 3
.Os
.Sh NAME
@ -271,7 +271,7 @@ Construct the first extension from RFC 3779, Appendix B.
#include <openssl/x509.h>
#include <openssl/x509v3.h>
const char *prefixes[6] = {
const char *prefixes[] = {
"10.0.32/20", "10.0.64/24", "10.1/16",
"10.2.48/20", "10.2.64/24", "10.3/16",
};
@ -339,7 +339,7 @@ main(void)
if (!X509v3_addr_canonize(addrblocks))
errx(1, "X509v3_addr_canonize");
/* Create the extension. The 1 indicates that it is critical. */
/* Create the extension with the correct OID; mark it critical. */
ext = X509V3_EXT_i2d(NID_sbgp_ipAddrBlock, 1, addrblocks);
if (ext == NULL)
errx(1, "X509V3_EXT_i2d");

View file

@ -1,4 +1,4 @@
.\" $OpenBSD: s2i_ASN1_INTEGER.3,v 1.5 2023/05/12 08:12:09 tb Exp $
.\" $OpenBSD: s2i_ASN1_INTEGER.3,v 1.6 2023/10/01 10:51:19 tb Exp $
.\"
.\" Copyright (c) 2023 Theo Buehler <tb@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: May 12 2023 $
.Dd $Mdocdate: October 1 2023 $
.Dt I2S_ASN1_INTEGER 3
.Os
.Sh NAME
@ -122,8 +122,8 @@ is then obtained with
.Fn i2s_ASN1_OCTET_STRING
converts the octets in
.Fa aos
into a string where the octets are represented by pairs of colon-separated
hexadecimal digits.
into a string where the octets are colon-separated and
represented as pairs of uppercase hexadecimal digits.
.Pp
.Fn s2i_ASN1_OCTET_STRING
converts the NUL-terminated string
@ -196,6 +196,7 @@ Error codes can sometimes be obtained by
.Xr ASN1_INTEGER_new 3 ,
.Xr ASN1_INTEGER_to_BN 3 ,
.Xr ASN1_OCTET_STRING_new 3 ,
.Xr crypto 3 ,
.Xr X509V3_get_d2i 3
.Sh HISTORY
These functions first appeared in OpenSSL 0.9.4 and