openssl.git
19 months agoChecking __STDC_VERSION__ rather than __STRICT_ANSI__
Richard Levitte [Mon, 12 Sep 2022 15:29:53 +0000 (17:29 +0200)]
Checking __STDC_VERSION__ rather than __STRICT_ANSI__

`__STRICT_ANSI__` is a gnuish flag macro that indicates if `-ansi`
was given on the command line.  To check the C version, it's better
to check the macro `__STDC_VERSION__`.

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Todd Short <todd.short@me.com>
(Merged from https://github.com/openssl/openssl/pull/19197)

19 months agoOSSL_CRYPTO_ALLOC attribute introduction proposal.
David Carlier [Thu, 8 Sep 2022 21:16:31 +0000 (22:16 +0100)]
OSSL_CRYPTO_ALLOC attribute introduction proposal.

Giving hint to the compiler the returned pointer is not aliased
 (so realloc-like api is de facto excluded).

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19180)

19 months agoupdate oqsprovider/liboqs to v0.7.2
Michael Baentsch [Fri, 9 Sep 2022 13:43:15 +0000 (15:43 +0200)]
update oqsprovider/liboqs to v0.7.2

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19184)

19 months agoFix PROV_RC5_CTX's original structure name
Paul Yang [Fri, 9 Sep 2022 07:48:24 +0000 (15:48 +0800)]
Fix PROV_RC5_CTX's original structure name

It looks like a typo when copy & pasting the structure from blowfish.

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19186)

19 months agoFix tests when configured with -DOPENSSL_USE_IPV6=0
Tom Cosgrove [Fri, 9 Sep 2022 06:24:48 +0000 (07:24 +0100)]
Fix tests when configured with -DOPENSSL_USE_IPV6=0

In include/internal/sockets.h it says that you can disable IPv6, and only
defines OPENSSL_USE_IPV6 (to 0 or 1) if it's not already defined.

The codebase generally then checks `#if OPENSSL_USE_IPV6`.

However, test_bio_dgram uses `#if defined(OPENSSL_USE_IPV6)` which means it tries
to test IPv6 even if it's explicitly configured out with -DOPENSSL_USE_IPV6=0
(`#if defined(OPENSSL_USE_IPV6)` is always true).

This fixes that.

Change-Id: Ie1641c9dd654f27f3bdca186517df5599ad1059b

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19181)

19 months agolist: add an option to list all available algorithms
Pauli [Thu, 8 Sep 2022 02:54:23 +0000 (12:54 +1000)]
list: add an option to list all available algorithms

Fixes #19145

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/19168)

19 months agocrypto/x509/{x509_req,x_all}.c: add some NULL parameter checks, improve coding style
Dr. David von Oheimb [Mon, 29 Aug 2022 11:59:02 +0000 (13:59 +0200)]
crypto/x509/{x509_req,x_all}.c: add some NULL parameter checks, improve coding style

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19090)

19 months agoX509 x_all.c: Set 'modified' flag when ASN1_item_sign{,_ctx} call was successful
Gibeom Gwon [Sat, 27 Aug 2022 13:29:28 +0000 (22:29 +0900)]
X509 x_all.c: Set 'modified' flag when ASN1_item_sign{,_ctx} call was successful

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
(Merged from https://github.com/openssl/openssl/pull/19090)

19 months agoX509 x509_req.c: Set 'modified' flag when X509_req_info_st member data updated
Gibeom Gwon [Sat, 27 Aug 2022 13:04:38 +0000 (22:04 +0900)]
X509 x509_req.c: Set 'modified' flag when X509_req_info_st member data updated

We need to reencode X509_req_info_st if member data updated.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
(Merged from https://github.com/openssl/openssl/pull/19090)

19 months agoopenssl.cnf: split option value and comment and remove leading space
a1346054 [Thu, 8 Sep 2022 08:11:53 +0000 (08:11 +0000)]
openssl.cnf: split option value and comment and remove leading space

CLA: trivial

Signed-off-by: a1346054 <36859588+a1346054@users.noreply.github.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19173)

19 months agoCleanup EBCDIC string defintions
Todd Short [Thu, 1 Sep 2022 19:31:21 +0000 (15:31 -0400)]
Cleanup EBCDIC string defintions

Use a single definiton for protocol string defintions.

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19122)

19 months agoAdd some API tests for TLSv1.3 record padding
Matt Caswell [Wed, 31 Aug 2022 11:31:24 +0000 (12:31 +0100)]
Add some API tests for TLSv1.3 record padding

We have some ssl_test_new tests for record padding. But these only use
the block padding approach set via a config file on the SSL_CTX. We add
tests for all the various API calls.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19103)

19 months agocrypto/conf: gcc build warning fix
Gang Chen [Wed, 7 Sep 2022 06:31:31 +0000 (14:31 +0800)]
crypto/conf: gcc build warning fix

Fix the gcc build warning from conf_sap.c:
variable flags set but not used [-Wunused-but-set-variable]
variable appname set but not used [-Wunused-but-set-variable]
variable filename set but not used [-Wunused-but-set-variable]

CLA: trivial

Signed-off-by: Gang Chen <gang.c.chen@intel.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19153)

