summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2022-02-13Use C locale in Bash scripts.Daniel
Fixes openssl#17228. Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17674)
2022-02-11Cleanup record length checks for KTLSBernd Edlinger
In some corner cases the check for packets which exceed the allowed record length was missing when KTLS is initially enabled, when some unprocessed packets are still pending. Add at least some tests for KTLS, since we have currently not very much test coverage for KTLS. Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17504)
2022-02-11Add test of FIPS provider from the master branch with 3.0 buildTomas Mraz
Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17671)
2022-02-11evp_test: Skip testcase if r parameter is unsupportedTomas Mraz
The r parameter of the KBKDF is unsupported by 3.0 FIPS module. Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17671)
2022-02-11Add test of FIPS provider from the 3.0 branch with master buildTomas Mraz
Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17671)
2022-02-11Change condition to avoid spurious compiler complaints.Pauli
X509_TRUST_get0() is checking < 0, the code here was checking == -1. Both are equivalent in this situation but gcc-12 has conniptions about a subsequent possible NULL dereference (which isn't possible). Fixes #17665 Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17668)
2022-02-11Added checking for buflen overflow due to MAX_MISALIGNMENT.Kevin K Biju
Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17646)
2022-02-10bn_lib.c: Change Endianess check to as a binary condition.Kelvin Lee
This prevents VS2022 from mis-identify an uninitialized local pointer variable. CLA: trivial Reviewed-by: Ben Kaduk <kaduk@mit.edu> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17567)
2022-02-10AES-GCM enabled with AVX512 vAES and vPCLMULQDQ.Andrey Matyukov
Vectorized 'stitched' encrypt + ghash implementation of AES-GCM enabled with AVX512 vAES and vPCLMULQDQ instructions (available starting Intel's IceLake micro-architecture). The performance details for representative IceLake Server and Client platforms are shown below Performance data: OpenSSL Speed KBs/Sec Intel(R) Xeon(R) Platinum 8380 CPU @ 2.30GHz (1Core/1Thread) Payload in Bytes 16 64 256 1024 8192 16384 AES-128-GCM Baseline 478708.27 1118296.96 2428092.52 3518199.4 4172355.99 4235762.07 Patched 534613.95 2009345.55 3775588.15 5059517.64 8476794.88 8941541.79 Speedup 1.12 1.80 1.55 1.44 2.03 2.11 AES-256-GCM Baseline 399237.27 961699.9 2136377.65 2979889.15 3554823.37 3617757.5 Patched 475948.13 1720128.51 3462407.12 4696832.2 7532013.16 7924953.91 Speedup 1.19 1.79 1.62 1.58 2.12 2.19 Intel(R) Core(TM) i7-1065G7 CPU @ 1.30GHz (1Core/1Thread) Payload in Bytes 16 64 256 1024 8192 16384 AES-128-GCM Baseline 259128.54 570756.43 1362554.16 1990654.57 2359128.88 2401671.58 Patched 292139.47 1079320.95 2001974.63 2829007.46 4510318.59 4705314.41 Speedup 1.13 1.89 1.47 1.42 1.91 1.96 AES-256-GCM Baseline 236000.34 550506.76 1234638.08 1716734.57 2011255.6 2028099.99 Patched 247256.32 919731.34 1773270.43 2553239.55 3953115.14 4111227.29 Speedup 1.05 1.67 1.44 1.49 1.97 2.03 Reviewed-by: TJ O'Dwyer, Marcel Cornu, Pablo de Lara Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17239)
2022-02-10Fix outdated commentsWeiguo Li
Update the comment "../md32_common.h" to "crypto/md32_common.h". CLA: trivial Signed-off-by: Weiguo Li <liwg06@foxmail.com> Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com> (Merged from https://github.com/openssl/openssl/pull/17670)
2022-02-09Fix small typo in EVP_KEYEXCH-ECDH.html doc exampleEasySec
Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17657)
2022-02-09aarch64: fix branch target indications in arm64cpuid.pl and keccak1600Tom Cosgrove
Add missing AARCH64_VALID_CALL_TARGET to armv8_rng_probe(). Also add these to the functions defined by gen_random(), and note that this Perl sub prints the assembler out directly, not going via the $code xlate mechanism (and therefore coming before the include of arm_arch.h). So fix this too. In KeccakF1600_int, AARCH64_SIGN_LINK_REGISTER functions as AARCH64_VALID_CALL_TARGET on BTI-only builds, so it needs to come before the 'adr' line. Change-Id: If241efe71591c88253a3e36647ced00300c3c1a3 Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17653)
2022-02-09Add the check after calling OPENSSL_strdupJiasheng Jiang
Since the potential failure of the memory allocation, the OPENSSL_strdup() could return NULL pointer. Therefore, it should be better to check it in order to guarantee the success of the configuration, same as the check for SSL_CTX_set_srp_username(). Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn> Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17643)
2022-02-09Fix an enginetest failure when compiled with no-deprecated --api=1.1.1Matt Caswell
Fixes #17649 Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17652)
2022-02-09Send auxiliary messages to bio_err.Daniel
Fixes openssl#17613. Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17650)
2022-02-08rsa: add check after calling BN_BLINDING_lockJiasheng Jiang
As the potential failure of getting lock, we need to check the return value of the BN_BLINDING_lock() in order to avoid the dirty data. Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn> Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17642)
2022-02-08Check for presence of 1.1.x openssl runtimeBernd Edlinger
if the newly loaded engine contains the symbol EVP_PKEY_base_id, we know it is linked to 1.1.x openssl. Abort loading this engine, as it will definitely crash. Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17112)
2022-02-08Prevent crash with engine using different openssl runtimeBernd Edlinger
This problem happens usually because an application links libcrypto and/or libssl statically which installs an atexit handler, but later an engine using a shared instance of libcrypto is installed. The problem is in simple words that both instances of libcrypto have an atexit handler installed, but both are unable to coordinate with each other, which causes a crash, typically a use-after-free in the engine's destroy function. Work around that by preventing the engine's libcrypto to install the atexit handler. This may result in a small memory leak, but that memory is still reachable. Fixes #15898 Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17112)
2022-02-07Add testcases for EVP_PKEY_set1_encoded_public_key()Tomas Mraz
Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17630)
2022-02-07Replace size check with more meaningful pubkey checkTomas Mraz
It does not make sense to check the size because this function can be used in other contexts than in TLS-1.3 and the value might not be padded to the size of p. However it makes sense to do the partial pubkey check because there is no valid reason having the pubkey value outside the 1 < pubkey < p-1 bounds. Fixes #15465 Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17630)
2022-02-07doc: Add hint to use EVP_PKEY_get_bn_param to retrieve big integersTomas Mraz
Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17423)
2022-02-07Fix SIZE_MAX not defined on z/OS etcAnkit Das
Fixes openssl#17629 by including internal/numbers.h which defines SIZE_MAX CLA: trivial Fixes #17629 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/17632)
2022-02-07Correct return type for BIO_ptr_ctrlThomas1664
Fixes #17549 CLA: trivial Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17636)
2022-02-07Fixed counter overflowDanny Tsen
Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17607)
2022-02-07evp_test: Add the missing check after calling OPENSSL_strdup and ↵Jiasheng Jiang
sk_OPENSSL_STRING_new_null Since the memory allocation may fail, the 'mac_name' and 'controls' could be NULL. And the 'mac_name' will be printed in mac_test_run_mac() without check. Also the result of 'params_n + sk_OPENSSL_STRING_num(expected->controls)' in mac_test_run_mac() will be 'params_n - 1' if allocation fails , which does not make sense. Therefore, it should be better to check them in order to guarantee the complete success of initiation. If fails, we also need to free the 'mdat' to avoid the memory leak. Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn> Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17628)
2022-02-07Fix typosDimitris Apostolou
Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17634)
2022-02-07evp enc: cache cipher key lengthPauli
Instead of doing a heavy params based query every time a context is asked for its key length, this value is cached in the context and only queried if it could have been modified. Fixes #17064 Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17543)
2022-02-07evp enc: cache cipher IV lengthPauli
Instead of doing a heavy params based query every time a context is asked for its IV length, this value is cached in the context and only queried if it could have been modified. Fixes #17064 Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17543)
2022-02-07aes: avoid accessing key length field directlyPauli
Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17543)
2022-02-05Move e_os.h to include/internalRichard Levitte
Including e_os.h with a path from a header file doesn't work well on certain exotic platform. It simply fails to build. Since we don't seem to be able to stop ourselves, the better move is to move e_os.h to an include directory that's part of the inclusion path given to the compiler. Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17641)
2022-02-04Add support for Chacha20-Poly1305 to kernel TLS on FreeBSD.John Baldwin
FreeBSD's kernel TLS supports Chacha20 for both TLS 1.2 and TLS 1.3. Reviewed-by: Ben Kaduk <kaduk@mit.edu> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/13752)
2022-02-04Add missing CRYPTO_THREAD_cleanup_local of default_context_thread_localHarry Sintonen
CLA: trivial 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/17622)
2022-02-04Fix builds with DJGPPJuan Manuel Guerrero
CLA: trivial To get the master branch compiled with DJGPP some minor adjustments are required. They will have no impact on any other ports. The DJGPP port uses the Watt-32 library to provide the required network functionality and some of its headers need to be included. Neither DJGPP nor the Watt-32 library provide in_addr_t thus it must be provided as it is done for OPENSSL_SYS_WINDOWS in crypto/bio/b_addr.c. In the DJGPP section of include/internal/sockets.h the following Watt-32 headers must be added: - arpa/inet.h: to provide declaration of inet_ntoa required in crypto/bio/b_addr.c - netinet/tcp.h: to provide defintion of TCP_NODELAY required in crypto/bio/b_sock2.c Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17623)
2022-02-03openssl-dgst.pod.in: Fix documentation of -list optionEasySec
Mention openssl list -digest-algorithms, NOT -digest-commands. Move option -list just after the related option -digest. Fix HTML formatting of section 'Examples' by adding missing newlines and add 2 examples variant to clarify syntax of the command. Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17626)
2022-02-03Fix copyrightsTodd Short
Add copyright to files that were missing it. Update license from OpenSSL to Apache as needed. Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17606)
2022-02-03Use opt_int_arg() to parse integers in apps/speed.cKevin K Biju
We use opt_int_arg() to prevent malformed processing of hexadecimal input to some command line options. Updated help to mention the change. Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17585)
2022-02-03Fix EVP todata and fromdata when used with selection of EVP_PKEY_PUBLIC_KEY.slontis
The private key for rsa, dsa, dh and ecx was being included when the selector was just the public key. (ec was working correctly). This matches the documented behaviour. Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17200)
2022-02-03add SSL_get0_iana_groups() & SSL_client_hello_get_extension_order()Phus Lu
The function/macro allow user get groups/extensions without memory allcations. So we could calculate the ssl fignerprint(ja3) in low cost. Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/16910)
2022-02-02apps/progs.pl: use SOURCE_DATE_EPOCH if defined for copyright yearRoss Burton
As with 11d7d903, use SOURCE_DATE_EPOCH for the copyright year if it is defined, to avoid reproducibility problems. CLA: trivial Signed-off-by: Ross Burton <ross.burton@arm.com> Change-Id: I1bea19070411a69155c43de7082350fb2c499da3 Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17601)
2022-02-01Update the comment on ssl3_write_pending()yangyangtiantianlonglong
The struct s->s3 has been modified. 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/17611)
2022-02-01Revert dropped usage of var thiswr in do_ssl3_write()yangyangtiantianlonglong
The var 'thiswr' is an unwanted modification, it was submitted in #5253. Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17610)
2022-02-01indentation fixPauli
Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/17572)
2022-02-01tls1 prf: implement ctx dup operationPauli
Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/17572)
2022-02-01pkcs12 kdf: implement ctx dup operationPauli
Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/17572)
2022-02-01test: change pkey kdf dup fail test to a pkey kdf dup success testPauli
Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/17572)
2022-02-01k942 kdf: implement ctx dup operationPauli
Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/17572)
2022-02-01ss KDF: implement ctx dup operationPauli
Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/17572)
2022-02-01ssh kdf: implement ctx dup operationPauli
Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/17572)
2022-02-01scrypt: implement ctx dup operationPauli
Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/17572)
2022-02-01pvk kdf: implement ctx dup operationPauli
Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/17572)