1647 Commits

Author SHA1 Message Date
kang1024 9ce64459fa Disable ML-KEM and ML-DSA by default with positive opt-in macros
Change ML-KEM and ML-DSA from enabled-by-default to disabled-by-default.
Replace negative guards (OPENSSL_NO_ML_KEM/ML_DSA) with positive opt-in
guards (OPENSSL_ML_KEM/ML_DSA) across all provider and encoder/decoder code.

Users must explicitly enable via Configure options:
  ./Configure ... enable-ml-kem enable-ml-dsa

Configure changes:
- Add ml-kem/ml-dsa to %disabled hash with 'default' reason
- Skip OPENSSL_NO_ macro generation for these features
- Define OPENSSL_ML_KEM/ML_DSA when user enables them

Signed-off-by: kang1024 <yangjiankang3@huawei.com>
2026-04-23 16:21:19 +08:00
kang1024 145d0c702b Add ML-KEM and ML-DSA support from OpenSSL 3.5.6
Port ML-KEM (FIPS 203) and ML-DSA (FIPS 204) post-quantum cryptography
from OpenSSL 3.5.6 to OpenSSL 3.0.9 with API compatibility adaptations.

Key compatibility shims:
- Add include/openssl/byteorder.h (OPENSSL_load/store_u{16,32,64}_le)
- Add include/internal/fips.h (ossl_fips_self_testing() inline stub)
- Map EVP_DigestSqueeze() to EVP_DigestFinalXOF() + large buffer
- Map EVP_MD_xof() to EVP_MD flags check
- Map OSSL_FUNC_SIGNATURE_SIGN/VERIFY_MESSAGE_INIT dispatch IDs to
  existing SIGN_INIT/VERIFY_INIT (2/4)
- Map EVP_PKEY_sign/verify_message_init() to sign/verify_init_ex()
- Add OSSL_SIGNATURE_PARAM_MU constant
- Add OSSL_FUNC typedef + OSSL_DISPATCH_END macro
- Use correct NID names (NID_id_alg_ml_dsa_44 vs NID_ML_DSA_44)

Provider registrations:
- ML-KEM KEM, ML-KEM/ML-DSA keymgmt, ML-DSA signature providers
- ML-KEM/ML-DSA encoders/decoders (der/pem/text for pub/priv/pkcs8)
- ML-KEM TLS group capabilities

Build system fixes:
- Add providers/common/provider_ctx.c with get_param/bool_param stubs
- Fix DER build.info $COMMON variable override order
- Fix decode_der2key.c PROV_CTX vs OSSL_LIB_CTX type mismatch (6 calls)
- Link ML tests against libcrypto.a (not .so) for internal symbols
- Remove references to missing der_ml_kem_{gen,key}.c

Adapt BUILD.gn for OpenHarmony:
- Add 18 new source files across three build sections (libcommon, libdefault,
  crypto_source) to support ML-KEM/ML-DSA in the OpenHarmony/OHOS build system.

Test infrastructure:
- Add 3 test recipes (evp_extra_ml_kem, internal_ml_kem, ml_dsa)
- Add #include "internal/nelem.h" for OSSL_NELEM in test files
- Add LABELED_BUF_PRINT_WIDTH definition for codec text output

All 253 tests pass (3374 test cases), 0 compilation warnings.

Signed-off-by: kang1024 <yangjiankang3@huawei.com>
2026-04-23 11:54:05 +08:00
Tomas Mraz e1dd0b3200 Fix timing side-channel in ECDSA signature computation
There is a timing signal of around 300 nanoseconds when the top word of
the inverted ECDSA nonce value is zero. This can happen with significant
probability only for some of the supported elliptic curves. In particular
the NIST P-521 curve is affected. To be able to measure this leak, the
attacker process must either be located in the same physical computer or
must have a very fast network connection with low latency.

Attacks on ECDSA nonce are also known as Minerva attack.

Fixes CVE-2024-13176

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/26429)