19 months agos390x: fix ecx derive
Juergen Christ [Wed, 7 Sep 2022 13:01:17 +0000 (15:01 +0200)]
s390x: fix ecx derive

Derivation via ecx-methods did not properly set the length.  Make the code
more similar to common code and set the length property.

Signed-off-by: Juergen Christ <jchrist@linux.ibm.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19158)

19 months agoRemove perror() usage in library
Todd Short [Tue, 6 Sep 2022 15:18:54 +0000 (11:18 -0400)]
Remove perror() usage in library

The dgram code used perror extensively.

Keep the `perror()` in the allocation code; it's used for debugging only.
Keep the `perror()`s in the demos, tests and apps.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19148)

19 months agobio_dgram_test.c: Fix warning from older clang compilers
Tomas Mraz [Wed, 7 Sep 2022 06:41:05 +0000 (08:41 +0200)]
bio_dgram_test.c: Fix warning from older clang compilers

Older clang compilers warn about the initializer:

test/bio_dgram_test.c:107:29: error: suggest braces around initialization
 of subobject [-Werror,-Wmissing-braces]
    struct in6_addr ina6 = {0};
                            ^
                            {}

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19152)

19 months agoAdd an EVP demo for key encoding using EC
Daniel Fiala [Tue, 6 Sep 2022 04:27:46 +0000 (06:27 +0200)]
Add an EVP demo for key encoding using EC

Fixes openssl#14117

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19143)

19 months agoFix BIO_sendmmsg/BIO_recvmmsg issues on FreeBSD
Hugo Landau [Wed, 7 Sep 2022 16:59:04 +0000 (17:59 +0100)]
Fix BIO_sendmmsg/BIO_recvmmsg issues on FreeBSD

Fixes #19156.

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19164)

19 months agoFix undefined ipi_spec_dst for cygwin build.
Tristan Lelong [Mon, 5 Sep 2022 09:14:40 +0000 (11:14 +0200)]
Fix undefined ipi_spec_dst for cygwin build.

The 'struct in_pktinfo' doesn't have a 'ipi_spec_dst' field on windows
OS which break cygwin builds of OpenSSL.

Signed-off-by: Tristan Lelong <tlelong@google.com>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19134)

19 months agoapps/lib/http_server.{c,h}: clean up logging and move it to log.{c,h}
Dr. David von Oheimb [Sat, 28 May 2022 18:26:43 +0000 (20:26 +0200)]
apps/lib/http_server.{c,h}: clean up logging and move it to log.{c,h}

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
(Merged from https://github.com/openssl/openssl/pull/18434)

19 months agoapps/ocsp.c etc.: rename 'multi' to 'n_responders' for clarity
Dr. David von Oheimb [Sat, 28 May 2022 16:50:18 +0000 (18:50 +0200)]
apps/ocsp.c etc.: rename 'multi' to 'n_responders' for clarity

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
(Merged from https://github.com/openssl/openssl/pull/18434)

19 months agoAPPS HTTP server: trace requests and responses when enabled
Dr. David von Oheimb [Sat, 28 May 2022 16:44:02 +0000 (18:44 +0200)]
APPS HTTP server: trace requests and responses when enabled

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
(Merged from https://github.com/openssl/openssl/pull/18434)

19 months agoOSSL_trace_enabled.pod: add missing synopsis for OSSL_TRACE()
Dr. David von Oheimb [Sat, 28 May 2022 16:27:44 +0000 (18:27 +0200)]
OSSL_trace_enabled.pod: add missing synopsis for OSSL_TRACE()

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
(Merged from https://github.com/openssl/openssl/pull/18434)

19 months agoCoverity: explicit null dereference
Pauli [Tue, 6 Sep 2022 01:41:35 +0000 (11:41 +1000)]
Coverity: explicit null dereference

Coverity is being pretty silly here but adding the explicit pointer checks
will stop a crash if something goes badly awry.

Fixes Coverity 1513706 - 1513709

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19136)

19 months agoInitial congestion control API design
Tomas Mraz [Fri, 1 Apr 2022 15:01:15 +0000 (17:01 +0200)]
Initial congestion control API design

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/18018)

19 months agoFix build failure on freebsd due to missing data declaration
Tomas Mraz [Mon, 5 Sep 2022 08:17:58 +0000 (10:17 +0200)]
Fix build failure on freebsd due to missing data declaration

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19130)

19 months agoCoverity 1513478: negative return
Pauli [Sun, 4 Sep 2022 21:56:37 +0000 (07:56 +1000)]
Coverity 1513478: negative return

Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19126)

19 months agotest/pkcs12_api_test.c: fix failure on MinGW
xtkoba [Fri, 2 Sep 2022 07:44:17 +0000 (16:44 +0900)]
test/pkcs12_api_test.c: fix failure on MinGW

Use binary mode when opening a file.

Partially fixes #18017.

Reviewed-by: Kurt Roeckx <kurt@roeckx.be>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19117)

19 months agolist: add a doubly linked list type.
Pauli [Fri, 2 Sep 2022 04:44:02 +0000 (14:44 +1000)]
list: add a doubly linked list type.

These list can be embedded into structures and structures can be members of
multiple lists.  Moreover, this is done without dynamic memory allocation.
That is, this is legal:

    typedef struct item_st ITEM;

    struct item_st {
        ...
        OSSL_LIST_MEMBER(new_items, ITEM);
        OSSL_LIST_MEMBER(failed_items, ITEM);
        ...
    };

    DEFINE_LIST_OF(new_items, TESTL);
    DEFINE_LIST_OF(failed_items, TESTL);

    struct {
        ...
        OSSL_LIST(new_items) new;
        OSSL_LIST(failed_items) failed;
        ...
    } *st;

    ITEM *p;

    for (p = ossl_list_new_items_head(&st->new); p != NULL;
         p = ossl_list_new_items_next(p))
        /* do something */

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19115)

19 months agoprovider: cipher: aes: add riscv32 zkn (zbkb) support
Hongren (Zenithal) Zheng [Fri, 13 May 2022 16:01:11 +0000 (00:01 +0800)]
provider: cipher: aes: add riscv32 zkn (zbkb) support

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/18308)

19 months agoaes_platform: add riscv32 zkn asm support
Hongren (Zenithal) Zheng [Fri, 13 May 2022 15:44:31 +0000 (23:44 +0800)]
aes_platform: add riscv32 zkn asm support

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/18308)

19 months agoadd build support for riscv32 aes zkn
Hongren (Zenithal) Zheng [Fri, 13 May 2022 15:29:34 +0000 (23:29 +0800)]
add build support for riscv32 aes zkn

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/18308)

19 months agoAdd RISC-V 32 cpuid support
Hongren (Zenithal) Zheng [Fri, 13 May 2022 16:02:44 +0000 (00:02 +0800)]
Add RISC-V 32 cpuid support

Mainly from #17640

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/18308)

19 months agoAdd linux32-riscv32/BSD-riscv32 target
Hongren (Zenithal) Zheng [Fri, 13 May 2022 15:23:29 +0000 (23:23 +0800)]
Add linux32-riscv32/BSD-riscv32 target

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/18308)

19 months agoAdd AES implementation in riscv32 zkn asm
Hongren (Zenithal) Zheng [Fri, 13 May 2022 14:24:43 +0000 (22:24 +0800)]
Add AES implementation in riscv32 zkn asm

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/18308)