(cherry picked from commit 63c40a66c5dc287485705d06122d3a6e74a6a203)
Signed-off-by: lcc <lichaochen@huawei.com>
2025-01-22 17:57:55 +08:00
Tomas Mraz aa0bf2d5aa Rename BN_generate_dsa_nonce() to ossl_bn_gen_dsa_nonce_fixed_top()
And create a new BN_generate_dsa_nonce() that corrects the BIGNUM top.
We do this to avoid leaking fixed top numbers via the public API.

Also add a slight optimization in ossl_bn_gen_dsa_nonce_fixed_top()
and make it LE/BE agnostic.

Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Neil Horman <nhorman@openssl.org>

(cherry picked from commit 9c85f6cd2d6debe5ef6ef475ff4bf17e0985f7a2)

(Merged from https://github.com/openssl/openssl/pull/24317)

(cherry picked from commit fdc3efc371be43d5092bb19823e084f54541cbe3)
Signed-off-by: lcc <lichaochen@huawei.com>
2025-01-22 17:57:55 +08:00
Tomas Mraz 2f4e589fed Add ossl_bn_priv_rand_range_fixed_top() and use it for EC/DSA
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Neil Horman <nhorman@openssl.org>

(cherry picked from commit 13b3ca5c998e6db4f7251a56c43541cb1a422bd0)

(Merged from https://github.com/openssl/openssl/pull/24317)

(cherry picked from commit a70ca93cdbc0ed36bf783b9eadc4cea35986b139)
Signed-off-by: lcc <lichaochen@huawei.com>
2025-01-22 17:57:55 +08:00
Tomas Mraz 960a5e5a57 Add ossl_bn_is_word_fixed_top()
Also correct some BN_FLG_FIXED_TOP flag handling.

Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Neil Horman <nhorman@openssl.org>

(cherry picked from commit 2d285fa873028f6cff9484a0cdf690fe05d7fb16)

(Merged from https://github.com/openssl/openssl/pull/24317)

(cherry picked from commit 5dbb2a8ca2c1ba42dfb9445b5ea76adccbdb9744)
Signed-off-by: lcc <lichaochen@huawei.com>
2025-01-22 17:57:55 +08:00
Tomas Mraz d94495cb53 Make BN_generate_dsa_nonce() constant time and non-biased
Co-authored-by: Paul Dale <ppzgs1@gmail.com>

Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Neil Horman <nhorman@openssl.org>

(cherry picked from commit d7d1bdcb6aa3d5000bf7f5ebc5518be5c91fd5a5)

(Merged from https://github.com/openssl/openssl/pull/24317)

(cherry picked from commit 0df711a25da6e99a7ce0dbaf992acb644252385f)
Signed-off-by: lcc <lichaochen@huawei.com>
2025-01-22 17:57:55 +08:00
Neil Horman f3a210cd3d Detect and prevent recursive config parsing
If a malformed config file is provided such as the following:

openssl_conf = openssl_init
[openssl_init]
providers = provider_sect
[provider_sect]
 = provider_sect

The config parsing library will crash overflowing the stack, as it
recursively parses the same provider_sect ad nauseum.

Prevent this by maintaing a list of visited nodes as we recurse through
referenced sections, and erroring out in the event we visit any given
section node more than once.

Note, adding the test for this revealed that our diagnostic code
inadvertently pops recorded errors off the error stack because
provider_conf_load returns success even in the event that a
configuration parse failed. The call path to provider_conf_load has been
updated in this commit to address that shortcoming, allowing recorded
errors to be visibile to calling applications.

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

Signed-off-by: hhhFun <fanghaojie@huawei.com>
2024-06-05 11:08:45 +08:00
Tianjia Zhang 5d8c0bdcec [Backport] obj: Add SM4 GCM/CCM OID
Reference: https://github.com/openssl/openssl/commit/a596d38a8cddca4af3416b2664e120028d96e6a9

Add the following OID:

  SM4-GCM: 1.2.156.10197.1.104.8
  SM4-CCM: 1.2.156.10197.1.104.9

Signed-off-by: Tianjia Zhang <tianjia.zhang@linux.alibaba.com>

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

Signed-off-by: lanming <lanming@huawei.com>
2024-05-10 14:14:39 +08:00
Richard Levitte 6f331fad8b Make DH_check_pub_key() and DH_generate_key() safer yet
We already check for an excessively large P in DH_generate_key(), but not in
DH_check_pub_key(), and none of them check for an excessively large Q.

This change adds all the missing excessive size checks of P and Q.

It's to be noted that behaviours surrounding excessively sized P and Q
differ.  DH_check() raises an error on the excessively sized P, but only
sets a flag for the excessively sized Q.  This behaviour is mimicked in
DH_check_pub_key().

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/22518)

(cherry picked from commit ddeb4b6c6d527e54ce9a99cba785c0f7776e54b6)
Signed-off-by: code4lala <fengziteng2@huawei.com>
2023-11-16 16:27:35 +08:00
Matt Caswell 486a7be409 Fix DH_check() excessive time with over sized modulus
The DH_check() function checks numerous aspects of the key or parameters
that have been supplied. Some of those checks use the supplied modulus
value even if it is excessively large.

There is already a maximum DH modulus size (10,000 bits) over which
OpenSSL will not generate or derive keys. DH_check() will however still
perform various tests for validity on such a large modulus. We introduce a
new maximum (32,768) over which DH_check() will just fail.

An application that calls DH_check() and supplies a key or parameters
obtained from an untrusted source could be vulnerable to a Denial of
Service attack.

The function DH_check() is itself called by a number of other OpenSSL
functions. An application calling any of those other functions may
similarly be affected. The other functions affected by this are
DH_check_ex() and EVP_PKEY_param_check().

CVE-2023-3446

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21451)

(cherry picked from commit 9e0094e2aa1b3428a12d5095132f133c078d3c3d)
Signed-off-by: code4lala <fengziteng2@huawei.com>
Change-Id: I76f59e2c6292e3719b65242bfe2ad2ba44923320
2023-11-16 16:27:35 +08:00
code4lala 78da00405e openssl-3.0.9.tar.gz
Signed-off-by: code4lala <fengziteng2@huawei.com>
2023-11-16 16:27:34 +08:00
code4lala f7de6b0b2f rm openssl 3.0.7
Signed-off-by: code4lala <fengziteng2@huawei.com>
2023-11-16 16:27:24 +08:00
Matt Caswell e70339fb69 Fix DH_check() excessive time with over sized modulus
The DH_check() function checks numerous aspects of the key or parameters
that have been supplied. Some of those checks use the supplied modulus
value even if it is excessively large.

There is already a maximum DH modulus size (10,000 bits) over which
OpenSSL will not generate or derive keys. DH_check() will however still
perform various tests for validity on such a large modulus. We introduce a
new maximum (32,768) over which DH_check() will just fail.

An application that calls DH_check() and supplies a key or parameters
obtained from an untrusted source could be vulnerable to a Denial of
Service attack.

The function DH_check() is itself called by a number of other OpenSSL
functions. An application calling any of those other functions may
similarly be affected. The other functions affected by this are
DH_check_ex() and EVP_PKEY_param_check().

CVE-2023-3446

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21451)

(cherry picked from commit 9e0094e2aa1b3428a12d5095132f133c078d3c3d)
Signed-off-by: code4lala <fengziteng2@huawei.com>
2023-07-20 15:48:47 +08:00
Dmitry Belyavskiy b38bd22436 Fix Timing Oracle in RSA decryption
A timing based side channel exists in the OpenSSL RSA Decryption
implementation which could be sufficient to recover a plaintext across
a network in a Bleichenbacher style attack. To achieve a successful
decryption an attacker would have to be able to send a very large number
of trial messages for decryption. The vulnerability affects all RSA
padding modes: PKCS#1 v1.5, RSA-OEAP and RSASVE.

Patch written by Dmitry Belyavsky and Hubert Kario

CVE-2022-4304

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Signed-off-by: code4lala <fengziteng2@huawei.com>
Change-Id: Ib81f15484fa3374bf5f50baece50bb36d105d6d7
2023-04-26 14:20:29 +08:00
slontis c571280a0f Fix NULL deference when validating FFC public key.
Fixes CVE-2023-0217

When attempting to do a BN_Copy of params->p there was no NULL check.
Since BN_copy does not check for NULL this is a NULL reference.

As an aside BN_cmp() does do a NULL check, so there are other checks
that fail because a NULL is passed. A more general check for NULL params
has been added for both FFC public and private key validation instead.

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Signed-off-by: code4lala <fengziteng2@huawei.com>
Change-Id: I7086365d9f51b6f36fcfb79a45d36f8d032e1f22
2023-04-26 14:20:20 +08:00
Hugo Landau a8ad5a9d67 CVE-2023-0286: Fix GENERAL_NAME_cmp for x400Address (3.0)
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Change-Id: If27a355635b2da681abac1d757386a5c9dfcdae3
Signed-off-by: code4lala <fengziteng2@huawei.com>
2023-04-26 14:14:12 +08:00
code4lala 393e3604f5 tar -xf openssl-openssl-3.0.7.tar.gz
Signed-off-by: code4lala <fengziteng2@huawei.com>
2023-04-12 11:12:14 +08:00
code4lala 05d2ef44d1 rm all
Signed-off-by: code4lala <fengziteng2@huawei.com>
2023-04-12 11:12:06 +08:00
Matt Caswell 628eb60bf5 Fix Timing Oracle in RSA decryption
A timing based side channel exists in the OpenSSL RSA Decryption
implementation which could be sufficient to recover a plaintext across
a network in a Bleichenbacher style attack. To achieve a successful
decryption an attacker would have to be able to send a very large number
of trial messages for decryption. The vulnerability affects all RSA
padding modes: PKCS#1 v1.5, RSA-OEAP and RSASVE.

Patch written by Dmitry Belyavsky and Hubert Kario

CVE-2022-4304

Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Signed-off-by: code4lala <fengziteng2@huawei.com>
2023-02-10 10:33:33 +08:00
Hugo Landau a95a2d14f9 CVE-2023-0286: Fix GENERAL_NAME_cmp for x400Address (1.1.1)
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Signed-off-by: code4lala <fengziteng2@huawei.com>
2023-02-10 10:33:17 +08:00
zhao_zhen_zhou 9fc77853dd 版本1.1.1k升级到1.1.ln并兼容MUSL
Signed-off-by: zhao_zhen_zhou <zhaozhenzhou@huawei.com>
2022-07-01 04:57:51 -07:00
wanghaixiang 78825ddaea [PATCH]CVE-2021-3711 and CVE-2021-3712
Signed-off-by: wanghaixiang <wanghaixiang@huawei.com>
2021-09-02 21:09:58 +08:00
HJ 0b759159b9 huangjun42@huawei.com
Signed-off-by: HJ <huangjun42@huawei.com>
2021-08-10 16:32:34 +08:00
mamingshuai 4f45966ee9 update openharmony 1.0.1 2021-03-11 20:38:52 +08:00
h00416433 ab6439910d Merge branch 'upstream/OpenSSL_1_1_1f' into hj20200529
Conflicts:
	CHANGES
	CONTRIBUTING
	Configurations/50-win-onecore.conf
	Configurations/90-team.norelease.conf
	Configurations/unix-Makefile.tmpl
	Configure
	NEWS
	NOTES.ANDROID
	README
	apps/rehash.c
	apps/s_cb.c
	apps/s_server.c
	apps/speed.c
	config
	crypto/aes/asm/aes-s390x.pl
	crypto/aes/asm/aesni-x86_64.pl
	crypto/aes/asm/aesp8-ppc.pl
	crypto/aes/asm/aesv8-armx.pl
	crypto/aes/asm/vpaes-armv8.pl
	crypto/aes/asm/vpaes-x86_64.pl
	crypto/asn1/charmap.h
	crypto/asn1/x_bignum.c
	crypto/bio/b_addr.c
	crypto/bio/bss_file.c
	crypto/bn/asm/armv8-mont.pl
	crypto/bn/asm/mips.pl
	crypto/bn/asm/ppc.pl
	crypto/bn/asm/rsaz-avx2.pl
	crypto/bn/asm/rsaz-x86_64.pl
	crypto/bn/asm/x86_64-mont5.pl
	crypto/bn/bn_local.h
	crypto/bn/bn_prime.c
	crypto/bn/bn_prime.h
	crypto/chacha/asm/chacha-armv8.pl
	crypto/cms/cms_att.c
	crypto/conf/conf_def.h
	crypto/conf/conf_lib.c
	crypto/dh/dh_gen.c
	crypto/dso/dso_dlfcn.c
	crypto/ec/asm/ecp_nistz256-armv8.pl
	crypto/ec/asm/ecp_nistz256-sparcv9.pl
	crypto/ec/asm/ecp_nistz256-x86_64.pl
	crypto/ec/asm/x25519-ppc64.pl
	crypto/ec/ec_asn1.c
	crypto/ec/ec_local.h
	crypto/ec/ecp_nistp224.c
	crypto/ec/ecp_nistp256.c
	crypto/ec/ecp_nistp521.c
	crypto/ec/ecp_nistz256.c
	crypto/ec/ecx_meth.c
	crypto/engine/eng_openssl.c
	crypto/err/err.c
	crypto/err/openssl.txt
	crypto/evp/e_aes.c
	crypto/evp/evp_err.c
	crypto/hmac/hmac.c
	crypto/modes/asm/ghash-x86_64.pl
	crypto/objects/obj_dat.h
	crypto/objects/obj_xref.h
	crypto/perlasm/x86_64-xlate.pl
	crypto/poly1305/asm/poly1305-armv8.pl
	crypto/ppccpuid.pl
	crypto/rand/drbg_lib.c
	crypto/rand/rand_err.c
	crypto/rand/rand_lib.c
	crypto/rand/rand_local.h
	crypto/rand/rand_unix.c
	crypto/rand/rand_vms.c
	crypto/rsa/rsa_ossl.c
	crypto/rsa/rsa_pk1.c
	crypto/rsa/rsa_pmeth.c
	crypto/rsa/rsa_ssl.c
	crypto/sha/asm/keccak1600-armv4.pl
	crypto/sha/asm/keccak1600-armv8.pl
	crypto/sha/asm/sha512-armv8.pl
	crypto/sha/asm/sha512-sparcv9.pl
	crypto/threads_none.c
	crypto/threads_win.c
	crypto/x509/x509_cmp.c
	crypto/x509/x509_vfy.c
	crypto/x509/x_crl.c
	crypto/x509v3/v3_purp.c
	doc/HOWTO/proxy_certificates.txt
	doc/man1/enc.pod
	doc/man1/s_client.pod
	doc/man1/x509.pod
	doc/man3/BN_generate_prime.pod
	doc/man3/CRYPTO_memcmp.pod
	doc/man3/EC_GROUP_copy.pod
	doc/man3/EVP_DigestSignInit.pod
	doc/man3/EVP_DigestVerifyInit.pod
	doc/man3/EVP_PKEY_new.pod
	doc/man3/EVP_SignInit.pod
	doc/man3/OPENSSL_malloc.pod
	doc/man3/RAND_bytes.pod
	doc/man3/RAND_set_rand_method.pod
	doc/man3/RSA_get0_key.pod
	doc/man3/SSL_SESSION_get0_hostname.pod
	doc/man3/SSL_get_error.pod
	doc/man3/X509_LOOKUP_meth_new.pod
	doc/man3/X509_STORE_add_cert.pod
	doc/man3/X509_cmp.pod
	doc/man3/X509_get_extension_flags.pod
	doc/man3/d2i_X509.pod
	doc/man5/config.pod
	doc/man7/Ed25519.pod
	doc/man7/X25519.pod
	e_os.h
	engines/e_afalg.c
	include/crypto/dso_conf.h.in
	include/internal/constant_time.h
	include/openssl/bio.h
	include/openssl/evperr.h
	include/openssl/lhash.h
	include/openssl/obj_mac.h
	include/openssl/opensslv.h
	include/openssl/randerr.h
	include/openssl/sslerr.h
	krb5
	ssl/record/rec_layer_s3.c
	ssl/s3_lib.c
	ssl/ssl_lib.c
	ssl/ssl_local.h
	ssl/statem/extensions.c
	ssl/statem/extensions_srvr.c
	ssl/statem/statem_lib.c
	ssl/statem/statem_srvr.c
	ssl/t1_lib.c
	ssl/tls13_enc.c
	test/bio_memleak_test.c
	test/bntest.c
	test/build.info
	test/certs/root-cert-rsa2.pem
	test/certs/server-pss-restrict-cert.pem
	test/certs/server-pss-restrict-key.pem
	test/certs/setup.sh
	test/dtlstest.c
	test/ec_internal_test.c
	test/ecdsatest.h
	test/ectest.c
	test/evp_extra_test.c
	test/recipes/02-test_errstr.t
	test/recipes/03-test_internal_ec.t
	test/recipes/30-test_evp_data/evpccmcavs.txt
	test/recipes/80-test_cms_data/bad_signtime_attr.cms
	test/recipes/80-test_cms_data/ct_multiple_attr.cms
	test/recipes/80-test_cms_data/no_ct_attr.cms
	test/recipes/80-test_cms_data/no_md_attr.cms
	test/recipes/90-test_bio_memleak.t
	test/recipes/90-test_includes_data/includes-eq-ws.cnf
	test/recipes/90-test_includes_data/includes-eq.cnf
	test/shlibloadtest.c
	test/ssl-tests/29-dtls-sctp-label-bug.conf
	test/ssl-tests/29-dtls-sctp-label-bug.conf.in
	test/sslapitest.c
	test/testutil.h
	test/testutil/random.c
	util/cavs-to-evptest.pl
	util/libcrypto.num
	util/perl/OpenSSL/Test.pm
	util/perl/TLSProxy/CertificateRequest.pm

Change-Id: I388e77b9fc937720aaf18841949f5f954ef2131b
2020-06-16 09:25:29 +08:00
h00416433 cc71421878 TicketNo:DTS2020052516463
Description:use openssl asm mode
Team:OTHERS
Feature or Bugfix:Bugfix
Binary Source:No
PrivateCode(Yes/No):No

Change-Id: Id449bd200b5e2ef817ac329fc6874190bc245ad4
Reviewed-on: http://mgit-tm.rnd.huawei.com/9083098
Reviewed-by: houyuezhou 00386575 <hou@huawei.com>
Tested-by: public jenkins <public_jenkins@notesmail.huawei.com>
Reviewed-by: linyibin 00246405 <linyibin@huawei.com>
2020-05-31 18:18:42 +08:00
h00416433 daef663ca0 TicketNo:DTS2020051901498
Description:openssl support to build by arm
Team:OTHERS
Feature or Bugfix:Bugfix
Binary Source:No
PrivateCode(Yes/No):No

Change-Id: Iedde66caa66b2baa5c1a4508240849da0e434efd
Reviewed-on: http://mgit-tm.rnd.huawei.com/8910856
Reviewed-by: dongjinguang 00268009 <dongjinguang@huawei.com>
Reviewed-by: houyuezhou 00386575 <hou@huawei.com>
Tested-by: public jenkins <public_jenkins@notesmail.huawei.com>
Reviewed-by: linyibin 00246405 <linyibin@huawei.com>
2020-05-20 14:15:30 +08:00
Matt Caswell 36eadf1f84 Prepare for 1.1.1f release
Reviewed-by: Richard Levitte <levitte@openssl.org>
2020-03-31 13:17:45 +01:00
Matt Caswell c855c9c05a Update copyright year
Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/11445)
2020-03-31 13:09:37 +01:00
Tomas Mraz 30d190caf3 Partially revert "Detect EOF while reading in libssl"
This partially reverts commit db943f43a6.

Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/11400)
2020-03-25 14:17:22 +01:00
Matt Caswell 9e1eaa4a40 Prepare for 1.1.1f-dev
Reviewed-by: Paul Yang <kaishen.yy@antfin.com>
2020-03-17 14:32:46 +00:00
Matt Caswell a61eba4814 Prepare for 1.1.1e release
Reviewed-by: Paul Yang <kaishen.yy@antfin.com>
2020-03-17 14:31:17 +00:00
Matt Caswell e7ff223a20 Update copyright year
Reviewed-by: Paul Yang <kaishen.yy@antfin.com>
(Merged from https://github.com/openssl/openssl/pull/11344)
2020-03-17 13:59:29 +00:00
Benjamin Kaduk 44bad9cbf7 Code to thread-safety in ChangeCipherState
The server-side ChangeCipherState processing stores the new cipher
in the SSL_SESSION object, so that the new state can be used if
this session gets resumed.  However, writing to the session is only
thread-safe for initial handshakes, as at other times the session
object may be in a shared cache and in use by another thread at the
same time.  Reflect this invariant in the code by only writing to
s->session->cipher when it is currently NULL (we do not cache sessions
with no cipher).  The code prior to this change would never actually
change the (non-NULL) cipher value in a session object, since our
server enforces that (pre-TLS-1.3) resumptions use the exact same
cipher as the initial connection, and non-abbreviated renegotiations
have produced a new session object before we get to this point.
Regardless, include logic to detect such a condition and abort the
handshake if it occurs, to avoid any risk of inadvertently using
the wrong cipher on a connection.

Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
(Merged from https://github.com/openssl/openssl/pull/10943)

(cherry picked from commit 2e3ec2e1578977fca830a47fd7f521e290540e6d)
2020-03-13 16:11:45 -07:00
h00416433 cf46376e29 TicketNo:AR000DI992
Description:openssl 1.1.1d used bu libhapverify
Team:OTHERS
Feature or Bugfix:Feature
Binary Source:Yes, it is
PrivateCode(Yes/No):No

Change-Id: I8968f9c0f146b587da17a3e603bd04fb7b4c505b
Reviewed-on: http://mgit-tm.rnd.huawei.com/7842784
Tested-by: public jenkins <public_jenkins@notesmail.huawei.com>
Reviewed-by: houyuezhou 00386575 <hou@huawei.com>
Reviewed-by: linyibin 00246405 <linyibin@huawei.com>
Reviewed-by: weiping 00548480 <ping.wei@huawei.com>
2020-02-27 13:52:11 +08:00
Richard Levitte 605a0c709f VMS: mitigate for the C++ compiler that doesn't understand certain pragmas
This only affects __DECC_INCLUDE_EPILOGUE.H and __DECC_INCLUDE_PROLOGUE.H,
which are used automatically by HP and VSI C/C++ compilers.

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
(Merged from https://github.com/openssl/openssl/pull/11159)
2020-02-27 01:21:50 +01:00
Matt Caswell db943f43a6 Detect EOF while reading in libssl
If we hit an EOF while reading in libssl then we will report an error
back to the application (SSL_ERROR_SYSCALL) but errno will be 0. We add
an error to the stack (which means we instead return SSL_ERROR_SSL) and
therefore give a hint as to what went wrong.

Contains a partial fix for #10880

Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/10882)
2020-02-20 17:02:30 +00:00
Richard Levitte cd5acbb475 VMS: Correct error reporting in crypto/rand/rand_vms.c
The future style that's coming with OpenSSL 3.0 was used, we need to
revert that back to "traditional" style.

Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/11088)
2020-02-15 06:48:04 +01:00
Pauli 3948408f2a Coverity CID 1444960: Error handling issues
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/8888)