19 months agocheck-format.pl: improve whitespace reporting on <op>=
Dr. David von Oheimb [Tue, 26 Jul 2022 06:37:41 +0000 (08:37 +0200)]
check-format.pl: improve whitespace reporting on <op>=

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
(Merged from https://github.com/openssl/openssl/pull/18812)

19 months agocheck-format.pl: further fixes for whitespace reporting within 'for (...)'
Dr. David von Oheimb [Mon, 25 Jul 2022 16:14:33 +0000 (18:14 +0200)]
check-format.pl: further fixes for whitespace reporting within 'for (...)'

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
(Merged from https://github.com/openssl/openssl/pull/18812)

19 months agocheck-format.pl: report #if and #elif with constant condition; improve checks on...
Dr. David von Oheimb [Fri, 15 Jul 2022 06:35:16 +0000 (08:35 +0200)]
check-format.pl: report #if and #elif with constant condition; improve checks on '/*'

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
(Merged from https://github.com/openssl/openssl/pull/18812)

19 months agocheck-format.pl: extend checking into macro bodies; small further improvements
Dr. David von Oheimb [Wed, 13 Jul 2022 23:34:11 +0000 (01:34 +0200)]
check-format.pl: extend checking into macro bodies; small further improvements

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
(Merged from https://github.com/openssl/openssl/pull/18812)

19 months agocheck-format.pl: improve preprocessor directive handling; re-order state variables
Dr. David von Oheimb [Wed, 13 Jul 2022 17:37:30 +0000 (19:37 +0200)]
check-format.pl: improve preprocessor directive handling; re-order state variables

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
(Merged from https://github.com/openssl/openssl/pull/18812)

19 months agoPKCS7: add notes to pkcs7.h.in and minor code cleanup in crypto/{pkcs7,cms}/
Dr. David von Oheimb [Wed, 31 Aug 2022 08:27:42 +0000 (10:27 +0200)]
PKCS7: add notes to pkcs7.h.in and minor code cleanup in crypto/{pkcs7,cms}/

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
(Merged from https://github.com/openssl/openssl/pull/18915)

19 months agoFix many inconsistencies in doc of CMS_verify() and PKC7_verify() etc.
Dr. David von Oheimb [Fri, 29 Jul 2022 11:09:52 +0000 (13:09 +0200)]
Fix many inconsistencies in doc of CMS_verify() and PKC7_verify() etc.

Also change B< to I< in {CMS,PKCS7}_verify.pod, PKCS7_sign{,_add_signer}.pod

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
(Merged from https://github.com/openssl/openssl/pull/18915)

19 months agoTX key update support, RX time and PN reporting, general refactoring
Hugo Landau [Mon, 15 Aug 2022 15:13:28 +0000 (16:13 +0100)]
TX key update support, RX time and PN reporting, general refactoring

- Adds an RX time field to the OSSL_QRX_PKT structure.

- Adds a timekeeping argument to ossl_demux_new which is used to determine
  packet reception time.

- Adds a decoded PN field to the OSSL_QRX_PKT structure.
  This has to be decoded by the QRX anyway, and its omission was an oversight.

- Key update support for the TX side.

- Minor refactoring.

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/18949)

19 months agoQUIC Record Layer (Refactor and TX Side)
Hugo Landau [Thu, 11 Aug 2022 10:24:57 +0000 (11:24 +0100)]
QUIC Record Layer (Refactor and TX Side)

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/18949)

19 months agoQUIC Demuxer and Record Layer (RX Side)
Hugo Landau [Fri, 22 Jul 2022 12:08:38 +0000 (13:08 +0100)]
QUIC Demuxer and Record Layer (RX Side)

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/18949)

19 months agoDocument the return value of OSSL_LIB_CTX_load_config()
Tomas Mraz [Wed, 31 Aug 2022 06:50:42 +0000 (08:50 +0200)]
Document the return value of OSSL_LIB_CTX_load_config()

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19101)

19 months agoFix documented max. length for info buffer in HKDF
Tobias Brunner [Mon, 29 Aug 2022 08:05:56 +0000 (10:05 +0200)]
Fix documented max. length for info buffer in HKDF

This limit was increased with 20c2876f24d0 ("Increase
HKDF_MAXBUF from 1024 to 2048").

CLA: trivial

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19085)

19 months agoPKCS7_dataVerify(): fix missing use of CRLs in PKCS#7 message
Dr. David von Oheimb [Sat, 30 Jul 2022 18:53:44 +0000 (20:53 +0200)]
PKCS7_dataVerify(): fix missing use of CRLs in PKCS#7 message

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
(Merged from https://github.com/openssl/openssl/pull/18913)

19 months agoRemove unused dtls1_bitmap.c
Tomas Mraz [Mon, 29 Aug 2022 10:27:27 +0000 (12:27 +0200)]
Remove unused dtls1_bitmap.c

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19088)

19 months agoBIO_dgram support for BIO_sendmmsg/BIO_recvmmsg
Hugo Landau [Mon, 9 May 2022 13:24:33 +0000 (14:24 +0100)]
BIO_dgram support for BIO_sendmmsg/BIO_recvmmsg

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/18270)

19 months agoImprove chacha20 perfomance on aarch64 by interleaving scalar with SVE/SVE2
Daniel Hu [Tue, 19 Jul 2022 17:43:28 +0000 (18:43 +0100)]
Improve chacha20 perfomance on aarch64 by interleaving scalar with SVE/SVE2

The patch will process one extra block by scalar in addition to
blocks by SVE/SVE2 in parallel. This is esp. helpful in the
scenario where we only have 128-bit vector length.

The actual uplift to performance is complicated, depending on the
vector length and input data size. SVE/SVE2 implementation don't
always perform better than  Neon, but it should prevail in most
cases

On a CPU with 256-bit SVE/SVE2, interleaved processing can
handle 9 blocks in parallel (8 blocks by SVE and 1 by Scalar).
on 128-bit SVE/SVE2 it is 5 blocks. Input size that is a multiple
of 9/5 blocks on respective CPU can be typically handled at
maximum speed.

Here are test data for 256-bit and 128-bit SVE/SVE2 by running
"openssl speed -evp chacha20 -bytes 576" (and other size)

----------------------------------+---------------------------------
                256-bit SVE       |        128-bit SVE2
----------------------------------|---------------------------------
Input  576 bytes     512 bytes    |  320 bytes        256 bytes
----------------------------------|---------------------------------
SVE    1716361.91k   1556699.18k  |  1615789.06k      1302864.40k
----------------------------------|---------------------------------
Neon   1262643.44k   1509044.05k  |  680075.67k       1060532.31k
----------------------------------+---------------------------------

If the input size gets very large, the advantage of SVE/SVE2 over
Neon will fade out.

Signed-off-by: Daniel Hu <Daniel.Hu@arm.com>
Change-Id: Ieedfcb767b9c08280d7c8c9a8648919c69728fab

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/18901)

19 months agoFix memory leak with TLS1.2 compression
Juergen Christ [Fri, 19 Aug 2022 15:10:29 +0000 (17:10 +0200)]
Fix memory leak with TLS1.2 compression

Leak sanitizer reports following leak for ssl-test-new subtest
4-tlsv1_2-both-compress:

==335733==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 17728 byte(s) in 1 object(s) allocated from:
    #0 0x3ff9fbba251 in malloc (/usr/lib64/libasan.so.8+0xba251)
    #1 0x3ff9f71744f in tls_do_uncompress ssl/record/methods/tls_common.c:868
    #2 0x3ff9f7175bd in tls_default_post_process_record ssl/record/methods/tls_common.c:896
    #3 0x3ff9f715ee7 in tls_get_more_records ssl/record/methods/tls_common.c:773
    #4 0x3ff9f712209 in tls_read_record ssl/record/methods/tls_common.c:958
    #5 0x3ff9f6ef73f in ssl3_read_bytes ssl/record/rec_layer_s3.c:1235
    #6 0x3ff9f776165 in tls_get_message_header ssl/statem/statem_lib.c:1198
    #7 0x3ff9f74709b in read_state_machine ssl/statem/statem.c:624
    #8 0x3ff9f74709b in state_machine ssl/statem/statem.c:478
    #9 0x3ff9f662e61 in SSL_do_handshake ssl/ssl_lib.c:4430
    #10 0x100c55d in do_handshake_step test/helpers/handshake.c:775
    #11 0x100c55d in do_connect_step test/helpers/handshake.c:1134
    #12 0x100e85b in do_handshake_internal test/helpers/handshake.c:1544
    #13 0x1011715 in do_handshake test/helpers/handshake.c:1738
    #14 0x101d1a7 in test_handshake test/ssl_test.c:543
    #15 0x1027875 in run_tests test/testutil/driver.c:370
    #16 0x1008393 in main test/testutil/main.c:30
    #17 0x3ff9cc2b871 in __libc_start_call_main (/usr/lib64/libc.so.6+0x2b871)
    #18 0x3ff9cc2b94f in __libc_start_main_alias_2 (/usr/lib64/libc.so.6+0x2b94f)
    #19 0x100864f  (/code/openssl/test/ssl_test+0x100864f)
Direct leak of 17728 byte(s) in 1 object(s) allocated from:
    #0 0x3ff9fbba251 in malloc (/usr/lib64/libasan.so.8+0xba251)
    #1 0x3ff9f71744f in tls_do_uncompress ssl/record/methods/tls_common.c:868
    #2 0x3ff9f7175bd in tls_default_post_process_record ssl/record/methods/tls_common.c:896
    #3 0x3ff9f715ee7 in tls_get_more_records ssl/record/methods/tls_common.c:773
    #4 0x3ff9f712209 in tls_read_record ssl/record/methods/tls_common.c:958
    #5 0x3ff9f6ef73f in ssl3_read_bytes ssl/record/rec_layer_s3.c:1235
    #6 0x3ff9f776165 in tls_get_message_header ssl/statem/statem_lib.c:1198
    #7 0x3ff9f74709b in read_state_machine ssl/statem/statem.c:624
    #8 0x3ff9f74709b in state_machine ssl/statem/statem.c:478
    #9 0x3ff9f662e61 in SSL_do_handshake ssl/ssl_lib.c:4430
    #10 0x100c55d in do_handshake_step test/helpers/handshake.c:775
    #11 0x100c55d in do_connect_step test/helpers/handshake.c:1134
    #12 0x1010b09 in do_handshake_internal test/helpers/handshake.c:1550
    #13 0x1011715 in do_handshake test/helpers/handshake.c:1738
    #14 0x101d1a7 in test_handshake test/ssl_test.c:543
    #15 0x1027875 in run_tests test/testutil/driver.c:370
    #16 0x1008393 in main test/testutil/main.c:30
    #17 0x3ff9cc2b871 in __libc_start_call_main (/usr/lib64/libc.so.6+0x2b871)
    #18 0x3ff9cc2b94f in __libc_start_main_alias_2 (/usr/lib64/libc.so.6+0x2b94f)
    #19 0x100864f  (/code/openssl/test/ssl_test+0x100864f)
SUMMARY: AddressSanitizer: 35456 byte(s) leaked in 2 allocation(s).

Fix this by freeing the SSL3_RECORD structure inside the OSSL_RECORD_LAYER.

Signed-off-by: Juergen Christ <jchrist@linux.ibm.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19030)

19 months agoapps/speed.c: Wait for generated children
Juergen Christ [Mon, 29 Aug 2022 14:54:02 +0000 (16:54 +0200)]
apps/speed.c: Wait for generated children

In multi-mode, speed fork()s off several children but does not wait for them.
On Linux, this leads to wrong accounting information of getrusage used by
tools to extract running time and page faults.

Wait for every children and check the return code and termination signal.

Signed-off-by: Juergen Christ <jchrist@linux.ibm.com>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19093)

19 months agoFix man page to indicate SHA256 MAC for PKCS12
Stefanos Harhalakis [Sat, 27 Aug 2022 17:36:03 +0000 (18:36 +0100)]
Fix man page to indicate SHA256 MAC for PKCS12

CLA: trivial

Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19079)

19 months agoTest that we ignore a bad record version in a plaintext TLSv1.3 record
Matt Caswell [Wed, 24 Aug 2022 15:29:52 +0000 (16:29 +0100)]
Test that we ignore a bad record version in a plaintext TLSv1.3 record

The RFC requires us to ignore this field in plaintext records - so even
if it is set incorrectly we should tolerate it.

Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19058)

19 months agoTolerate a bad record version in TLSv1.3 plaintext records
Matt Caswell [Wed, 24 Aug 2022 15:02:23 +0000 (16:02 +0100)]
Tolerate a bad record version in TLSv1.3 plaintext records

When a server responds to a second TLSv1.3 ClientHello it is required to
set the legacy_record_version to 0x0303 (TLSv1.2). The client is required
to ignore that field even if it is wrong. The recent changes to the read
record layer in PR #18132 made the record layer stricter and it was
checking that the legacy_record_version was the correct value. This
caused connection failures when talking to buggy servers that set the
wrong legacy_record_version value.