(cherry picked from commit a05bf83c7964bb3928b323fe356b9f70f105036d)
2020-02-06 17:21:20 +01:00
Davide Galassi b04c8c06a6 Prevent compiler warning for unused static function.
Prepend missing ossl_unused in front of lh_type_new to make the compiler
happy.

CLA: trivial

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
(Merged from https://github.com/openssl/openssl/pull/10946)

(cherry picked from commit 7b6a746721170a21519c38798041be8101e7361f)
2020-02-06 16:43:59 +01:00
Matt Caswell 2c52a36400 Run make update
The New Year has caused various files to appear out of date to "make
update". This causes Travis to fail. Therefore we update those files.

Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
(Merged from https://github.com/openssl/openssl/pull/10739)
2020-01-02 14:45:04 +00:00
Matt Caswell c1ebe0509a Backport the RSA_get0_pss_params() function from master
This is a missing accessor in order to obtain PSS parameters from an
RSA key, which should also be available in 1.1.1.

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
(Merged from https://github.com/openssl/openssl/pull/10568)
2019-12-16 14:50:07 +00:00
Dr. Matthias St. Pierre f9fdb9d2f5 rand_lib.c: fix null pointer dereferences after RAND_get_rand_method() failure
RAND_get_rand_method() can return a NULL method pointer in the case of a
malloc failure, so don't dereference it without a check.

Reported-by: Zu-Ming Jiang (detected by FIFUZZ)

Fixes #10480

Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/10490)
2019-12-15 15:25:18 +01:00
Anthony Hu 460a0b2b13 Add missing EVP_PKEY_METHOD accessors for digestsign and digestverify
Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
(Merged from https://github.com/openssl/openssl/pull/10388)

(cherry picked from commit 2555285fa5e4248ad4a5a0bc14ae4606443856c2)
2019-11-17 11:51:10 +01:00
z00416851 68b4f9db72 TicketNo:AR000D76VD
Description:openssl开源社区安全补丁
Team:EMUI
Feature or Bugfix:Feature
Binary Source:NA
PrivateCode(Yes/No):No

Change-Id: Ia942e70461a3a5337de001ab0f40604776fe8f91
Reviewed-on: http://mgit-tm.rnd.huawei.com/6664137
Tested-by: public jenkins <public_jenkins@notesmail.huawei.com>
Reviewed-by: yanglijun 00294367 <yanglijun@huawei.com>
Reviewed-by: luomeiling 00216346 <luomeiling@huawei.com>
Reviewed-by: shenchunlong 00356424 <shenchunlong@huawei.com>
2019-11-08 15:44:13 +08:00
Matt Caswell 7bcd13cebd Fix an incorrect macro
A macro was missing a space which was confusing find-doc-nits

Reviewed-by: Richard Levitte <levitte@openssl.org>

(cherry picked from commit 8caab503ba004abb555d636c1ca9f7bcde79657f)

Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
(Merged from https://github.com/openssl/openssl/pull/10094)
2019-10-15 16:04:47 +02:00
David Benjamin 44301079c8 Document and add macros for additional DSA options
EVP_PKEY_CTRL_DSA_PARAMGEN_Q_BITS and EVP_PKEY_CTRL_DSA_PARAMGEN_MD are only
exposed from EVP_PKEY_CTX_ctrl, which means callers must write more error-prone
code (see also issue #1319). Add the missing wrapper macros and document them.

Reviewed-by: Matt Caswell <matt@openssl.org>

(cherry picked from commit a97faad76a1be22eadd6c1a39972ad5e095d9e80)

Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
(Merged from https://github.com/openssl/openssl/pull/10094)
2019-10-15 16:04:46 +02:00
Michael Osipov 9e2747646d Fix long name of some Microsoft objects
CLA: trivial

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

(cherry picked from commit 648b53b88ea55b4c2f2c8c57d041075731db5f95)
2019-10-03 08:26:27 +10:00
Dr. Matthias St. Pierre fbbfd128c9 Fix header file include guard names
Make the include guards consistent by renaming them systematically according
to the naming conventions below

The public header files (in the 'include/openssl' directory) are not changed
in 1.1.1, because it is a stable release.

For the private header files files, the guard names try to match the path
specified in the include directives, with all letters converted to upper case
and '/' and '.' replaced by '_'. An extra 'OSSL_' is added as prefix.

Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/9681)
2019-09-27 23:58:12 +02:00