We make us more tolerant again.

Fixes #19051

Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19058)

19 months agoAdd design requirements for QUIC packet demuxer
Tomas Mraz [Thu, 5 May 2022 06:59:27 +0000 (08:59 +0200)]
Add design requirements for QUIC packet demuxer

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/18249)

20 months agoERR: Make CRYPTO_malloc() and friends report ERR_R_MALLOC_FAILURE
Dr. David von Oheimb [Mon, 12 Apr 2021 08:01:51 +0000 (10:01 +0200)]
ERR: Make CRYPTO_malloc() and friends report ERR_R_MALLOC_FAILURE

Fixes #6251

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
(Merged from https://github.com/openssl/openssl/pull/14833)

20 months agoConvert serverinfo in SSL_CTX_use_serverinfo() to v2.
Daniel Fiala [Tue, 24 May 2022 13:11:58 +0000 (15:11 +0200)]
Convert serverinfo in SSL_CTX_use_serverinfo() to v2.

Fixes openssl#18183.

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/18614)

20 months agoAdd missing ')' to command help
Pauli [Wed, 24 Aug 2022 01:40:13 +0000 (11:40 +1000)]
Add missing ')' to command help

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19049)

20 months agoDrop the optimisation level for ppc64le cross-compile
Matt Caswell [Wed, 24 Aug 2022 14:10:56 +0000 (15:10 +0100)]
Drop the optimisation level for ppc64le cross-compile

The default cross compiler (gcc 9.4.0) for ppc64le on Ubunut 20.04 seems
buggy and causes a seg fault in sslapitest. This doesn't impact any other
CI cross compile platforms and does not seem to impact the gcc 10.3.0 cross
compiler.

We just drop the optimisation level on that platform.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19056)

20 months agoUpdates for OSSL_TIME changes
Hugo Landau [Mon, 15 Aug 2022 15:45:17 +0000 (16:45 +0100)]
Updates for OSSL_TIME changes

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/18676)

20 months agoQUIC ACK Manager, Statistics Manager and Congestion Control API
Hugo Landau [Tue, 28 Jun 2022 12:52:48 +0000 (13:52 +0100)]
QUIC ACK Manager, Statistics Manager and Congestion Control API

This is the initial implementation of the ACK Manager for OpenSSL's QUIC
support, with supporting design documentation and tests.

Because the ACK Manager also depends on the Statistics Manager, it is
also implemented here. The Statistics Manager is quite simple, so this
does not amount to a large amount of extra code.

Because the ACK Manager depends on a congestion controller, it adds a
no-op congestion controller, which uses the previously workshopped
congestion control API.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/18676)

20 months agoCMP: correct handling of fallback subject in OSSL_CMP_CTX_setup_CRM() and its doc
Dr. David von Oheimb [Mon, 1 Aug 2022 18:34:19 +0000 (20:34 +0200)]
CMP: correct handling of fallback subject in OSSL_CMP_CTX_setup_CRM() and its doc

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
(Merged from https://github.com/openssl/openssl/pull/18929)

20 months agoCMP: fix crash in check_transactionID_or_nonce() on 'actual' being NULL
Dr. David von Oheimb [Mon, 1 Aug 2022 18:18:09 +0000 (20:18 +0200)]
CMP: fix crash in check_transactionID_or_nonce() on 'actual' being NULL

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
(Merged from https://github.com/openssl/openssl/pull/18929)

20 months agoCRMF: make create_popo_signature() check that pubkey and pkey match
Dr. David von Oheimb [Mon, 1 Aug 2022 16:54:06 +0000 (18:54 +0200)]
CRMF: make create_popo_signature() check that pubkey and pkey match

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
(Merged from https://github.com/openssl/openssl/pull/18930)

20 months agoadd missing CRMF API function OSSL_CRMF_CERTTEMPLATE_get0_publicKey()
Dr. David von Oheimb [Mon, 1 Aug 2022 14:47:04 +0000 (16:47 +0200)]
add missing CRMF API function OSSL_CRMF_CERTTEMPLATE_get0_publicKey()

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
(Merged from https://github.com/openssl/openssl/pull/18930)

20 months agoX509: clean up doc and implementation of X509{,_REQ}_check_private_key()
Dr. David von Oheimb [Mon, 1 Aug 2022 15:43:00 +0000 (17:43 +0200)]
X509: clean up doc and implementation of X509{,_REQ}_check_private_key()

Also constify X509_REQ_get0_pubkey() and X509_REQ_check_private_key().

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
(Merged from https://github.com/openssl/openssl/pull/18930)

20 months agox509_att.c: improve error checking and reporting and coding style
Dr. David von Oheimb [Mon, 1 Aug 2022 14:33:35 +0000 (16:33 +0200)]
x509_att.c: improve error checking and reporting and coding style

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
(Merged from https://github.com/openssl/openssl/pull/18931)

20 months agoadd missing doc of X509_REQ_get_extensions() and X509_REQ_add_extensions{,_nid}()
Dr. David von Oheimb [Mon, 1 Aug 2022 14:35:42 +0000 (16:35 +0200)]
add missing doc of X509_REQ_get_extensions() and X509_REQ_add_extensions{,_nid}()

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
(Merged from https://github.com/openssl/openssl/pull/18931)

20 months agoX509_REQ_get_extensions: add error queue entry on ill-formed extensions attribute
Dr. David von Oheimb [Mon, 1 Aug 2022 13:06:35 +0000 (15:06 +0200)]
X509_REQ_get_extensions: add error queue entry on ill-formed extensions attribute

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
(Merged from https://github.com/openssl/openssl/pull/18931)

20 months agoutil/wrap.pl.in: If the subprocess died with a signal, let's re-signal it
Richard Levitte [Mon, 22 Aug 2022 16:40:54 +0000 (18:40 +0200)]
util/wrap.pl.in: If the subprocess died with a signal, let's re-signal it

A simple 'kill' of the same signal on our own process should do it.
This will allow the shell that this is running under to catch it
properly, and output something if it usually does that.

Fixes #19041

Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19042)

20 months agoFix the return type for the rlayer_skip_early_data callback
Matt Caswell [Tue, 23 Aug 2022 13:45:32 +0000 (14:45 +0100)]
Fix the return type for the rlayer_skip_early_data callback

There was a copy & paste error in the definition of the
rlayer_skip_early_data callback. The return type is supposed to
be "int" but it was defined as a pointer type. This was causing
test failures on some platforms.

Fixes #19037

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/19048)

20 months agorl->enc_ctx must be non-NULL and cipher must be set
Tomas Mraz [Fri, 19 Aug 2022 10:28:42 +0000 (12:28 +0200)]
rl->enc_ctx must be non-NULL and cipher must be set

Otherwise ssl3_cipher() cannot work properly.

Fixes Coverity CID 1509401

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19027)

20 months agoDo not use RLAYERfatal on NULL RLAYER
Tomas Mraz [Fri, 19 Aug 2022 10:19:55 +0000 (12:19 +0200)]
Do not use RLAYERfatal on NULL RLAYER

or on record layer that is to be freed anyway.

Fixes Coverity CID 15094021509403

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19027)

20 months agoCoverity 1508532: out of bounds access
Pauli [Mon, 22 Aug 2022 01:06:57 +0000 (11:06 +1000)]
Coverity 1508532: out of bounds access

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19033)

20 months agoOSSL_HTTP_REQ_CTX_nbio: add support for partial content-type string matching
Dr. David von Oheimb [Tue, 28 Jun 2022 15:23:45 +0000 (17:23 +0200)]
OSSL_HTTP_REQ_CTX_nbio: add support for partial content-type string matching

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
(Merged from https://github.com/openssl/openssl/pull/18675)

20 months agoapp_http_tls_cb() and tls_error_hint(): code cleanup
Dr. David von Oheimb [Tue, 28 Jun 2022 10:10:49 +0000 (12:10 +0200)]
app_http_tls_cb() and tls_error_hint(): code cleanup

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
(Merged from https://github.com/openssl/openssl/pull/18675)

20 months agoMakefile: Generate crypto objects only as far as needed
Dr. David von Oheimb [Tue, 11 May 2021 13:35:43 +0000 (15:35 +0200)]
Makefile: Generate crypto objects only as far as needed

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
(Merged from https://github.com/openssl/openssl/pull/15224)

20 months agoMakefile: Call mknum.pl on 'make ordinals' only if needed
Dr. David von Oheimb [Tue, 11 May 2021 10:59:03 +0000 (12:59 +0200)]
Makefile: Call mknum.pl on 'make ordinals' only if needed

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
(Merged from https://github.com/openssl/openssl/pull/15224)

20 months agoSupport decode SM2 parameters
K1 [Mon, 18 Jul 2022 17:18:12 +0000 (01:18 +0800)]
Support decode SM2 parameters

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/18819)

20 months agoMoving notify check after the no time check
Ryan Kelley [Tue, 16 Aug 2022 05:28:50 +0000 (05:28 +0000)]
Moving notify check after the no time check

CLA: trivial

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19007)

20 months agoopenssl speed fails in FIPS mode
Dmitry Belyavskiy [Tue, 21 Dec 2021 15:52:25 +0000 (16:52 +0100)]
openssl speed fails in FIPS mode

...because it uses md5 for HMAC tests. Skip md5 in case of its
unavailability.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17331)

20 months agoFix typo in migration guide
Tobias Nießen [Sat, 20 Aug 2022 16:56:21 +0000 (18:56 +0200)]
Fix typo in migration guide

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19032)

20 months agoAlways automatically add -DPEDANTIC with enable-ubsan
Tomas Mraz [Fri, 19 Aug 2022 13:48:34 +0000 (15:48 +0200)]
Always automatically add -DPEDANTIC with enable-ubsan

To avoid reports like: #19028

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19029)

20 months agoFix doc-nits
Todd Short [Mon, 22 Aug 2022 18:12:50 +0000 (14:12 -0400)]
Fix doc-nits

PR #19031 updated options that that were listed as commands, these
options were already in openssl-list.pod.in, so they are redundant
in openssl.pod.

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19044)

20 months agoevp: Use functions instead of direct structure field references
Tianjia Zhang [Mon, 30 Aug 2021 07:34:06 +0000 (15:34 +0800)]
evp: Use functions instead of direct structure field references

AES and chacha20poly1305 also have some codes that directly reference
the fields in the EVP_CIPHER_CTX structure, such as 'ctx->buf' and
'ctx->encrypt', in order to make the code style uniform, use the
corresponding interface API instead of direct field references.

Signed-off-by: Tianjia Zhang <tianjia.zhang@linux.alibaba.com>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/16465)

20 months agoevp: Simplify ARIA aead cipher definition
Tianjia Zhang [Mon, 30 Aug 2021 06:28:07 +0000 (14:28 +0800)]
evp: Simplify ARIA aead cipher definition

Remove fixed macro variables, only keep the cipher mode name and
key length.

Signed-off-by: Tianjia Zhang <tianjia.zhang@linux.alibaba.com>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/16465)

20 months agoAdd BSD-armv4 target based on linux-armv4
Piotr Kubaj [Fri, 29 Jul 2022 10:47:29 +0000 (12:47 +0200)]
Add BSD-armv4 target based on linux-armv4

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Todd Short <todd.short@me.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/18910)

20 months agoClarify dashes are required for openssl list command
Jeff Croxell [Fri, 19 Aug 2022 02:30:20 +0000 (21:30 -0500)]
Clarify dashes are required for openssl list command

Fixes #19013

CLA: trivial

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19031)

20 months agoUpdate gitignore
Todd Short [Thu, 18 Aug 2022 15:05:43 +0000 (11:05 -0400)]
Update gitignore

Add test/timing_load_creds

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19021)

20 months agoBIO_sendmmsg/BIO_recvmmsg (API only)
Hugo Landau [Mon, 1 Aug 2022 09:33:00 +0000 (10:33 +0100)]
BIO_sendmmsg/BIO_recvmmsg (API only)

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/18923)

20 months agoLimit the size of various MAXCHUNK definitions
Pauli [Mon, 15 Aug 2022 04:49:17 +0000 (14:49 +1000)]
Limit the size of various MAXCHUNK definitions

The current code has issues when sizeof(long) <> sizeof(size_t).  The two
types are assumed to be interchangeable and them being different will
cause crashes and endless loops.

This fix limits the maximum chunk size for many of the symmetric ciphers
to 2^30 bytes.  This chunk size limits the amount of data that will
be encrypted/decrypted in one lump.  The code internally handles block
of data later than the chunk limit, so this will present no difference
to the caller.  Any loss of efficiency due to limiting the chunking to
1Gbyte rather than more should be insignificant.

Fixes Coverity issues:
    15084981508500 - 15085051508507 - 15085271508529 - 1508533,
    1508535 - 150853715085391508541 - 15085491508551 - 1508569 &
    1508571 - 1508582.

Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/18997)

20 months agoCoverity: misuses of time_t
Pauli [Tue, 16 Aug 2022 01:05:02 +0000 (11:05 +1000)]
Coverity: misuses of time_t

Coverity 1508506:

    Fixes a bug in the cookie code which would have caused problems for
    ten minutes before and after the lower 32 bits of time_t rolled over.

Coverity 1508534 & 1508540:

    Avoid problems when the lower 32 bits of time_t roll over by delaying
    the cast to integer until after the time delta has been computed.

Reviewed-by: Ben Kaduk <kaduk@mit.edu>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19004)

20 months agoCheck record layer callbacks are non-null
Matt Caswell [Tue, 9 Aug 2022 14:52:27 +0000 (15:52 +0100)]
Check record layer callbacks are non-null

The current libssl code always ensures that the callbacks are non-null.
However, the record layer itself wasn't checkthing this. We ensure it does.

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/18132)

20 months agoFormatting cleanups
Matt Caswell [Wed, 27 Jul 2022 13:20:23 +0000 (14:20 +0100)]
Formatting cleanups

Some minor formatting cleanups and other minor tweaks.

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/18132)

20 months agoRemove redefinition of macros
Matt Caswell [Wed, 27 Jul 2022 15:44:01 +0000 (16:44 +0100)]
Remove redefinition of macros

Some macros were redefined in ssl3_cbc.c. We remove the redefinitions

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/18132)

20 months agoRemove redefinition of SSL_AD_NO_ALERT
Matt Caswell [Wed, 27 Jul 2022 13:54:48 +0000 (14:54 +0100)]
Remove redefinition of SSL_AD_NO_ALERT

The SSL_AD_NO_ALERT value was defined in two places. We centralise its
definition.

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/18132)

20 months agoEnsure the rrl object is set to NULL after it is freed
Matt Caswell [Wed, 27 Jul 2022 13:52:13 +0000 (14:52 +0100)]
Ensure the rrl object is set to NULL after it is freed

Once we free the rrl object we should NULL it to prevent a dangling ref
to it. Otherwise we could get a double free.

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/18132)

20 months agoRename some functions to be more consistent
Matt Caswell [Wed, 27 Jul 2022 13:50:16 +0000 (14:50 +0100)]
Rename some functions to be more consistent

Some functions in the record layer were called rlayer_*, but most were
called tls_*. We standardise on the latter.

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/18132)