提交 3bfc585f 编写于 作者: Z zhao_zhen_zhou

版本1.1.1k升级到1.1.ln并兼容MUSL

Signed-off-by: Nzhao_zhen_zhou <zhaozhenzhou@huawei.com>
上级 253505b9
......@@ -76,6 +76,26 @@ config("crypto_config") {
"-DECP_NISTZ256_ASM",
"-DPOLY1305_ASM",
]
} else if (current_cpu == "x86_64" && current_os != "mingw") {
cflags += [
"-DOPENSSL_CPUID_OBJ",
"-DOPENSSL_BN_ASM_MONT",
"-DSHA1_ASM",
"-DSHA256_ASM",
"-DSHA512_ASM",
"-DKECCAK1600_ASM",
"-DVPAES_ASM",
"-DECP_NISTZ256_ASM",
"-DPOLY1305_ASM",
"-DOPENSSL_IA32_SSE2",
"-DOPENSSL_BN_ASM_MONT5",
"-DOPENSSL_BN_ASM_GF2m",
"-DRC4_ASM",
"-DMD5_ASM",
"-DAESNI_ASM",
"-DGHASH_ASM",
"-DX25519_ASM",
]
} else if (is_mingw) {
cflags -= [
"-fPIC",
......@@ -89,6 +109,9 @@ config("crypto_config") {
cflags += [
"-m64",
"-DL_ENDIAN",
"-DOPENSSL_NO_ASM",
"-DOPENSSL_NO_MDC2",
"-DOPENSSL_NO_IDEA",
"-DUNICODE",
"-D_UNICODE",
"-DWIN32_LEAN_AND_MEAN",
......@@ -115,6 +138,7 @@ config("crypto_config") {
}
cflags += [
"-DL_ENDIAN",
"-DOPENSSL_NO_ASM",
"-D_REENTRAN",
"-MMD",
"-MF",
......@@ -133,6 +157,8 @@ config("crypto_config_public") {
} else if (current_cpu == "arm64" &&
!(current_os == "linux" || host_os == "mac")) {
cflags = [ "-DOPENSSL_ARM64_PLATFORM" ]
} else if (current_cpu == "x86_64" && current_os != "mingw") {
cflags = [ "-DOPENSSL_X86_64_PLATFORM" ]
} else if (is_mingw) {
cflags = [ "-DWINDOWS_PLATFORM" ]
} else if (current_os == "linux" || host_os == "mac") {
......@@ -752,18 +778,18 @@ ohos_source_set("crypto_source") {
"crypto/aes/asm/arm32/bsaes-armv7.S",
"crypto/armcap.c",
"crypto/armv4cpuid.S",
"crypto/bn/armv4-gf2m.S",
"crypto/bn/armv4-mont.S",
"crypto/chacha/chacha-armv4.S",
"crypto/ec/ecp_nistz256-armv4.S",
"crypto/bn/asm/arm32/armv4-gf2m.S",
"crypto/bn/asm/arm32/armv4-mont.S",
"crypto/chacha/asm/arm32/chacha-armv4.S",
"crypto/ec/asm/arm32/ecp_nistz256-armv4.S",
"crypto/ec/ecp_nistz256.c",
"crypto/modes/asm/arm32/ghash-armv4.S",
"crypto/modes/asm/arm32/ghashv8-armx.S",
"crypto/poly1305/poly1305-armv4.S",
"crypto/sha/keccak1600-armv4.S",
"crypto/sha/sha1-armv4-large.S",
"crypto/sha/sha256-armv4.S",
"crypto/sha/sha512-armv4.S",
"crypto/poly1305/asm/arm32/poly1305-armv4.S",
"crypto/sha/asm/arm32/keccak1600-armv4.S",
"crypto/sha/asm/arm32/sha1-armv4-large.S",
"crypto/sha/asm/arm32/sha256-armv4.S",
"crypto/sha/asm/arm32/sha512-armv4.S",
]
} else if (current_cpu == "arm64" &&
!(current_os == "linux" || host_os == "mac")) {
......@@ -773,16 +799,92 @@ ohos_source_set("crypto_source") {
"crypto/aes/asm/arm64/vpaes-armv8.S",
"crypto/arm64cpuid.S",
"crypto/armcap.c",
"crypto/bn/armv8-mont.S",
"crypto/chacha/chacha-armv8.S",
"crypto/ec/ecp_nistz256-armv8.S",
"crypto/bn/asm/arm64/armv8-mont.S",
"crypto/chacha/asm/arm64/chacha-armv8.S",
"crypto/ec/asm/arm64/ecp_nistz256-armv8.S",
"crypto/ec/ecp_nistz256.c",
"crypto/modes/asm/arm64/ghashv8-armx.S",
"crypto/poly1305/poly1305-armv8.S",
"crypto/sha/keccak1600-armv8.S",
"crypto/sha/sha1-armv8.S",
"crypto/sha/sha256-armv8.S",
"crypto/sha/sha512-armv8.S",
"crypto/poly1305/asm/arm64/poly1305-armv8.S",
"crypto/sha/asm/arm64/keccak1600-armv8.S",
"crypto/sha/asm/arm64/sha1-armv8.S",
"crypto/sha/asm/arm64/sha256-armv8.S",
"crypto/sha/asm/arm64/sha512-armv8.S",
]
} else if (current_cpu == "x86_64" && current_os != "mingw") {
sources -= [
"crypto/rc4/rc4_enc.c",
"crypto/rc4/rc4_skey.c",
"crypto/whrlpool/wp_block.c",
]
sources += [
"crypto/aes/aes_core.c",
"crypto/aes/asm/x86_64/aesni-mb-x86_64.s",
"crypto/aes/asm/x86_64/aesni-sha1-x86_64.s",
"crypto/aes/asm/x86_64/aesni-sha256-x86_64.s",
"crypto/aes/asm/x86_64/aesni-x86_64.s",
"crypto/aes/asm/x86_64/vpaes-x86_64.s",
"crypto/bn/asm/x86_64/rsaz-avx2.s",
"crypto/bn/asm/x86_64/rsaz-x86_64.s",
"crypto/bn/asm/x86_64/x86_64-gf2m.s",
"crypto/bn/asm/x86_64/x86_64-mont.s",
"crypto/bn/asm/x86_64/x86_64-mont5.s",
"crypto/bn/rsaz_exp.c",
"crypto/chacha/asm/x86_64/chacha-x86_64.s",
"crypto/ec/asm/x86_64/ecp_nistz256-x86_64.s",
"crypto/ec/asm/x86_64/x25519-x86_64.s",
"crypto/ec/ecp_nistz256.c",
"crypto/md5/asm/x86_64/md5-x86_64.s",
"crypto/modes/asm/x86_64/aesni-gcm-x86_64.s",
"crypto/modes/asm/x86_64/ghash-x86_64.s",
"crypto/poly1305/asm/x86_64/poly1305-x86_64.s",
"crypto/rc4/asm/x86_64/rc4-md5-x86_64.s",
"crypto/rc4/asm/x86_64/rc4-x86_64.s",
"crypto/sha/asm/x86_64/keccak1600-x86_64.s",
"crypto/sha/asm/x86_64/sha1-mb-x86_64.s",
"crypto/sha/asm/x86_64/sha1-x86_64.s",
"crypto/sha/asm/x86_64/sha256-mb-x86_64.s",
"crypto/sha/asm/x86_64/sha256-x86_64.s",
"crypto/sha/asm/x86_64/sha512-x86_64.s",
"crypto/whrlpool/asm/x86_64/wp-x86_64.s",
"crypto/x86_64cpuid.s",
]
} else if (current_cpu == "x86_64" && current_os != "mingw") {
sources -= [
"crypto/rc4/rc4_enc.c",
"crypto/rc4/rc4_skey.c",
"crypto/whrlpool/wp_block.c",
]
sources += [
"crypto/aes/aes_core.c",
"crypto/aes/asm/x86_64/aesni-mb-x86_64.s",
"crypto/aes/asm/x86_64/aesni-sha1-x86_64.s",
"crypto/aes/asm/x86_64/aesni-sha256-x86_64.s",
"crypto/aes/asm/x86_64/aesni-x86_64.s",
"crypto/aes/asm/x86_64/vpaes-x86_64.s",
"crypto/bn/asm/x86_64/rsaz-avx2.s",
"crypto/bn/asm/x86_64/rsaz-x86_64.s",
"crypto/bn/asm/x86_64/x86_64-gf2m.s",
"crypto/bn/asm/x86_64/x86_64-mont.s",
"crypto/bn/asm/x86_64/x86_64-mont5.s",
"crypto/bn/rsaz_exp.c",
"crypto/chacha/asm/x86_64/chacha-x86_64.s",
"crypto/ec/asm/x86_64/ecp_nistz256-x86_64.s",
"crypto/ec/asm/x86_64/x25519-x86_64.s",
"crypto/ec/ecp_nistz256.c",
"crypto/md5/asm/x86_64/md5-x86_64.s",
"crypto/modes/asm/x86_64/aesni-gcm-x86_64.s",
"crypto/modes/asm/x86_64/ghash-x86_64.s",
"crypto/poly1305/asm/x86_64/poly1305-x86_64.s",
"crypto/rc4/asm/x86_64/rc4-md5-x86_64.s",
"crypto/rc4/asm/x86_64/rc4-x86_64.s",
"crypto/sha/asm/x86_64/keccak1600-x86_64.s",
"crypto/sha/asm/x86_64/sha1-mb-x86_64.s",
"crypto/sha/asm/x86_64/sha1-x86_64.s",
"crypto/sha/asm/x86_64/sha256-mb-x86_64.s",
"crypto/sha/asm/x86_64/sha256-x86_64.s",
"crypto/sha/asm/x86_64/sha512-x86_64.s",
"crypto/whrlpool/asm/x86_64/wp-x86_64.s",
"crypto/x86_64cpuid.s",
]
} else if (is_mingw || (current_os == "linux" || host_os == "mac")) {
sources += [
......@@ -908,6 +1010,8 @@ config("ssl_config") {
} else if (current_cpu == "arm64" &&
!(current_os == "linux" || host_os == "mac")) {
cflags += [ "-DOPENSSL_ARM64_PLATFORM" ]
} else if (current_cpu == "x86_64" && current_os != "mingw") {
cflags += [ "-DOPENSSL_X86_64_PLATFORM" ]
} else if (is_mingw) {
cflags -= [ "-fPIC" ]
cflags += [
......
......@@ -7,6 +7,128 @@
https://github.com/openssl/openssl/commits/ and pick the appropriate
release branch.
Changes between 1.1.1m and 1.1.1n [15 Mar 2022]
*) Fixed a bug in the BN_mod_sqrt() function that can cause it to loop forever
for non-prime moduli.
Internally this function is used when parsing certificates that contain
elliptic curve public keys in compressed form or explicit elliptic curve
parameters with a base point encoded in compressed form.
It is possible to trigger the infinite loop by crafting a certificate that
has invalid explicit curve parameters.
Since certificate parsing happens prior to verification of the certificate
signature, any process that parses an externally supplied certificate may
thus be subject to a denial of service attack. The infinite loop can also
be reached when parsing crafted private keys as they can contain explicit
elliptic curve parameters.
Thus vulnerable situations include:
- TLS clients consuming server certificates
- TLS servers consuming client certificates
- Hosting providers taking certificates or private keys from customers
- Certificate authorities parsing certification requests from subscribers
- Anything else which parses ASN.1 elliptic curve parameters
Also any other applications that use the BN_mod_sqrt() where the attacker
can control the parameter values are vulnerable to this DoS issue.
(CVE-2022-0778)
[Tomáš Mráz]
*) Add ciphersuites based on DHE_PSK (RFC 4279) and ECDHE_PSK (RFC 5489)
to the list of ciphersuites providing Perfect Forward Secrecy as
required by SECLEVEL >= 3.
[Dmitry Belyavskiy, Nicola Tuveri]
Changes between 1.1.1l and 1.1.1m [14 Dec 2021]
*) Avoid loading of a dynamic engine twice.
[Bernd Edlinger]
*) Fixed building on Debian with kfreebsd kernels
[Mattias Ellert]
*) Prioritise DANE TLSA issuer certs over peer certs
[Viktor Dukhovni]
*) Fixed random API for MacOS prior to 10.12
These MacOS versions don't support the CommonCrypto APIs
[Lenny Primak]
Changes between 1.1.1k and 1.1.1l [24 Aug 2021]
*) Fixed an SM2 Decryption Buffer Overflow.
In order to decrypt SM2 encrypted data an application is expected to call the
API function EVP_PKEY_decrypt(). Typically an application will call this
function twice. The first time, on entry, the "out" parameter can be NULL and,
on exit, the "outlen" parameter is populated with the buffer size required to
hold the decrypted plaintext. The application can then allocate a sufficiently
sized buffer and call EVP_PKEY_decrypt() again, but this time passing a non-NULL
value for the "out" parameter.
A bug in the implementation of the SM2 decryption code means that the
calculation of the buffer size required to hold the plaintext returned by the
first call to EVP_PKEY_decrypt() can be smaller than the actual size required by
the second call. This can lead to a buffer overflow when EVP_PKEY_decrypt() is
called by the application a second time with a buffer that is too small.
A malicious attacker who is able present SM2 content for decryption to an
application could cause attacker chosen data to overflow the buffer by up to a
maximum of 62 bytes altering the contents of other data held after the
buffer, possibly changing application behaviour or causing the application to
crash. The location of the buffer is application dependent but is typically
heap allocated.
(CVE-2021-3711)
[Matt Caswell]
*) Fixed various read buffer overruns processing ASN.1 strings
ASN.1 strings are represented internally within OpenSSL as an ASN1_STRING
structure which contains a buffer holding the string data and a field holding
the buffer length. This contrasts with normal C strings which are repesented as
a buffer for the string data which is terminated with a NUL (0) byte.
Although not a strict requirement, ASN.1 strings that are parsed using OpenSSL's
own "d2i" functions (and other similar parsing functions) as well as any string
whose value has been set with the ASN1_STRING_set() function will additionally
NUL terminate the byte array in the ASN1_STRING structure.
However, it is possible for applications to directly construct valid ASN1_STRING
structures which do not NUL terminate the byte array by directly setting the
"data" and "length" fields in the ASN1_STRING array. This can also happen by
using the ASN1_STRING_set0() function.
Numerous OpenSSL functions that print ASN.1 data have been found to assume that
the ASN1_STRING byte array will be NUL terminated, even though this is not
guaranteed for strings that have been directly constructed. Where an application
requests an ASN.1 structure to be printed, and where that ASN.1 structure
contains ASN1_STRINGs that have been directly constructed by the application
without NUL terminating the "data" field, then a read buffer overrun can occur.
The same thing can also occur during name constraints processing of certificates
(for example if a certificate has been directly constructed by the application
instead of loading it via the OpenSSL parsing functions, and the certificate
contains non NUL terminated ASN1_STRING structures). It can also occur in the
X509_get1_email(), X509_REQ_get1_email() and X509_get1_ocsp() functions.
If a malicious actor can cause an application to directly construct an
ASN1_STRING and then process it through one of the affected OpenSSL functions
then this issue could be hit. This might result in a crash (causing a Denial of
Service attack). It could also result in the disclosure of private memory
contents (such as private keys, or sensitive plaintext).
(CVE-2021-3712)
[Matt Caswell]
Changes between 1.1.1j and 1.1.1k [25 Mar 2021]
*) Fixed a problem with verifying a certificate chain when using the
......
Copyright 2016 The OpenSSL Project Authors. All Rights Reserved.
Copyright 1995-2017 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved.
Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2017-2018 The OpenSSL Project Authors. All Rights Reserved.
Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2012-2017 The OpenSSL Project Authors. All Rights Reserved.
Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2000-2018 The OpenSSL Project Authors. All Rights Reserved.
Copyright 1999-2018 The OpenSSL Project Authors. All Rights Reserved.
Copyright 1999-2016 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2001-2020 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2011-2016 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2013-2016 The OpenSSL Project Authors. All Rights Reserved.
Copyright Patrick Powell 1995
Copyright 2019-2021 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2019-2020 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2018-2021 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2018-2020 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2018-2019 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2018 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2017-2022 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2017-2021 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2017-2020 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2017-2019 The OpenSSL Project Authors. All Rights Reserved.
Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
Copyright 2006-2018 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2015-2019 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2004-2016 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2007-2016 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2017-2018 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2017 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2017 Ribose Inc. All Rights Reserved.
Copyright 2005-2016 The OpenSSL Project Authors. All Rights Reserved.
Copyright 1999-2020 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2015-2018 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2006-2016 The OpenSSL Project Authors. All Rights Reserved.
Copyright 1998-2020 The OpenSSL Project Authors. All Rights Reserved.
Copyright 1998-2018 The OpenSSL Project Authors. All Rights Reserved.
Copyright (C) 2017 National Security Research Institute. All Rights Reserved.
Copyright 2002-2016 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2008-2016 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2017 BaishanCloud. All rights reserved.
Copyright 2017 [Ribose Inc.](https://www.ribose.com). All Rights Reserved.
Copyright 2016-2022 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2016-2021 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2016-2019 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2012, Samuel Neves <sneves@dei.uc.pt>
Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2016-2017 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2011-2018 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2011-2020 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2001-2018 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2001-2016 The OpenSSL Project Authors. All Rights Reserved.
Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved
Copyright 2001-2017 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2001-2019 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2000-2020 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2018 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2002-2018 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2002-2019 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2016-2016 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2016 VMS Software, Inc. All Rights Reserved.
Copyright 2016 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2016 Cryptography Research, Inc.
Copyright 2015-2022 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2015-2021 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2015-2020 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2015-2019 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2015-2018 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2015-2017 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2015-2016 Cryptography Research, Inc.
Copyright 2015 Cryptography Research, Inc.
Copyright 2014-2021 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2014-2020 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2014-2019 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2004-2018 The OpenSSL Project Authors. All Rights Reserved.
Copyright (c) 2004, Richard Levitte <richard@levitte.org>
Copyright 2003-2016 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2018-2019 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2005-2019 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2014-2018 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2014-2017 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2014-2016 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2014-2016 Cryptography Research, Inc.
Copyright 2014 Cryptography Research, Inc.
Copyright 2013-2021 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2013-2020 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2013-2019 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2013-2018 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2013-2017 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2013-2016 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2013 M. J. Dominus.
Copyright 2012-2022 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2012-2021 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2012-2020 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2012-2019 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2012-2018 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2012-2017 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2012-2016 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2012, Samuel Neves <sneves@dei.uc.pt>
Copyright 2011-2021 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2011-2020 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2011-2019 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2011-2018 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2011-2017 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2011-2016 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2011 Google Inc.
Copyright 2010-2022 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2010-2021 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2010-2020 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2010-2019 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2010-2018 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2010-2016 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2009-2022 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2009-2021 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2009-2020 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2009-2019 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2009-2018 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2009-2016 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2008-2022 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2008-2021 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2008-2020 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2008-2019 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2008-2018 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2008-2016 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2007-2021 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2007-2020 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2007-2018 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2007-2016 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2006-2021 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2006-2020 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2006-2019 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2000-2017 The OpenSSL Project Authors. All Rights Reserved.
Copyright 1999-2017 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2006-2018 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2006-2017 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2017 BaishanCloud. All rights reserved.
Copyright 1999-2019 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2006-2016 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2006 NTT (Nippon Telegraph and Telephone Corporation) .
Copyright 2005-2021 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2005-2020 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2005-2019 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2005-2018 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2005-2017 The OpenSSL Project Authors. All Rights Reserved.
Copyright (C) 2006, Network Resonance, Inc. Copyright (C) 2011, RTFM, Inc.
Copyright 2012-2018 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2005-2016 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2005 Nokia. All rights reserved.
Copyright 2014-2016 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved.
Copyright (c) 2004, EdelKey Project. All Rights Reserved.
Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2004-2021 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2004-2020 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2004-2019 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2004-2018 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2004-2017 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2004-2016 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2004-2014, Akamai Technologies. All Rights Reserved.
Copyright 2003-2021 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2003-2020 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2003-2019 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2003-2018 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2003-2017 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2003-2016 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2002-2022 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2002-2021 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2002-2020 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2002-2019 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2002-2018 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2002-2017 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2002-2016 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2001-2022 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2001-2021 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2001-2020 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2001-2019 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2001-2018 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2001-2017 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2001-2016 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2000-2022 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2000-2021 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2000-2020 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2000-2019 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2014-2017 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2014-2018 The OpenSSL Project Authors. All Rights Reserved.
Copyright (c) 2012, Intel Corporation. All Rights Reserved.
Copyright 2013-2018 The OpenSSL Project Authors. All Rights Reserved.
Copyright Patrick Powell 1995
Copyright (c) 2017 National Security Research Institute. All rights reserved.
Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
Copyright 2008-2019 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2006-2020 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2015-2020 The OpenSSL Project Authors. All Rights Reserved.
Copyright (c) 2013-2014 Timo Teräs <timo.teras@gmail.com>
Copyright 2000-2018 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2000-2017 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved.
Copyright 1999-2022 The OpenSSL Project Authors. All Rights Reserved.
Copyright 1999-2021 The OpenSSL Project Authors. All Rights Reserved.
Copyright 1999-2020 The OpenSSL Project Authors. All Rights Reserved.
Copyright 1999-2019 The OpenSSL Project Authors. All Rights Reserved.
Copyright 1999-2018 The OpenSSL Project Authors. All Rights Reserved.
Copyright 1999-2017 The OpenSSL Project Authors. All Rights Reserved.
Copyright 1999-2016 The OpenSSL Project Authors. All Rights Reserved.
Copyright 1998-2022 The OpenSSL Project Authors. All Rights Reserved.
Copyright 1998-2021 The OpenSSL Project Authors. All Rights Reserved.
Copyright 1998-2020 The OpenSSL Project Authors. All Rights Reserved.
Copyright 1998-2019 The OpenSSL Project Authors. All Rights Reserved.
Copyright 1998-2018 The OpenSSL Project Authors. All Rights Reserved.
Copyright 1998-2017 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2010-2016 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2016 VMS Software, Inc. All Rights Reserved.
Copyright 2012-2019 The OpenSSL Project Authors. All Rights Reserved.
Copyright 1998-2016 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2011-2019 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2010-2018 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2002-2020 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2010-2020 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2011 Google Inc.
Copyright 2014-2020 The OpenSSL Project Authors. All Rights Reserved.
Copyright (c) 2014, Intel Corporation. All Rights Reserved.
Copyright 1998-2001 The OpenSSL Project Authors. All Rights Reserved.
Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved.
Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved.
Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
Copyright 1995-2017 The OpenSSL Project Authors. All Rights Reserved.
Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
Copyright (C) 2017 National Security Research Institute. All Rights Reserved.
Copyright (c) 2017 National Security Research Institute. All rights reserved.
Copyright (c) 2017 National Security Research Institute. All rights reserved.
Copyright (c) 2016 Viktor Dukhovni <openssl-users@dukhovni.org>.
Copyright (c) 2015, CloudFlare, Inc.
Copyright 2015-2017 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2011-2017 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2002-2017 The OpenSSL Project Authors. All Rights Reserved.
Copyright (c) 2014, Intel Corporation. All Rights Reserved.
Copyright (c) 2013-2014 Timo Teräs <timo.teras@gmail.com>
Copyright (c) 2012-2016 Jean-Philippe Aumasson
Copyright (c) 2012-2014 Daniel J. Bernstein
Copyright (c) 2012, Intel Corporation. All Rights Reserved.
Copyright (c) 2008 Andy Polyakov <appro@openssl.org>
Copyright (c) 2007 KISA(Korea Information Security Agency). All rights reserved.
Copyright 2007-2018 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2003-2018 The OpenSSL Project Authors. All Rights Reserved.
Copyright (c) 2004 Kungliga Tekniska Högskolan
Copyright 2013-2017 The OpenSSL Project Authors. All Rights Reserved.
Copyright (c) 2016 Viktor Dukhovni <openssl-users@dukhovni.org>.
Copyright 1998-2001 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2015-2016 Cryptography Research, Inc.
Copyright 2015 Cryptography Research, Inc.
Copyright 2017-2020 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2014 Cryptography Research, Inc.
Copyright 2016 Cryptography Research, Inc.
Copyright 2014-2016 Cryptography Research, Inc.
Copyright 2006 NTT (Nippon Telegraph and Telephone Corporation) .
Copyright 1998-2019 The OpenSSL Project Authors. All Rights Reserved.
Copyright (C) 2006, Network Resonance, Inc.Copyright (C) 2011, RTFM, Inc.
Copyright (c) 2004, Richard Levitte <richard@levitte.org>
Copyright (c) 2004, EdelKey Project. All Rights Reserved.
Copyright (c) 2004, 2018, Richard Levitte <richard@levitte.org>
Copyright 2004-2014, Akamai Technologies. All Rights Reserved.
Copyright 2003-2019 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2009-2019 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2010-2019 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2005-2020 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2012-2016 The OpenSSL Project Authors. All Rights Reserved.
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
Copyright (c) 2004 Kungliga Tekniska Högskolan
Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved
Copyright (c) 2002 The OpenTSA Project. All rights reserved.
Copyright (C) 19yy <name of author>
Copyright 2008-2018 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2008-2020 The OpenSSL Project Authors. All Rights Reserved.
Copyright (c) 1998-2021 The OpenSSL Project
Copyright (c) 1998-2020 The OpenSSL Project
Copyright (c) 1998-2019 The OpenSSL Project. All rights reserved.
Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
Copyright (c) 1998-2020 The OpenSSL Project
Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson
Copyright (c) 2012-2016 Jean-Philippe Aumasson
Copyright (c) 2012-2014 Daniel J. Bernstein
Copyright 2013-2019 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2009-2018 The OpenSSL Project Authors. All Rights Reserved.
Copyright 1999-2021 The OpenSSL Project Authors. All Rights Reserved.
Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
\ No newline at end of file
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
......@@ -754,6 +754,13 @@ my %targets = (
multilib => "64",
},
# riscv64 below refers to contemporary RISCV Architecture
# specifications,
"linux64-riscv64" => {
inherit_from => [ "linux-generic64"],
perlasm_scheme => "linux64",
},
#### IA-32 targets...
#### These two targets are a bit aged and are to be used on older Linux
#### machines where gcc doesn't understand -m32 and -m64
......@@ -981,6 +988,13 @@ my %targets = (
perlasm_scheme => "elf",
},
# riscv64 below refers to contemporary RISCV Architecture
# specifications,
"BSD-riscv64" => {
inherit_from => [ "BSD-generic64"],
perlasm_scheme => "linux64",
},
"bsdi-elf-gcc" => {
inherit_from => [ "BASE_unix", asm("x86_elf_asm") ],
CC => "gcc",
......@@ -1758,7 +1772,7 @@ my %targets = (
disable => add('pinshared'),
apps_aux_src => "vms_term_sock.c",
apps_aux_src => "vms_term_sock.c vms_decc_argv.c",
apps_init_src => "vms_decc_init.c",
},
......
......@@ -29,18 +29,18 @@
$ndk = $ENV{$ndk_var};
last if defined $ndk;
}
die "\$ANDROID_NDK_HOME is not defined" if (!$ndk);
if (!-d "$ndk/platforms" && !-f "$ndk/AndroidVersion.txt") {
# $ndk/platforms is traditional "all-inclusive" NDK, while
# $ndk/AndroidVersion.txt is so-called standalone toolchain
# tailored for specific target down to API level.
die "\$ANDROID_NDK_HOME is not defined" if (!$ndk);
my $is_standalone_toolchain = -f "$ndk/AndroidVersion.txt";
my $ndk_src_props = "$ndk/source.properties";
my $is_ndk = -f $ndk_src_props;
if ($is_ndk == $is_standalone_toolchain) {
die "\$ANDROID_NDK_HOME=$ndk is invalid";
}
$ndk = canonpath($ndk);
my $ndkver = undef;
if (open my $fh, "<$ndk/source.properties") {
if (open my $fh, "<$ndk_src_props") {
local $_;
while(<$fh>) {
if (m|Pkg\.Revision\s*=\s*([0-9]+)|) {
......@@ -59,7 +59,7 @@
if ($sysroot = $ENV{CROSS_SYSROOT}) {
$sysroot =~ m|/android-([0-9]+)/arch-(\w+)/?$|;
($api, $arch) = ($1, $2);
} elsif (-f "$ndk/AndroidVersion.txt") {
} elsif ($is_standalone_toolchain) {
$sysroot = "$ndk/sysroot";
} else {
$api = "*";
......@@ -72,17 +72,31 @@
}
}
# list available platforms (numerically)
my @platforms = sort { $a =~ m/-([0-9]+)$/; my $aa = $1;
$b =~ m/-([0-9]+)$/; $aa <=> $1;
} glob("$ndk/platforms/android-$api");
die "no $ndk/platforms/android-$api" if ($#platforms < 0);
if (-d "$ndk/platforms") {
# list available platforms (numerically)
my @platforms = sort { $a =~ m/-([0-9]+)$/; my $aa = $1;
$b =~ m/-([0-9]+)$/; $aa <=> $1;
} glob("$ndk/platforms/android-$api");
die "no $ndk/platforms/android-$api" if ($#platforms < 0);
$sysroot = "@platforms[$#platforms]/arch-$arch";
$sysroot =~ m|/android-([0-9]+)/arch-$arch|;
$api = $1;
$sysroot = "@platforms[$#platforms]/arch-$arch";
$sysroot =~ m|/android-([0-9]+)/arch-$arch|;
$api = $1;
} elsif ($api eq "*") {
# r22 Removed platforms dir, use this JSON file
my $path = "$ndk/meta/platforms.json";
open my $fh, $path or die "Could not open '$path' $!";
while (<$fh>) {
if (/"max": (\d+),/) {
$api = $1;
last;
}
}
close $fh;
}
die "Could not get default API Level" if ($api eq "*");
}
die "no sysroot=$sysroot" if (!-d $sysroot);
die "no sysroot=$sysroot" if (length $sysroot && !-d $sysroot);
my $triarch = $triplet{$arch};
my $cflags;
......@@ -95,17 +109,21 @@
my $arm = $ndkver > 16 ? "armv7a" : "armv5te";
(my $tridefault = $triarch) =~ s/^arm-/$arm-/;
(my $tritools = $triarch) =~ s/(?:x|i6)86(_64)?-.*/x86$1/;
$cflags .= " -target $tridefault "
. "-gcc-toolchain \$($ndk_var)/toolchains"
. "/$tritools-4.9/prebuilt/$host";
$user{CC} = "clang" if ($user{CC} !~ m|clang|);
if (length $sysroot) {
$cflags .= " -target $tridefault "
. "-gcc-toolchain \$($ndk_var)/toolchains"
. "/$tritools-4.9/prebuilt/$host";
$user{CC} = "clang" if ($user{CC} !~ m|clang|);
} else {
$user{CC} = "$tridefault$api-clang";
}
$user{CROSS_COMPILE} = undef;
if (which("llvm-ar") =~ m|^$ndk/.*/prebuilt/([^/]+)/|) {
$user{AR} = "llvm-ar";
$user{ARFLAGS} = [ "rs" ];
$user{RANLIB} = ":";
}
} elsif (-f "$ndk/AndroidVersion.txt") { #"standalone toolchain"
} elsif ($is_standalone_toolchain) {
my $cc = $user{CC} // "clang";
# One can probably argue that both clang and gcc should be
# probed, but support for "standalone toolchain" was added
......@@ -127,19 +145,21 @@
$user{CROSS_COMPILE} = "$triarch-";
}
if (!-d "$sysroot/usr/include") {
my $incroot = "$ndk/sysroot/usr/include";
die "no $incroot" if (!-d $incroot);
die "no $incroot/$triarch" if (!-d "$incroot/$triarch");
$incroot =~ s|^$ndk/||;
$cppflags = "-D__ANDROID_API__=$api";
$cppflags .= " -isystem \$($ndk_var)/$incroot/$triarch";
$cppflags .= " -isystem \$($ndk_var)/$incroot";
if (length $sysroot) {
if (!-d "$sysroot/usr/include") {
my $incroot = "$ndk/sysroot/usr/include";
die "no $incroot" if (!-d $incroot);
die "no $incroot/$triarch" if (!-d "$incroot/$triarch");
$incroot =~ s|^$ndk/||;
$cppflags = "-D__ANDROID_API__=$api";
$cppflags .= " -isystem \$($ndk_var)/$incroot/$triarch";
$cppflags .= " -isystem \$($ndk_var)/$incroot";
}
$sysroot =~ s|^$ndk/||;
$sysroot = " --sysroot=\$($ndk_var)/$sysroot";
}
$sysroot =~ s|^$ndk/||;
$android_ndk = {
cflags => "$cflags --sysroot=\$($ndk_var)/$sysroot",
cflags => $cflags . $sysroot,
cppflags => $cppflags,
bn_ops => $arch =~ m/64$/ ? "SIXTY_FOUR_BIT_LONG"
: "BN_LLONG",
......
......@@ -438,7 +438,8 @@ test : tests
DEFINE SRCTOP {- sourcedir() -}
DEFINE BLDTOP {- builddir() -}
DEFINE RESULT_D {- builddir(qw(test test-runs)) -}
DEFINE OPENSSL_ENGINES {- builddir("engines") -}
engines = F$PARSE("{- builddir("engines") -}","A.;",,,"syntax_only") - "A.;"
DEFINE OPENSSL_ENGINES 'engines'
DEFINE OPENSSL_DEBUG_MEMORY "on"
IF "$(VERBOSE)" .NES. "" THEN DEFINE VERBOSE "$(VERBOSE)"
$(PERL) {- sourcefile("test", "run_tests.pl") -} $(TESTS)
......
......@@ -523,7 +523,6 @@ clean: libclean
$(RM) -r test/test-runs
$(RM) openssl.pc libcrypto.pc libssl.pc
-$(RM) `find . -type l \! -name '.*' -print`
$(RM) $(TARFILE)
distclean: clean
$(RM) configdata.pm
......
......@@ -324,15 +324,15 @@ build_apps build_tests: build_programs
# Convenience target to prebuild all generated files, not just the mandatory
# ones
build_all_generated: $(GENERATED_MANDATORY) $(GENERATED)
@{- output_off() if $disabled{makedepend}; "" -}
@{- output_off() if $disabled{makedepend}; "\@rem" -}
@$(ECHO) "Warning: consider configuring with no-makedepend, because if"
@$(ECHO) " target system doesn't have $(PERL),"
@$(ECHO) " then make will fail..."
@{- output_on() if $disabled{makedepend}; "" -}
@{- output_on() if $disabled{makedepend}; "\@rem" -}
test: tests
{- dependmagic('tests'); -}: build_programs_nodep build_engines_nodep
@{- output_off() if $disabled{tests}; "" -}
@{- output_off() if $disabled{tests}; "\@rem" -}
-mkdir $(BLDDIR)\test\test-runs
set SRCTOP=$(SRCDIR)
set BLDTOP=$(BLDDIR)
......@@ -341,17 +341,17 @@ test: tests
set OPENSSL_ENGINES=$(MAKEDIR)\engines
set OPENSSL_DEBUG_MEMORY=on
"$(PERL)" "$(SRCDIR)\test\run_tests.pl" $(TESTS)
@{- if ($disabled{tests}) { output_on(); } else { output_off(); } "" -}
@{- if ($disabled{tests}) { output_on(); } else { output_off(); } "\@rem" -}
@$(ECHO) "Tests are not supported with your chosen Configure options"
@{- output_on() if !$disabled{tests}; "" -}
@{- output_on() if !$disabled{tests}; "\@rem" -}
list-tests:
@{- output_off() if $disabled{tests}; "" -}
@{- output_off() if $disabled{tests}; "\@rem" -}
@set SRCTOP=$(SRCDIR)
@"$(PERL)" "$(SRCDIR)\test\run_tests.pl" list
@{- if ($disabled{tests}) { output_on(); } else { output_off(); } "" -}
@{- if ($disabled{tests}) { output_on(); } else { output_off(); } "\@rem" -}
@$(ECHO) "Tests are not supported with your chosen Configure options"
@{- output_on() if !$disabled{tests}; "" -}
@{- output_on() if !$disabled{tests}; "\@rem" -}
install: install_sw install_ssldirs install_docs
......@@ -362,7 +362,7 @@ libclean:
-del /Q /F $(LIBS) libcrypto.* libssl.* ossl_static.pdb
clean: libclean
{- join("\n\t", map { "-del /Q /F $_" } @PROGRAMS) -}
{- join("\n\t", map { "-del /Q /F $_" } @PROGRAMS) || "\@rem" -}
-del /Q /F $(ENGINES)
-del /Q /F $(SCRIPTS)
-del /Q /F $(GENERATED_MANDATORY)
......@@ -378,9 +378,9 @@ distclean: clean
-del /Q /F makefile
depend:
@ {- output_off() if $disabled{makedepend}; "" -}
@ {- output_off() if $disabled{makedepend}; "\@rem" -}
@ "$(PERL)" "$(SRCDIR)\util\add-depends.pl" "VC"
@ {- output_on() if $disabled{makedepend}; "" -}
@ {- output_on() if $disabled{makedepend}; "\@rem" -}
# Install helper targets #############################################
......@@ -413,10 +413,10 @@ install_dev: install_runtime_libs
@if "$(INSTALLTOP)"=="" ( $(ECHO) "INSTALLTOP should not be empty" & exit 1 )
@$(ECHO) "*** Installing development files"
@"$(PERL)" "$(SRCDIR)\util\mkdir-p.pl" "$(INSTALLTOP)\include\openssl"
@{- output_off() unless grep { $_ eq "OPENSSL_USE_APPLINK" } (@{$target{defines}}, @{$config{defines}}); "" -}
@{- output_off() unless grep { $_ eq "OPENSSL_USE_APPLINK" } (@{$target{defines}}, @{$config{defines}}); "\@rem" -}
@"$(PERL)" "$(SRCDIR)\util\copy.pl" "$(SRCDIR)\ms\applink.c" \
"$(INSTALLTOP)\include\openssl"
@{- output_on() unless grep { $_ eq "OPENSSL_USE_APPLINK" } (@{$target{defines}}, @{$config{defines}}); "" -}
@{- output_on() unless grep { $_ eq "OPENSSL_USE_APPLINK" } (@{$target{defines}}, @{$config{defines}}); "\@rem" -}
@"$(PERL)" "$(SRCDIR)\util\copy.pl" "-exclude_re=/__DECC_" \
"$(SRCDIR)\include\openssl\*.h" \
"$(INSTALLTOP)\include\openssl"
......
......@@ -1304,16 +1304,19 @@ if ($disabled{"dynamic-engine"}) {
unless ($disabled{asan}) {
push @{$config{cflags}}, "-fsanitize=address";
push @{$config{cxxflags}}, "-fsanitize=address" if $config{CXX};
}
unless ($disabled{ubsan}) {
# -DPEDANTIC or -fnosanitize=alignment may also be required on some
# platforms.
push @{$config{cflags}}, "-fsanitize=undefined", "-fno-sanitize-recover=all";
push @{$config{cxxflags}}, "-fsanitize=undefined", "-fno-sanitize-recover=all" if $config{CXX};
}
unless ($disabled{msan}) {
push @{$config{cflags}}, "-fsanitize=memory";
push @{$config{cxxflags}}, "-fsanitize=memory" if $config{CXX};
}
unless ($disabled{"fuzz-libfuzzer"} && $disabled{"fuzz-afl"}
......@@ -3158,25 +3161,25 @@ sub resolve_config {
}
}
foreach (sort keys %all_keys) {
my $previous = $combined_inheritance{$_};
foreach my $key (sort keys %all_keys) {
my $previous = $combined_inheritance{$key};
# Current target doesn't have a value for the current key?
# Assign it the default combiner, the rest of this loop body
# will handle it just like any other coderef.
if (!exists $table{$target}->{$_}) {
$table{$target}->{$_} = $default_combiner;
if (!exists $table{$target}->{$key}) {
$table{$target}->{$key} = $default_combiner;
}
$table{$target}->{$_} = process_values($table{$target}->{$_},
$combined_inheritance{$_},
$target, $_);
unless(defined($table{$target}->{$_})) {
delete $table{$target}->{$_};
$table{$target}->{$key} = process_values($table{$target}->{$key},
$combined_inheritance{$key},
$target, $key);
unless(defined($table{$target}->{$key})) {
delete $table{$target}->{$key};
}
# if ($extra_checks &&
# $previous && !($add_called || $previous ~~ $table{$target}->{$_})) {
# warn "$_ got replaced in $target\n";
# $previous && !($add_called || $previous ~~ $table{$target}->{$key})) {
# warn "$key got replaced in $target\n";
# }
}
......
......@@ -5,6 +5,20 @@
This file gives a brief overview of the major changes between each OpenSSL
release. For more details please read the CHANGES file.
Major changes between OpenSSL 1.1.1m and OpenSSL 1.1.1n [15 Mar 2022]
o Fixed a bug in the BN_mod_sqrt() function that can cause it to loop
forever for non-prime moduli ([CVE-2022-0778])
Major changes between OpenSSL 1.1.1l and OpenSSL 1.1.1m [14 Dec 2021]
o None
Major changes between OpenSSL 1.1.1k and OpenSSL 1.1.1l [24 Aug 2021]
o Fixed an SM2 Decryption Buffer Overflow (CVE-2021-3711)
o Fixed various read buffer overruns processing ASN.1 strings (CVE-2021-3712)
Major changes between OpenSSL 1.1.1j and OpenSSL 1.1.1k [25 Mar 2021]
o Fixed a problem with verifying a certificate chain when using the
......
OpenSSL 1.1.1k 25 Mar 2021
OpenSSL 1.1.1n 15 Mar 2022
Copyright (c) 1998-2021 The OpenSSL Project
Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson
......
/*
* Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved.
* Copyright (c) Huawei Technologies Co., Ltd. 2020-2022. All rights reserved.
* Description: This README describes how to generate the .S files.
* Create: 2020-05-30
*/
......@@ -9,27 +9,54 @@
"crypto/aes/asm/arm32/aesv8-armx.S",
"crypto/aes/asm/arm32/bsaes-armv7.S",
"crypto/armv4cpuid.S",
"crypto/bn/armv4-gf2m.S",
"crypto/bn/armv4-mont.S",
"crypto/chacha/chacha-armv4.S",
"crypto/ec/ecp_nistz256-armv4.S",
"crypto/bn/asm/arm32/armv4-gf2m.S",
"crypto/bn/asm/arm32/armv4-mont.S",
"crypto/chacha/asm/arm32/chacha-armv4.S",
"crypto/ec/asm/arm32/ecp_nistz256-armv4.S",
"crypto/modes/asm/arm32/ghash-armv4.S",
"crypto/modes/asm/arm32/ghashv8-armx.S",
"crypto/poly1305/poly1305-armv4.S",
"crypto/sha/keccak1600-armv4.S",
"crypto/sha/sha1-armv4-large.S",
"crypto/sha/sha256-armv4.S",
"crypto/sha/sha512-armv4.S",
"crypto/poly1305/asm/arm32/poly1305-armv4.S",
"crypto/sha/asm/arm32/keccak1600-armv4.S",
"crypto/sha/asm/arm32/sha1-armv4-large.S",
"crypto/sha/asm/arm32/sha256-armv4.S",
"crypto/sha/asm/arm32/sha512-armv4.S",
"crypto/aes/asm/arm64/aesv8-armx.S",
"crypto/aes/asm/arm64/vpaes-armv8.S",
"crypto/arm64cpuid.S",
"crypto/bn/armv8-mont.S",
"crypto/chacha/chacha-armv8.S",
"crypto/ec/ecp_nistz256-armv8.S",
"crypto/bn/asm/arm64/armv8-mont.S",
"crypto/chacha/asm/arm64/chacha-armv8.S",
"crypto/ec/asm/arm64/ecp_nistz256-armv8.S",
"crypto/modes/asm/arm64/ghashv8-armx.S",
"crypto/poly1305/poly1305-armv8.S",
"crypto/sha/keccak1600-armv8.S",
"crypto/sha/sha1-armv8.S",
"crypto/sha/sha256-armv8.S",
"crypto/sha/sha512-armv8.S",
"crypto/poly1305/asm/arm64/poly1305-armv8.S",
"crypto/sha/asm/arm64/keccak1600-armv8.S",
"crypto/sha/asm/arm64/sha1-armv8.S",
"crypto/sha/asm/arm64/sha256-armv8.S",
"crypto/sha/asm/arm64/sha512-armv8.S",
"crypto/aes/asm/x86_64/aesni-mb-x86_64.s",
"crypto/aes/asm/x86_64/aesni-sha1-x86_64.s",
"crypto/aes/asm/x86_64/aesni-sha256-x86_64.s",
"crypto/aes/asm/x86_64/aesni-x86_64.s",
"crypto/aes/asm/x86_64/vpaes-x86_64.s",
"crypto/bn/asm/x86_64/rsaz-avx2.s",
"crypto/bn/asm/x86_64/rsaz-x86_64.s",
"crypto/bn/asm/x86_64/x86_64-gf2m.s",
"crypto/bn/asm/x86_64/x86_64-mont.s",
"crypto/bn/asm/x86_64/x86_64-mont5.s",
"crypto/chacha/asm/x86_64/chacha-x86_64.s",
"crypto/ec/asm/x86_64/ecp_nistz256-x86_64.s",
"crypto/ec/asm/x86_64/x25519-x86_64.s",
"crypto/md5/asm/x86_64/md5-x86_64.s",
"crypto/modes/asm/x86_64/aesni-gcm-x86_64.s",
"crypto/modes/asm/x86_64/ghash-x86_64.s",
"crypto/poly1305/asm/x86_64/poly1305-x86_64.s",
"crypto/rc4/asm/x86_64/rc4-md5-x86_64.s",
"crypto/rc4/asm/x86_64/rc4-x86_64.s",
"crypto/sha/asm/x86_64/keccak1600-x86_64.s",
"crypto/sha/asm/x86_64/sha1-mb-x86_64.s",
"crypto/sha/asm/x86_64/sha1-x86_64.s",
"crypto/sha/asm/x86_64/sha256-mb-x86_64.s",
"crypto/sha/asm/x86_64/sha256-x86_64.s",
"crypto/sha/asm/x86_64/sha512-x86_64.s",
"crypto/whrlpool/asm/x86_64/wp-x86_64.s",
"crypto/x86_64cpuid.s",
are generated by perl executing .pl files. you can also execute the script of create_asm_file.sh to generate it.
\ No newline at end of file
......@@ -3,9 +3,9 @@
"Name": "OpenSSL",
"License": "OpenSSL License and Original SSLeay License",
"License File": "LICENSE",
"Version Number": "1.1.1k",
"Owner": "huangjun42@huawei.com",
"Upstream URL": "https://www.openssl.org/source/openssl-1.1.1k.tar.gz",
"Version Number": "1.1.1n",
"Owner": "wanghaixiang@huawei.com",
"Upstream URL": "https://www.openssl.org/source/openssl-1.1.1n.tar.gz",
"Description": "implementing the Transport Layer Security (TLS) protocols (including SSLv3) as well as a full-strength general purpose cryptographic library"
}
]
\ No newline at end of file
/*
* Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
......@@ -300,9 +300,13 @@ int password_callback(char *buf, int bufsiz, int verify, PW_CB_DATA *cb_tmp)
int ui_flags = 0;
const char *prompt_info = NULL;
char *prompt;
int pw_min_len = PW_MIN_LENGTH;
if (cb_data != NULL && cb_data->prompt_info != NULL)
prompt_info = cb_data->prompt_info;
if (cb_data != NULL && cb_data->password != NULL
&& *(const char*)cb_data->password != '\0')
pw_min_len = 1;
prompt = UI_construct_prompt(ui, "pass phrase", prompt_info);
if (!prompt) {
BIO_printf(bio_err, "Out of memory\n");
......@@ -317,12 +321,12 @@ int password_callback(char *buf, int bufsiz, int verify, PW_CB_DATA *cb_tmp)
(void)UI_add_user_data(ui, cb_data);
ok = UI_add_input_string(ui, prompt, ui_flags, buf,
PW_MIN_LENGTH, bufsiz - 1);
pw_min_len, bufsiz - 1);
if (ok >= 0 && verify) {
buff = app_malloc(bufsiz, "password buffer");
ok = UI_add_verify_string(ui, prompt, ui_flags, buff,
PW_MIN_LENGTH, bufsiz - 1, buf);
pw_min_len, bufsiz - 1, buf);
}
if (ok >= 0)
do {
......
/*
* Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
......@@ -172,6 +172,7 @@ int ciphers_main(int argc, char **argv)
if (convert != NULL) {
BIO_printf(bio_out, "OpenSSL cipher name: %s\n",
OPENSSL_cipher_name(convert));
ret = 0;
goto end;
}
......
/*
* Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
......@@ -120,19 +120,20 @@ int crl2pkcs7_main(int argc, char **argv)
if (!ASN1_INTEGER_set(p7s->version, 1))
goto end;
if ((crl_stack = sk_X509_CRL_new_null()) == NULL)
goto end;
p7s->crl = crl_stack;
if (crl != NULL) {
if ((crl_stack = sk_X509_CRL_new_null()) == NULL)
goto end;
p7s->crl = crl_stack;
sk_X509_CRL_push(crl_stack, crl);
crl = NULL; /* now part of p7 for OPENSSL_freeing */
}
if ((cert_stack = sk_X509_new_null()) == NULL)
goto end;
p7s->cert = cert_stack;
if (certflst != NULL) {
if ((cert_stack = sk_X509_new_null()) == NULL)
goto end;
p7s->cert = cert_stack;
if (certflst != NULL)
for (i = 0; i < sk_OPENSSL_STRING_num(certflst); i++) {
certfile = sk_OPENSSL_STRING_value(certflst, i);
if (add_certs_from_file(cert_stack, certfile) < 0) {
......@@ -141,6 +142,7 @@ int crl2pkcs7_main(int argc, char **argv)
goto end;
}
}
}
out = bio_open_default(outfile, 'w', outformat);
if (out == NULL)
......
/*
* Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
......@@ -316,7 +316,7 @@ int dgst_main(int argc, char **argv)
EVP_MD_CTX *mctx = NULL;
EVP_PKEY_CTX *pctx = NULL;
int r;
if (!BIO_get_md_ctx(bmd, &mctx)) {
if (BIO_get_md_ctx(bmd, &mctx) <= 0) {
BIO_printf(bio_err, "Error getting context\n");
ERR_print_errors(bio_err);
goto end;
......@@ -345,7 +345,7 @@ int dgst_main(int argc, char **argv)
/* we use md as a filter, reading from 'in' */
else {
EVP_MD_CTX *mctx = NULL;
if (!BIO_get_md_ctx(bmd, &mctx)) {
if (BIO_get_md_ctx(bmd, &mctx) <= 0) {
BIO_printf(bio_err, "Error getting context\n");
ERR_print_errors(bio_err);
goto end;
......
/*
* Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
......@@ -81,7 +81,7 @@ const OPTIONS enc_options[] = {
{"", OPT_CIPHER, '-', "Any supported cipher"},
OPT_R_OPTIONS,
#ifdef ZLIB
{"z", OPT_Z, '-', "Use zlib as the 'encryption'"},
{"z", OPT_Z, '-', "Compress or decompress encrypted data using zlib"},
#endif
#ifndef OPENSSL_NO_ENGINE
{"engine", OPT_ENGINE, 's', "Use engine, possibly a hardware device"},
......
/*
* Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
......@@ -120,7 +120,6 @@ int main(int argc, char *argv[])
{
FUNCTION f, *fp;
LHASH_OF(FUNCTION) *prog = NULL;
char **copied_argv = NULL;
char *p, *pname;
char buf[1024];
const char *prompt;
......@@ -137,7 +136,7 @@ int main(int argc, char *argv[])
bio_err = dup_bio_err(FORMAT_TEXT);
#if defined(OPENSSL_SYS_VMS) && defined(__DECC)
copied_argv = argv = copy_argv(&argc, argv);
argv = copy_argv(&argc, argv);
#elif defined(_WIN32)
/*
* Replace argv[] with UTF-8 encoded strings.
......@@ -258,7 +257,6 @@ int main(int argc, char *argv[])
}
ret = 1;
end:
OPENSSL_free(copied_argv);
OPENSSL_free(default_config_file);
lh_FUNCTION_free(prog);
OPENSSL_free(arg.argv);
......
/*
* Copyright 2000-2018 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 2000-2022 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
......@@ -407,7 +407,7 @@ static char *md5crypt(const char *passwd, const char *magic, const char *salt)
n >>= 1;
}
if (!EVP_DigestFinal_ex(md, buf, NULL))
return NULL;
goto err;
for (i = 0; i < 1000; i++) {
if (!EVP_DigestInit_ex(md2, EVP_md5(), NULL))
......@@ -633,7 +633,7 @@ static char *shacrypt(const char *passwd, const char *magic, const char *salt)
n >>= 1;
}
if (!EVP_DigestFinal_ex(md, buf, NULL))
return NULL;
goto err;
/* P sequence */
if (!EVP_DigestInit_ex(md2, sha, NULL))
......@@ -644,7 +644,7 @@ static char *shacrypt(const char *passwd, const char *magic, const char *salt)
goto err;
if (!EVP_DigestFinal_ex(md2, temp_buf, NULL))
return NULL;
goto err;
if ((p_bytes = OPENSSL_zalloc(passwd_len)) == NULL)
goto err;
......@@ -661,7 +661,7 @@ static char *shacrypt(const char *passwd, const char *magic, const char *salt)
goto err;
if (!EVP_DigestFinal_ex(md2, temp_buf, NULL))
return NULL;
goto err;
if ((s_bytes = OPENSSL_zalloc(salt_len)) == NULL)
goto err;
......
......@@ -819,7 +819,9 @@ int generate_stateless_cookie_callback(SSL *ssl, unsigned char *cookie,
{
unsigned int temp;
int res = generate_cookie_callback(ssl, cookie, &temp);
*cookie_len = temp;
if (res != 0)
*cookie_len = temp;
return res;
}
......
/*
* Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 2005 Nokia. All rights reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
......@@ -938,6 +938,7 @@ int s_client_main(int argc, char **argv)
struct timeval tv;
#endif
const char *servername = NULL;
char *sname_alloc = NULL;
int noservername = 0;
const char *alpn_in = NULL;
tlsextctx tlsextcbp = { NULL, 0 };
......@@ -1588,6 +1589,15 @@ int s_client_main(int argc, char **argv)
"%s: -proxy argument malformed or ambiguous\n", prog);
goto end;
}
if (servername == NULL && !noservername) {
res = BIO_parse_hostserv(connectstr, &sname_alloc, NULL, BIO_PARSE_PRIO_HOST);
if (!res) {
BIO_printf(bio_err,
"%s: -connect argument malformed or ambiguous\n", prog);
goto end;
}
servername = sname_alloc;
}
} else {
int res = 1;
char *tmp_host = host, *tmp_port = port;
......@@ -3149,8 +3159,11 @@ int s_client_main(int argc, char **argv)
#ifndef OPENSSL_NO_SRP
OPENSSL_free(srp_arg.srppassin);
#endif
OPENSSL_free(sname_alloc);
OPENSSL_free(connectstr);
OPENSSL_free(bindstr);
OPENSSL_free(bindhost);
OPENSSL_free(bindport);
OPENSSL_free(host);
OPENSSL_free(port);
X509_VERIFY_PARAM_free(vpm);
......
/*
* Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved
* Copyright 2005 Nokia. All rights reserved.
*
......@@ -133,6 +133,17 @@ static unsigned int psk_server_cb(SSL *ssl, const char *identity,
if (s_debug)
BIO_printf(bio_s_out, "psk_server_cb\n");
if (!SSL_is_dtls(ssl) && SSL_version(ssl) >= TLS1_3_VERSION) {
/*
* This callback is designed for use in (D)TLSv1.2 (or below). It is
* possible to use a single callback for all protocol versions - but it
* is preferred to use a dedicated callback for TLSv1.3. For TLSv1.3 we
* have psk_find_session_cb.
*/
return 0;
}
if (identity == NULL) {
BIO_printf(bio_err, "Error: client did not send PSK identity\n");
goto out_err;
......
/*
* Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
......@@ -147,7 +147,7 @@ int init_client(int *sock, const char *host, const char *port,
#endif
if (!BIO_connect(*sock, BIO_ADDRINFO_address(ai),
protocol == IPPROTO_TCP ? BIO_SOCK_NODELAY : 0)) {
BIO_ADDRINFO_protocol(ai) == IPPROTO_TCP ? BIO_SOCK_NODELAY : 0)) {
BIO_closesocket(*sock);
*sock = INVALID_SOCKET;
continue;
......@@ -214,6 +214,8 @@ int do_server(int *accept_sock, const char *host, const char *port,
const BIO_ADDRINFO *next;
int sock_family, sock_type, sock_protocol, sock_port;
const BIO_ADDR *sock_address;
int sock_family_fallback = AF_UNSPEC;
const BIO_ADDR *sock_address_fallback = NULL;
int sock_options = BIO_SOCK_REUSEADDR;
int ret = 0;
......@@ -244,6 +246,10 @@ int do_server(int *accept_sock, const char *host, const char *port,
&& BIO_ADDRINFO_protocol(next) == sock_protocol) {
if (sock_family == AF_INET
&& BIO_ADDRINFO_family(next) == AF_INET6) {
/* In case AF_INET6 is returned but not supported by the
* kernel, retry with the first detected address family */
sock_family_fallback = sock_family;
sock_address_fallback = sock_address;
sock_family = AF_INET6;
sock_address = BIO_ADDRINFO_address(next);
} else if (sock_family == AF_INET6
......@@ -253,6 +259,10 @@ int do_server(int *accept_sock, const char *host, const char *port,
}
asock = BIO_socket(sock_family, sock_type, sock_protocol, 0);
if (asock == INVALID_SOCKET && sock_family_fallback != AF_UNSPEC) {
asock = BIO_socket(sock_family_fallback, sock_type, sock_protocol, 0);
sock_address = sock_address_fallback;
}
if (asock == INVALID_SOCKET
|| !BIO_listen(asock, sock_address, sock_options)) {
BIO_ADDRINFO_free(res);
......
/*
* Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved
*
* Licensed under the OpenSSL license (the "License"). You may not use
......@@ -1590,6 +1590,10 @@ int speed_main(int argc, char **argv)
case OPT_MULTI:
#ifndef NO_FORK
multi = atoi(opt_arg());
if (multi >= INT_MAX / (int)sizeof(int)) {
BIO_printf(bio_err, "%s: multi argument too large\n", prog);
return 0;
}
#endif
break;
case OPT_ASYNCJOBS:
......@@ -3490,7 +3494,7 @@ static int do_multi(int multi, int size_num)
close(fd[1]);
mr = 1;
usertime = 0;
free(fds);
OPENSSL_free(fds);
return 0;
}
printf("Forked child %d\n", n);
......@@ -3603,7 +3607,7 @@ static int do_multi(int multi, int size_num)
fclose(f);
}
free(fds);
OPENSSL_free(fds);
return 1;
}
#endif
......
/*
* Copyright 2015-2022 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/license.html
*/
#include <stdlib.h>
#include <openssl/crypto.h>
#include "apps.h" /* for app_malloc() and copy_argv() */
char **newargv = NULL;
static void cleanup_argv(void)
{
OPENSSL_free(newargv);
newargv = NULL;
}
char **copy_argv(int *argc, char *argv[])
{
/*-
* The note below is for historical purpose. On VMS now we always
* copy argv "safely."
*
* 2011-03-22 SMS.
* If we have 32-bit pointers everywhere, then we're safe, and
* we bypass this mess, as on non-VMS systems.
* Problem 1: Compaq/HP C before V7.3 always used 32-bit
* pointers for argv[].
* Fix 1: For a 32-bit argv[], when we're using 64-bit pointers
* everywhere else, we always allocate and use a 64-bit
* duplicate of argv[].
* Problem 2: Compaq/HP C V7.3 (Alpha, IA64) before ECO1 failed
* to NULL-terminate a 64-bit argv[]. (As this was written, the
* compiler ECO was available only on IA64.)
* Fix 2: Unless advised not to (VMS_TRUST_ARGV), we test a
* 64-bit argv[argc] for NULL, and, if necessary, use a
* (properly) NULL-terminated (64-bit) duplicate of argv[].
* The same code is used in either case to duplicate argv[].
* Some of these decisions could be handled in preprocessing,
* but the code tends to get even uglier, and the penalty for
* deciding at compile- or run-time is tiny.
*/
int i, count = *argc;
char **p = newargv;
cleanup_argv();
newargv = app_malloc(sizeof(*newargv) * (count + 1), "argv copy");
if (newargv == NULL)
return NULL;
/* Register automatic cleanup on first use */
if (p == NULL)
OPENSSL_atexit(cleanup_argv);
for (i = 0; i < count; i++)
newargv[i] = argv[i];
newargv[i] = NULL;
*argc = i;
return newargv;
}
/*
* Copyright 2010-2016 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 2010-2022 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
......@@ -25,8 +25,6 @@
# include <stdlib.h>
# include <unixlib.h>
# include "apps.h"
/* Global storage. */
/* Flag to sense if decc_init() was called. */
......@@ -63,42 +61,6 @@ decc_feat_t decc_feat_array[] = {
};
char **copy_argv(int *argc, char *argv[])
{
/*-
* The note below is for historical purpose. On VMS now we always
* copy argv "safely."
*
* 2011-03-22 SMS.
* If we have 32-bit pointers everywhere, then we're safe, and
* we bypass this mess, as on non-VMS systems.
* Problem 1: Compaq/HP C before V7.3 always used 32-bit
* pointers for argv[].
* Fix 1: For a 32-bit argv[], when we're using 64-bit pointers
* everywhere else, we always allocate and use a 64-bit
* duplicate of argv[].
* Problem 2: Compaq/HP C V7.3 (Alpha, IA64) before ECO1 failed
* to NULL-terminate a 64-bit argv[]. (As this was written, the
* compiler ECO was available only on IA64.)
* Fix 2: Unless advised not to (VMS_TRUST_ARGV), we test a
* 64-bit argv[argc] for NULL, and, if necessary, use a
* (properly) NULL-terminated (64-bit) duplicate of argv[].
* The same code is used in either case to duplicate argv[].
* Some of these decisions could be handled in preprocessing,
* but the code tends to get even uglier, and the penalty for
* deciding at compile- or run-time is tiny.
*/
int i, count = *argc;
char **newargv = app_malloc(sizeof(*newargv) * (count + 1), "argv copy");
for (i = 0; i < count; i++)
newargv[i] = argv[i];
newargv[i] = NULL;
*argc = i;
return newargv;
}
/* LIB$INITIALIZE initialization function. */
static void decc_init(void)
......
......@@ -704,6 +704,7 @@ case "$GUESSOS" in
__CNF_CPPFLAGS="$__CNF_CPPFLAGS -DL_ENDIAN" ;;
powerpc64-*-*bsd*) OUT="BSD-generic64";
__CNF_CPPFLAGS="$__CNF_CPPFLAGS -DB_ENDIAN" ;;
riscv64-*-*bsd*) OUT="BSD-riscv64" ;;
sparc64-*-*bsd*) OUT="BSD-sparc64" ;;
ia64-*-*bsd*) OUT="BSD-ia64" ;;
x86_64-*-dragonfly*) OUT="BSD-x86_64" ;;
......
#!/bin/bash
# Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved.
# Copyright (c) Huawei Technologies Co., Ltd. 2020-2022. All rights reserved.
# Description: This script is used to generate .S files.
# Create: 2020-05-30
......@@ -22,43 +22,118 @@ success()
}
rm -rf crypto/aes/asm/arm32
rm -rf crypto/bn/asm/arm32
rm -rf crypto/chacha/asm/arm32
rm -rf crypto/ec/asm/arm32
rm -rf crypto/modes/asm/arm32
rm -rf crypto/poly1305/asm/arm32
rm -rf crypto/sha/asm/arm32
rm -rf crypto/armv4cpuid.S
mkdir crypto/aes/asm/arm32
mkdir crypto/bn/asm/arm32
mkdir crypto/chacha/asm/arm32
mkdir crypto/ec/asm/arm32
mkdir crypto/modes/asm/arm32
mkdir crypto/poly1305/asm/arm32
mkdir crypto/sha/asm/arm32
# for arm32:
perl crypto/aes/asm/aes-armv4.pl void crypto/aes/asm/arm32/aes-armv4.S
perl crypto/aes/asm/aesv8-armx.pl void crypto/aes/asm/arm32/aesv8-armx.S
perl crypto/aes/asm/bsaes-armv7.pl void crypto/aes/asm/arm32/bsaes-armv7.S
perl crypto/armv4cpuid.pl void crypto/armv4cpuid.S
perl crypto/bn/asm/armv4-gf2m.pl void crypto/bn/armv4-gf2m.S
perl crypto/bn/asm/armv4-mont.pl void crypto/bn/armv4-mont.S
perl crypto/chacha/asm/chacha-armv4.pl void crypto/chacha/chacha-armv4.S
perl crypto/ec/asm/ecp_nistz256-armv4.pl void crypto/ec/ecp_nistz256-armv4.S
perl crypto/bn/asm/armv4-gf2m.pl void crypto/bn/asm/arm32/armv4-gf2m.S
perl crypto/bn/asm/armv4-mont.pl void crypto/bn/asm/arm32/armv4-mont.S
perl crypto/chacha/asm/chacha-armv4.pl void crypto/chacha/asm/arm32/chacha-armv4.S
perl crypto/ec/asm/ecp_nistz256-armv4.pl void crypto/ec/asm/arm32/ecp_nistz256-armv4.S
perl crypto/modes/asm/ghash-armv4.pl void crypto/modes/asm/arm32/ghash-armv4.S
perl crypto/modes/asm/ghashv8-armx.pl void crypto/modes/asm/arm32/ghashv8-armx.S
perl crypto/poly1305/asm/poly1305-armv4.pl void crypto/poly1305/poly1305-armv4.S
perl crypto/sha/asm/keccak1600-armv4.pl void crypto/sha/keccak1600-armv4.S
perl crypto/sha/asm/sha1-armv4-large.pl void crypto/sha/sha1-armv4-large.S
perl crypto/sha/asm/sha256-armv4.pl void crypto/sha/sha256-armv4.S
perl crypto/sha/asm/sha512-armv4.pl void crypto/sha/sha512-armv4.S
perl crypto/poly1305/asm/poly1305-armv4.pl void crypto/poly1305/asm/arm32/poly1305-armv4.S
perl crypto/sha/asm/keccak1600-armv4.pl void crypto/sha/asm/arm32/keccak1600-armv4.S
perl crypto/sha/asm/sha1-armv4-large.pl void crypto/sha/asm/arm32/sha1-armv4-large.S
perl crypto/sha/asm/sha256-armv4.pl void crypto/sha/asm/arm32/sha256-armv4.S
perl crypto/sha/asm/sha512-armv4.pl void crypto/sha/asm/arm32/sha512-armv4.S
rm -rf crypto/aes/asm/arm64
rm -rf crypto/bn/asm/arm64
rm -rf crypto/chacha/asm/arm64
rm -rf crypto/ec/asm/arm64
rm -rf crypto/modes/asm/arm64
rm -rf crypto/poly1305/asm/arm64
rm -rf crypto/sha/asm/arm64
rm -rf crypto/arm64cpuid.S
mkdir crypto/aes/asm/arm64
mkdir crypto/bn/asm/arm64
mkdir crypto/chacha/asm/arm64
mkdir crypto/ec/asm/arm64
mkdir crypto/modes/asm/arm64
mkdir crypto/poly1305/asm/arm64
mkdir crypto/sha/asm/arm64
# for arm64:
perl crypto/aes/asm/aesv8-armx.pl linux64 crypto/aes/asm/arm64/aesv8-armx.S
perl crypto/aes/asm/vpaes-armv8.pl linux64 crypto/aes/asm/arm64/vpaes-armv8.S
perl crypto/arm64cpuid.pl linux64 crypto/arm64cpuid.S
perl crypto/bn/asm/armv8-mont.pl linux64 crypto/bn/armv8-mont.S
perl crypto/chacha/asm/chacha-armv8.pl linux64 crypto/chacha/chacha-armv8.S
perl crypto/ec/asm/ecp_nistz256-armv8.pl linux64 crypto/ec/ecp_nistz256-armv8.S
perl crypto/bn/asm/armv8-mont.pl linux64 crypto/bn/asm/arm64/armv8-mont.S
perl crypto/chacha/asm/chacha-armv8.pl linux64 crypto/chacha/asm/arm64/chacha-armv8.S
perl crypto/ec/asm/ecp_nistz256-armv8.pl linux64 crypto/ec/asm/arm64/ecp_nistz256-armv8.S
perl crypto/modes/asm/ghashv8-armx.pl linux64 crypto/modes/asm/arm64/ghashv8-armx.S
perl crypto/poly1305/asm/poly1305-armv8.pl linux64 crypto/poly1305/poly1305-armv8.S
perl crypto/sha/asm/keccak1600-armv8.pl linux64 crypto/sha/keccak1600-armv8.S
perl crypto/sha/asm/sha1-armv8.pl linux64 crypto/sha/sha1-armv8.S
perl crypto/sha/asm/sha512-armv8.pl linux64 crypto/sha/sha256-armv8.S
perl crypto/sha/asm/sha512-armv8.pl linux64 crypto/sha/sha512-armv8.S
perl crypto/poly1305/asm/poly1305-armv8.pl linux64 crypto/poly1305/asm/arm64/poly1305-armv8.S
perl crypto/sha/asm/keccak1600-armv8.pl linux64 crypto/sha/asm/arm64/keccak1600-armv8.S
perl crypto/sha/asm/sha1-armv8.pl linux64 crypto/sha/asm/arm64/sha1-armv8.S
perl crypto/sha/asm/sha512-armv8.pl linux64 crypto/sha/asm/arm64/sha256-armv8.S
perl crypto/sha/asm/sha512-armv8.pl linux64 crypto/sha/asm/arm64/sha512-armv8.S
#need x86_64-linux-android-clang cross compile chain in your environment path,
#otherwise the generated asm files cannot be used
x86_64-linux-android-clang -v
rm -rf crypto/aes/asm/x86_64
rm -rf crypto/bn/asm/x86_64
rm -rf crypto/chacha/asm/x86_64
rm -rf crypto/ec/asm/x86_64
rm -rf crypto/md5/asm/x86_64
rm -rf crypto/modes/asm/x86_64
rm -rf crypto/poly1305/asm/x86_64
rm -rf crypto/rc4/asm/x86_64
rm -rf crypto/sha/asm/x86_64
rm -rf crypto/whrlpool/asm/x86_64
rm -rf crypto/x86_64cpuid.s
mkdir crypto/aes/asm/x86_64
mkdir crypto/bn/asm/x86_64
mkdir crypto/chacha/asm/x86_64
mkdir crypto/ec/asm/x86_64
mkdir crypto/md5/asm/x86_64
mkdir crypto/modes/asm/x86_64
mkdir crypto/poly1305/asm/x86_64
mkdir crypto/rc4/asm/x86_64
mkdir crypto/sha/asm/x86_64
mkdir crypto/whrlpool/asm/x86_64
# for x86_64:
CC="x86_64-linux-android-clang" perl crypto/aes/asm/aesni-mb-x86_64.pl elf crypto/aes/asm/x86_64/aesni-mb-x86_64.s
CC="x86_64-linux-android-clang" perl crypto/aes/asm/aesni-sha1-x86_64.pl elf crypto/aes/asm/x86_64/aesni-sha1-x86_64.s
CC="x86_64-linux-android-clang" perl crypto/aes/asm/aesni-sha256-x86_64.pl elf crypto/aes/asm/x86_64/aesni-sha256-x86_64.s
CC="x86_64-linux-android-clang" perl crypto/aes/asm/aesni-x86_64.pl elf crypto/aes/asm/x86_64/aesni-x86_64.s
CC="x86_64-linux-android-clang" perl crypto/aes/asm/vpaes-x86_64.pl elf crypto/aes/asm/x86_64/vpaes-x86_64.s
CC="x86_64-linux-android-clang" perl crypto/bn/asm/rsaz-avx2.pl elf crypto/bn/asm/x86_64/rsaz-avx2.s
CC="x86_64-linux-android-clang" perl crypto/bn/asm/rsaz-x86_64.pl elf crypto/bn/asm/x86_64/rsaz-x86_64.s
CC="x86_64-linux-android-clang" perl crypto/bn/asm/x86_64-gf2m.pl elf crypto/bn/asm/x86_64/x86_64-gf2m.s
CC="x86_64-linux-android-clang" perl crypto/bn/asm/x86_64-mont.pl elf crypto/bn/asm/x86_64/x86_64-mont.s
CC="x86_64-linux-android-clang" perl crypto/bn/asm/x86_64-mont5.pl elf crypto/bn/asm/x86_64/x86_64-mont5.s
CC="x86_64-linux-android-clang" perl crypto/chacha/asm/chacha-x86_64.pl elf crypto/chacha/asm/x86_64/chacha-x86_64.s
CC="x86_64-linux-android-clang" perl crypto/ec/asm/ecp_nistz256-x86_64.pl elf crypto/ec/asm/x86_64/ecp_nistz256-x86_64.s
CC="x86_64-linux-android-clang" perl crypto/ec/asm/x25519-x86_64.pl elf crypto/ec/asm/x86_64/x25519-x86_64.s
CC="x86_64-linux-android-clang" perl crypto/md5/asm/md5-x86_64.pl elf crypto/md5/asm/x86_64/md5-x86_64.s
CC="x86_64-linux-android-clang" perl crypto/modes/asm/aesni-gcm-x86_64.pl elf crypto/modes/asm/x86_64/aesni-gcm-x86_64.s
CC="x86_64-linux-android-clang" perl crypto/modes/asm/ghash-x86_64.pl elf crypto/modes/asm/x86_64/ghash-x86_64.s
CC="x86_64-linux-android-clang" perl crypto/poly1305/asm/poly1305-x86_64.pl elf crypto/poly1305/asm/x86_64/poly1305-x86_64.s
CC="x86_64-linux-android-clang" perl crypto/rc4/asm/rc4-md5-x86_64.pl elf crypto/rc4/asm/x86_64/rc4-md5-x86_64.s
CC="x86_64-linux-android-clang" perl crypto/rc4/asm/rc4-x86_64.pl elf crypto/rc4/asm/x86_64/rc4-x86_64.s
CC="x86_64-linux-android-clang" perl crypto/sha/asm/keccak1600-x86_64.pl elf crypto/sha/asm/x86_64/keccak1600-x86_64.s
CC="x86_64-linux-android-clang" perl crypto/sha/asm/sha1-mb-x86_64.pl elf crypto/sha/asm/x86_64/sha1-mb-x86_64.s
CC="x86_64-linux-android-clang" perl crypto/sha/asm/sha1-x86_64.pl elf crypto/sha/asm/x86_64/sha1-x86_64.s
CC="x86_64-linux-android-clang" perl crypto/sha/asm/sha256-mb-x86_64.pl elf crypto/sha/asm/x86_64/sha256-mb-x86_64.s
CC="x86_64-linux-android-clang" perl crypto/sha/asm/sha512-x86_64.pl elf crypto/sha/asm/x86_64/sha256-x86_64.s
CC="x86_64-linux-android-clang" perl crypto/sha/asm/sha512-x86_64.pl elf crypto/sha/asm/x86_64/sha512-x86_64.s
CC="x86_64-linux-android-clang" perl crypto/whrlpool/asm/wp-x86_64.pl elf crypto/whrlpool/asm/x86_64/wp-x86_64.s
CC="x86_64-linux-android-clang" perl crypto/x86_64cpuid.pl elf crypto/x86_64cpuid.s
if [ $? -ne 0 ]; then
error
else
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
.text
.type _vpaes_encrypt_core,@function
.align 16
_vpaes_encrypt_core:
.cfi_startproc
movq %rdx,%r9
movq $16,%r11
movl 240(%rdx),%eax
movdqa %xmm9,%xmm1
movdqa .Lk_ipt(%rip),%xmm2
pandn %xmm0,%xmm1
movdqu (%r9),%xmm5
psrld $4,%xmm1
pand %xmm9,%xmm0
.byte 102,15,56,0,208
movdqa .Lk_ipt+16(%rip),%xmm0
.byte 102,15,56,0,193
pxor %xmm5,%xmm2
addq $16,%r9
pxor %xmm2,%xmm0
leaq .Lk_mc_backward(%rip),%r10
jmp .Lenc_entry
.align 16
.Lenc_loop:
movdqa %xmm13,%xmm4
movdqa %xmm12,%xmm0
.byte 102,15,56,0,226
.byte 102,15,56,0,195
pxor %xmm5,%xmm4
movdqa %xmm15,%xmm5
pxor %xmm4,%xmm0
movdqa -64(%r11,%r10,1),%xmm1
.byte 102,15,56,0,234
movdqa (%r11,%r10,1),%xmm4
movdqa %xmm14,%xmm2
.byte 102,15,56,0,211
movdqa %xmm0,%xmm3
pxor %xmm5,%xmm2
.byte 102,15,56,0,193
addq $16,%r9
pxor %xmm2,%xmm0
.byte 102,15,56,0,220
addq $16,%r11
pxor %xmm0,%xmm3
.byte 102,15,56,0,193
andq $0x30,%r11
subq $1,%rax
pxor %xmm3,%xmm0
.Lenc_entry:
movdqa %xmm9,%xmm1
movdqa %xmm11,%xmm5
pandn %xmm0,%xmm1
psrld $4,%xmm1
pand %xmm9,%xmm0
.byte 102,15,56,0,232
movdqa %xmm10,%xmm3
pxor %xmm1,%xmm0
.byte 102,15,56,0,217
movdqa %xmm10,%xmm4
pxor %xmm5,%xmm3
.byte 102,15,56,0,224
movdqa %xmm10,%xmm2
pxor %xmm5,%xmm4
.byte 102,15,56,0,211
movdqa %xmm10,%xmm3
pxor %xmm0,%xmm2
.byte 102,15,56,0,220
movdqu (%r9),%xmm5
pxor %xmm1,%xmm3
jnz .Lenc_loop
movdqa -96(%r10),%xmm4
movdqa -80(%r10),%xmm0
.byte 102,15,56,0,226
pxor %xmm5,%xmm4
.byte 102,15,56,0,195
movdqa 64(%r11,%r10,1),%xmm1
pxor %xmm4,%xmm0
.byte 102,15,56,0,193
.byte 0xf3,0xc3
.cfi_endproc
.size _vpaes_encrypt_core,.-_vpaes_encrypt_core
.type _vpaes_decrypt_core,@function
.align 16
_vpaes_decrypt_core:
.cfi_startproc
movq %rdx,%r9
movl 240(%rdx),%eax
movdqa %xmm9,%xmm1
movdqa .Lk_dipt(%rip),%xmm2
pandn %xmm0,%xmm1
movq %rax,%r11
psrld $4,%xmm1
movdqu (%r9),%xmm5
shlq $4,%r11
pand %xmm9,%xmm0
.byte 102,15,56,0,208
movdqa .Lk_dipt+16(%rip),%xmm0
xorq $0x30,%r11
leaq .Lk_dsbd(%rip),%r10
.byte 102,15,56,0,193
andq $0x30,%r11
pxor %xmm5,%xmm2
movdqa .Lk_mc_forward+48(%rip),%xmm5
pxor %xmm2,%xmm0
addq $16,%r9
addq %r10,%r11
jmp .Ldec_entry
.align 16
.Ldec_loop:
movdqa -32(%r10),%xmm4
movdqa -16(%r10),%xmm1
.byte 102,15,56,0,226
.byte 102,15,56,0,203
pxor %xmm4,%xmm0
movdqa 0(%r10),%xmm4
pxor %xmm1,%xmm0
movdqa 16(%r10),%xmm1
.byte 102,15,56,0,226
.byte 102,15,56,0,197
.byte 102,15,56,0,203
pxor %xmm4,%xmm0
movdqa 32(%r10),%xmm4
pxor %xmm1,%xmm0
movdqa 48(%r10),%xmm1
.byte 102,15,56,0,226
.byte 102,15,56,0,197
.byte 102,15,56,0,203
pxor %xmm4,%xmm0
movdqa 64(%r10),%xmm4
pxor %xmm1,%xmm0
movdqa 80(%r10),%xmm1
.byte 102,15,56,0,226
.byte 102,15,56,0,197
.byte 102,15,56,0,203
pxor %xmm4,%xmm0
addq $16,%r9
.byte 102,15,58,15,237,12
pxor %xmm1,%xmm0
subq $1,%rax
.Ldec_entry:
movdqa %xmm9,%xmm1
pandn %xmm0,%xmm1
movdqa %xmm11,%xmm2
psrld $4,%xmm1
pand %xmm9,%xmm0
.byte 102,15,56,0,208
movdqa %xmm10,%xmm3
pxor %xmm1,%xmm0
.byte 102,15,56,0,217
movdqa %xmm10,%xmm4
pxor %xmm2,%xmm3
.byte 102,15,56,0,224
pxor %xmm2,%xmm4
movdqa %xmm10,%xmm2
.byte 102,15,56,0,211
movdqa %xmm10,%xmm3
pxor %xmm0,%xmm2
.byte 102,15,56,0,220
movdqu (%r9),%xmm0
pxor %xmm1,%xmm3
jnz .Ldec_loop
movdqa 96(%r10),%xmm4
.byte 102,15,56,0,226
pxor %xmm0,%xmm4
movdqa 112(%r10),%xmm0
movdqa -352(%r11),%xmm2
.byte 102,15,56,0,195
pxor %xmm4,%xmm0
.byte 102,15,56,0,194
.byte 0xf3,0xc3
.cfi_endproc
.size _vpaes_decrypt_core,.-_vpaes_decrypt_core
.type _vpaes_schedule_core,@function
.align 16
_vpaes_schedule_core:
.cfi_startproc
call _vpaes_preheat
movdqa .Lk_rcon(%rip),%xmm8
movdqu (%rdi),%xmm0
movdqa %xmm0,%xmm3
leaq .Lk_ipt(%rip),%r11
call _vpaes_schedule_transform
movdqa %xmm0,%xmm7
leaq .Lk_sr(%rip),%r10
testq %rcx,%rcx
jnz .Lschedule_am_decrypting
movdqu %xmm0,(%rdx)
jmp .Lschedule_go
.Lschedule_am_decrypting:
movdqa (%r8,%r10,1),%xmm1
.byte 102,15,56,0,217
movdqu %xmm3,(%rdx)
xorq $0x30,%r8
.Lschedule_go:
cmpl $192,%esi
ja .Lschedule_256
je .Lschedule_192
.Lschedule_128:
movl $10,%esi
.Loop_schedule_128:
call _vpaes_schedule_round
decq %rsi
jz .Lschedule_mangle_last
call _vpaes_schedule_mangle
jmp .Loop_schedule_128
.align 16
.Lschedule_192:
movdqu 8(%rdi),%xmm0
call _vpaes_schedule_transform
movdqa %xmm0,%xmm6
pxor %xmm4,%xmm4
movhlps %xmm4,%xmm6
movl $4,%esi
.Loop_schedule_192:
call _vpaes_schedule_round
.byte 102,15,58,15,198,8
call _vpaes_schedule_mangle
call _vpaes_schedule_192_smear
call _vpaes_schedule_mangle
call _vpaes_schedule_round
decq %rsi
jz .Lschedule_mangle_last
call _vpaes_schedule_mangle
call _vpaes_schedule_192_smear
jmp .Loop_schedule_192
.align 16
.Lschedule_256:
movdqu 16(%rdi),%xmm0
call _vpaes_schedule_transform
movl $7,%esi
.Loop_schedule_256:
call _vpaes_schedule_mangle
movdqa %xmm0,%xmm6
call _vpaes_schedule_round
decq %rsi
jz .Lschedule_mangle_last
call _vpaes_schedule_mangle
pshufd $0xFF,%xmm0,%xmm0
movdqa %xmm7,%xmm5
movdqa %xmm6,%xmm7
call _vpaes_schedule_low_round
movdqa %xmm5,%xmm7
jmp .Loop_schedule_256
.align 16
.Lschedule_mangle_last:
leaq .Lk_deskew(%rip),%r11
testq %rcx,%rcx
jnz .Lschedule_mangle_last_dec
movdqa (%r8,%r10,1),%xmm1
.byte 102,15,56,0,193
leaq .Lk_opt(%rip),%r11
addq $32,%rdx
.Lschedule_mangle_last_dec:
addq $-16,%rdx
pxor .Lk_s63(%rip),%xmm0
call _vpaes_schedule_transform
movdqu %xmm0,(%rdx)
pxor %xmm0,%xmm0
pxor %xmm1,%xmm1
pxor %xmm2,%xmm2
pxor %xmm3,%xmm3
pxor %xmm4,%xmm4
pxor %xmm5,%xmm5
pxor %xmm6,%xmm6
pxor %xmm7,%xmm7
.byte 0xf3,0xc3
.cfi_endproc
.size _vpaes_schedule_core,.-_vpaes_schedule_core
.type _vpaes_schedule_192_smear,@function
.align 16
_vpaes_schedule_192_smear:
.cfi_startproc
pshufd $0x80,%xmm6,%xmm1
pshufd $0xFE,%xmm7,%xmm0
pxor %xmm1,%xmm6
pxor %xmm1,%xmm1
pxor %xmm0,%xmm6
movdqa %xmm6,%xmm0
movhlps %xmm1,%xmm6
.byte 0xf3,0xc3
.cfi_endproc
.size _vpaes_schedule_192_smear,.-_vpaes_schedule_192_smear
.type _vpaes_schedule_round,@function
.align 16
_vpaes_schedule_round:
.cfi_startproc
pxor %xmm1,%xmm1
.byte 102,65,15,58,15,200,15
.byte 102,69,15,58,15,192,15
pxor %xmm1,%xmm7
pshufd $0xFF,%xmm0,%xmm0
.byte 102,15,58,15,192,1
_vpaes_schedule_low_round:
movdqa %xmm7,%xmm1
pslldq $4,%xmm7
pxor %xmm1,%xmm7
movdqa %xmm7,%xmm1
pslldq $8,%xmm7
pxor %xmm1,%xmm7
pxor .Lk_s63(%rip),%xmm7
movdqa %xmm9,%xmm1
pandn %xmm0,%xmm1
psrld $4,%xmm1
pand %xmm9,%xmm0
movdqa %xmm11,%xmm2
.byte 102,15,56,0,208
pxor %xmm1,%xmm0
movdqa %xmm10,%xmm3
.byte 102,15,56,0,217
pxor %xmm2,%xmm3
movdqa %xmm10,%xmm4
.byte 102,15,56,0,224
pxor %xmm2,%xmm4
movdqa %xmm10,%xmm2
.byte 102,15,56,0,211
pxor %xmm0,%xmm2
movdqa %xmm10,%xmm3
.byte 102,15,56,0,220
pxor %xmm1,%xmm3
movdqa %xmm13,%xmm4
.byte 102,15,56,0,226
movdqa %xmm12,%xmm0
.byte 102,15,56,0,195
pxor %xmm4,%xmm0
pxor %xmm7,%xmm0
movdqa %xmm0,%xmm7
.byte 0xf3,0xc3
.cfi_endproc
.size _vpaes_schedule_round,.-_vpaes_schedule_round
.type _vpaes_schedule_transform,@function
.align 16
_vpaes_schedule_transform:
.cfi_startproc
movdqa %xmm9,%xmm1
pandn %xmm0,%xmm1
psrld $4,%xmm1
pand %xmm9,%xmm0
movdqa (%r11),%xmm2
.byte 102,15,56,0,208
movdqa 16(%r11),%xmm0
.byte 102,15,56,0,193
pxor %xmm2,%xmm0
.byte 0xf3,0xc3
.cfi_endproc
.size _vpaes_schedule_transform,.-_vpaes_schedule_transform
.type _vpaes_schedule_mangle,@function
.align 16
_vpaes_schedule_mangle:
.cfi_startproc
movdqa %xmm0,%xmm4
movdqa .Lk_mc_forward(%rip),%xmm5
testq %rcx,%rcx
jnz .Lschedule_mangle_dec
addq $16,%rdx
pxor .Lk_s63(%rip),%xmm4
.byte 102,15,56,0,229
movdqa %xmm4,%xmm3
.byte 102,15,56,0,229
pxor %xmm4,%xmm3
.byte 102,15,56,0,229
pxor %xmm4,%xmm3
jmp .Lschedule_mangle_both
.align 16
.Lschedule_mangle_dec:
leaq .Lk_dksd(%rip),%r11
movdqa %xmm9,%xmm1
pandn %xmm4,%xmm1
psrld $4,%xmm1
pand %xmm9,%xmm4
movdqa 0(%r11),%xmm2
.byte 102,15,56,0,212
movdqa 16(%r11),%xmm3
.byte 102,15,56,0,217
pxor %xmm2,%xmm3
.byte 102,15,56,0,221
movdqa 32(%r11),%xmm2
.byte 102,15,56,0,212
pxor %xmm3,%xmm2
movdqa 48(%r11),%xmm3
.byte 102,15,56,0,217
pxor %xmm2,%xmm3
.byte 102,15,56,0,221
movdqa 64(%r11),%xmm2
.byte 102,15,56,0,212
pxor %xmm3,%xmm2
movdqa 80(%r11),%xmm3
.byte 102,15,56,0,217
pxor %xmm2,%xmm3
.byte 102,15,56,0,221
movdqa 96(%r11),%xmm2
.byte 102,15,56,0,212
pxor %xmm3,%xmm2
movdqa 112(%r11),%xmm3
.byte 102,15,56,0,217
pxor %xmm2,%xmm3
addq $-16,%rdx
.Lschedule_mangle_both:
movdqa (%r8,%r10,1),%xmm1
.byte 102,15,56,0,217
addq $-16,%r8
andq $0x30,%r8
movdqu %xmm3,(%rdx)
.byte 0xf3,0xc3
.cfi_endproc
.size _vpaes_schedule_mangle,.-_vpaes_schedule_mangle
.globl vpaes_set_encrypt_key
.type vpaes_set_encrypt_key,@function
.align 16
vpaes_set_encrypt_key:
.cfi_startproc
movl %esi,%eax
shrl $5,%eax
addl $5,%eax
movl %eax,240(%rdx)
movl $0,%ecx
movl $0x30,%r8d
call _vpaes_schedule_core
xorl %eax,%eax
.byte 0xf3,0xc3
.cfi_endproc
.size vpaes_set_encrypt_key,.-vpaes_set_encrypt_key
.globl vpaes_set_decrypt_key
.type vpaes_set_decrypt_key,@function
.align 16
vpaes_set_decrypt_key:
.cfi_startproc
movl %esi,%eax
shrl $5,%eax
addl $5,%eax
movl %eax,240(%rdx)
shll $4,%eax
leaq 16(%rdx,%rax,1),%rdx
movl $1,%ecx
movl %esi,%r8d
shrl $1,%r8d
andl $32,%r8d
xorl $32,%r8d
call _vpaes_schedule_core
xorl %eax,%eax
.byte 0xf3,0xc3
.cfi_endproc
.size vpaes_set_decrypt_key,.-vpaes_set_decrypt_key
.globl vpaes_encrypt
.type vpaes_encrypt,@function
.align 16
vpaes_encrypt:
.cfi_startproc
movdqu (%rdi),%xmm0
call _vpaes_preheat
call _vpaes_encrypt_core
movdqu %xmm0,(%rsi)
.byte 0xf3,0xc3
.cfi_endproc
.size vpaes_encrypt,.-vpaes_encrypt
.globl vpaes_decrypt
.type vpaes_decrypt,@function
.align 16
vpaes_decrypt:
.cfi_startproc
movdqu (%rdi),%xmm0
call _vpaes_preheat
call _vpaes_decrypt_core
movdqu %xmm0,(%rsi)
.byte 0xf3,0xc3
.cfi_endproc
.size vpaes_decrypt,.-vpaes_decrypt
.globl vpaes_cbc_encrypt
.type vpaes_cbc_encrypt,@function
.align 16
vpaes_cbc_encrypt:
.cfi_startproc
xchgq %rcx,%rdx
subq $16,%rcx
jc .Lcbc_abort
movdqu (%r8),%xmm6
subq %rdi,%rsi
call _vpaes_preheat
cmpl $0,%r9d
je .Lcbc_dec_loop
jmp .Lcbc_enc_loop
.align 16
.Lcbc_enc_loop:
movdqu (%rdi),%xmm0
pxor %xmm6,%xmm0
call _vpaes_encrypt_core
movdqa %xmm0,%xmm6
movdqu %xmm0,(%rsi,%rdi,1)
leaq 16(%rdi),%rdi
subq $16,%rcx
jnc .Lcbc_enc_loop
jmp .Lcbc_done
.align 16
.Lcbc_dec_loop:
movdqu (%rdi),%xmm0
movdqa %xmm0,%xmm7
call _vpaes_decrypt_core
pxor %xmm6,%xmm0
movdqa %xmm7,%xmm6
movdqu %xmm0,(%rsi,%rdi,1)
leaq 16(%rdi),%rdi
subq $16,%rcx
jnc .Lcbc_dec_loop
.Lcbc_done:
movdqu %xmm6,(%r8)
.Lcbc_abort:
.byte 0xf3,0xc3
.cfi_endproc
.size vpaes_cbc_encrypt,.-vpaes_cbc_encrypt
.type _vpaes_preheat,@function
.align 16
_vpaes_preheat:
.cfi_startproc
leaq .Lk_s0F(%rip),%r10
movdqa -32(%r10),%xmm10
movdqa -16(%r10),%xmm11
movdqa 0(%r10),%xmm9
movdqa 48(%r10),%xmm13
movdqa 64(%r10),%xmm12
movdqa 80(%r10),%xmm15
movdqa 96(%r10),%xmm14
.byte 0xf3,0xc3
.cfi_endproc
.size _vpaes_preheat,.-_vpaes_preheat
.type _vpaes_consts,@object
.align 64
_vpaes_consts:
.Lk_inv:
.quad 0x0E05060F0D080180, 0x040703090A0B0C02
.quad 0x01040A060F0B0780, 0x030D0E0C02050809
.Lk_s0F:
.quad 0x0F0F0F0F0F0F0F0F, 0x0F0F0F0F0F0F0F0F
.Lk_ipt:
.quad 0xC2B2E8985A2A7000, 0xCABAE09052227808
.quad 0x4C01307D317C4D00, 0xCD80B1FCB0FDCC81
.Lk_sb1:
.quad 0xB19BE18FCB503E00, 0xA5DF7A6E142AF544
.quad 0x3618D415FAE22300, 0x3BF7CCC10D2ED9EF
.Lk_sb2:
.quad 0xE27A93C60B712400, 0x5EB7E955BC982FCD
.quad 0x69EB88400AE12900, 0xC2A163C8AB82234A
.Lk_sbo:
.quad 0xD0D26D176FBDC700, 0x15AABF7AC502A878
.quad 0xCFE474A55FBB6A00, 0x8E1E90D1412B35FA
.Lk_mc_forward:
.quad 0x0407060500030201, 0x0C0F0E0D080B0A09
.quad 0x080B0A0904070605, 0x000302010C0F0E0D
.quad 0x0C0F0E0D080B0A09, 0x0407060500030201
.quad 0x000302010C0F0E0D, 0x080B0A0904070605
.Lk_mc_backward:
.quad 0x0605040702010003, 0x0E0D0C0F0A09080B
.quad 0x020100030E0D0C0F, 0x0A09080B06050407
.quad 0x0E0D0C0F0A09080B, 0x0605040702010003
.quad 0x0A09080B06050407, 0x020100030E0D0C0F
.Lk_sr:
.quad 0x0706050403020100, 0x0F0E0D0C0B0A0908
.quad 0x030E09040F0A0500, 0x0B06010C07020D08
.quad 0x0F060D040B020900, 0x070E050C030A0108
.quad 0x0B0E0104070A0D00, 0x0306090C0F020508
.Lk_rcon:
.quad 0x1F8391B9AF9DEEB6, 0x702A98084D7C7D81
.Lk_s63:
.quad 0x5B5B5B5B5B5B5B5B, 0x5B5B5B5B5B5B5B5B
.Lk_opt:
.quad 0xFF9F4929D6B66000, 0xF7974121DEBE6808
.quad 0x01EDBD5150BCEC00, 0xE10D5DB1B05C0CE0
.Lk_deskew:
.quad 0x07E4A34047A4E300, 0x1DFEB95A5DBEF91A
.quad 0x5F36B5DC83EA6900, 0x2841C2ABF49D1E77
.Lk_dksd:
.quad 0xFEB91A5DA3E44700, 0x0740E3A45A1DBEF9
.quad 0x41C277F4B5368300, 0x5FDC69EAAB289D1E
.Lk_dksb:
.quad 0x9A4FCA1F8550D500, 0x03D653861CC94C99
.quad 0x115BEDA7B6FC4A00, 0xD993256F7E3482C8
.Lk_dkse:
.quad 0xD5031CCA1FC9D600, 0x53859A4C994F5086
.quad 0xA23196054FDC7BE8, 0xCD5EF96A20B31487
.Lk_dks9:
.quad 0xB6116FC87ED9A700, 0x4AED933482255BFC
.quad 0x4576516227143300, 0x8BB89FACE9DAFDCE
.Lk_dipt:
.quad 0x0F505B040B545F00, 0x154A411E114E451A
.quad 0x86E383E660056500, 0x12771772F491F194
.Lk_dsb9:
.quad 0x851C03539A86D600, 0xCAD51F504F994CC9
.quad 0xC03B1789ECD74900, 0x725E2C9EB2FBA565
.Lk_dsbd:
.quad 0x7D57CCDFE6B1A200, 0xF56E9B13882A4439
.quad 0x3CE2FAF724C6CB00, 0x2931180D15DEEFD3
.Lk_dsbb:
.quad 0xD022649296B44200, 0x602646F6B0F2D404
.quad 0xC19498A6CD596700, 0xF3FF0C3E3255AA6B
.Lk_dsbe:
.quad 0x46F2929626D4D000, 0x2242600464B4F6B0
.quad 0x0C55A6CDFFAAC100, 0x9467F36B98593E32
.Lk_dsbo:
.quad 0x1387EA537EF94000, 0xC7AA6DB9D4943E2D
.quad 0x12D7560F93441D00, 0xCA4B8159D8C58E9C
.byte 86,101,99,116,111,114,32,80,101,114,109,117,116,97,116,105,111,110,32,65,69,83,32,102,111,114,32,120,56,54,95,54,52,47,83,83,83,69,51,44,32,77,105,107,101,32,72,97,109,98,117,114,103,32,40,83,116,97,110,102,111,114,100,32,85,110,105,118,101,114,115,105,116,121,41,0
.align 64
.size _vpaes_consts,.-_vpaes_consts
......@@ -68,6 +68,12 @@ void OPENSSL_cpuid_setup(void) __attribute__ ((constructor));
# include <sys/auxv.h>
# define OSSL_IMPLEMENT_GETAUXVAL
# endif
# elif defined(__ANDROID_API__)
/* see https://developer.android.google.cn/ndk/guides/cpu-features */
# if __ANDROID_API__ >= 18
# include <sys/auxv.h>
# define OSSL_IMPLEMENT_GETAUXVAL
# endif
# endif
# if defined(__FreeBSD__)
# include <sys/param.h>
......@@ -87,24 +93,36 @@ static unsigned long getauxval(unsigned long key)
# endif
# endif
/*
* Android: according to https://developer.android.com/ndk/guides/cpu-features,
* getauxval is supported starting with API level 18
*/
# if defined(__ANDROID__) && defined(__ANDROID_API__) && __ANDROID_API__ >= 18
# include <sys/auxv.h>
# define OSSL_IMPLEMENT_GETAUXVAL
# endif
/*
* ARM puts the feature bits for Crypto Extensions in AT_HWCAP2, whereas
* AArch64 used AT_HWCAP.
*/
# ifndef AT_HWCAP
# define AT_HWCAP 16
# endif
# ifndef AT_HWCAP2
# define AT_HWCAP2 26
# endif
# if defined(__arm__) || defined (__arm)
# define HWCAP 16
/* AT_HWCAP */
# define HWCAP AT_HWCAP
# define HWCAP_NEON (1 << 12)
# define HWCAP_CE 26
/* AT_HWCAP2 */
# define HWCAP_CE AT_HWCAP2
# define HWCAP_CE_AES (1 << 0)
# define HWCAP_CE_PMULL (1 << 1)
# define HWCAP_CE_SHA1 (1 << 2)
# define HWCAP_CE_SHA256 (1 << 3)
# elif defined(__aarch64__)
# define HWCAP 16
/* AT_HWCAP */
# define HWCAP AT_HWCAP
# define HWCAP_NEON (1 << 1)
# define HWCAP_CE HWCAP
......
/*
* Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
......@@ -286,16 +286,13 @@ ASN1_OBJECT *c2i_ASN1_OBJECT(ASN1_OBJECT **a, const unsigned char **pp,
}
}
/*
* only the ASN1_OBJECTs from the 'table' will have values for ->sn or
* ->ln
*/
if ((a == NULL) || ((*a) == NULL) ||
!((*a)->flags & ASN1_OBJECT_FLAG_DYNAMIC)) {
if ((ret = ASN1_OBJECT_new()) == NULL)
return NULL;
} else
} else {
ret = (*a);
}
p = *pp;
/* detach data from object */
......@@ -313,6 +310,12 @@ ASN1_OBJECT *c2i_ASN1_OBJECT(ASN1_OBJECT **a, const unsigned char **pp,
ret->flags |= ASN1_OBJECT_FLAG_DYNAMIC_DATA;
}
memcpy(data, p, length);
/* If there are dynamic strings, free them here, and clear the flag */
if ((ret->flags & ASN1_OBJECT_FLAG_DYNAMIC_STRINGS) != 0) {
OPENSSL_free((char *)ret->sn);
OPENSSL_free((char *)ret->ln);
ret->flags &= ~ASN1_OBJECT_FLAG_DYNAMIC_STRINGS;
}
/* reattach data to object, after which it remains const */
ret->data = data;
ret->length = length;
......
/*
* Copyright 1995-2017 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
......@@ -18,12 +18,13 @@ int ASN1_PRINTABLE_type(const unsigned char *s, int len)
int ia5 = 0;
int t61 = 0;
if (len <= 0)
len = -1;
if (s == NULL)
return V_ASN1_PRINTABLESTRING;
while ((*s) && (len-- != 0)) {
if (len < 0)
len = strlen((const char *)s);
while (len-- > 0) {
c = *(s++);
if (!ossl_isasn1print(c))
ia5 = 1;
......
/*
* Copyright 2000-2018 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 2000-2021 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
......@@ -280,6 +280,8 @@ static int do_dump(unsigned long lflags, char_io *io_ch, void *arg,
t.type = str->type;
t.value.ptr = (char *)str;
der_len = i2d_ASN1_TYPE(&t, NULL);
if (der_len <= 0)
return -1;
if ((der_buf = OPENSSL_malloc(der_len)) == NULL) {
ASN1err(ASN1_F_DO_DUMP, ERR_R_MALLOC_FAILURE);
return -1;
......
/*
* Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
......@@ -292,7 +292,12 @@ int ASN1_STRING_set(ASN1_STRING *str, const void *_data, int len_in)
}
if ((size_t)str->length <= len || str->data == NULL) {
c = str->data;
#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
/* No NUL terminator in fuzzing builds */
str->data = OPENSSL_realloc(c, len != 0 ? len : 1);
#else
str->data = OPENSSL_realloc(c, len + 1);
#endif
if (str->data == NULL) {
ASN1err(ASN1_F_ASN1_STRING_SET, ERR_R_MALLOC_FAILURE);
str->data = c;
......@@ -302,8 +307,17 @@ int ASN1_STRING_set(ASN1_STRING *str, const void *_data, int len_in)
str->length = len;
if (data != NULL) {
memcpy(str->data, data, len);
/* an allowance for strings :-) */
#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
/* Set the unused byte to something non NUL and printable. */
if (len == 0)
str->data[len] = '~';
#else
/*
* Add a NUL terminator. This should not be necessary - but we add it as
* a safety precaution
*/
str->data[len] = '\0';
#endif
}
return 1;
}
......@@ -365,7 +379,8 @@ int ASN1_STRING_cmp(const ASN1_STRING *a, const ASN1_STRING *b)
i = (a->length - b->length);
if (i == 0) {
i = memcmp(a->data, b->data, a->length);
if (a->length != 0)
i = memcmp(a->data, b->data, a->length);
if (i == 0)
return a->type - b->type;
else
......
/*
* Copyright 2006-2018 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 2006-2021 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
......@@ -138,6 +138,11 @@ static int asn1_bio_free(BIO *b)
if (ctx == NULL)
return 0;
if (ctx->prefix_free != NULL)
ctx->prefix_free(b, &ctx->ex_buf, &ctx->ex_len, &ctx->ex_arg);
if (ctx->suffix_free != NULL)
ctx->suffix_free(b, &ctx->ex_buf, &ctx->ex_len, &ctx->ex_arg);
OPENSSL_free(ctx->buf);
OPENSSL_free(ctx);
BIO_set_data(b, NULL);
......
......@@ -142,6 +142,9 @@ static int ndef_prefix_free(BIO *b, unsigned char **pbuf, int *plen,
ndef_aux = *(NDEF_SUPPORT **)parg;
if (ndef_aux == NULL)
return 0;
OPENSSL_free(ndef_aux->derbuf);
ndef_aux->derbuf = NULL;
......
......@@ -2,7 +2,7 @@
* WARNING: do not edit!
* Generated by crypto/asn1/charmap.pl
*
* Copyright 2000-2021 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 2000-2022 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
......
/*
* Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
......@@ -78,13 +78,53 @@ EVP_PKEY *d2i_PrivateKey(int type, EVP_PKEY **a, const unsigned char **pp,
* type
*/
static EVP_PKEY *key_as_pkcs8(const unsigned char **pp, long length, int *carry_on)
{
const unsigned char *p = *pp;
PKCS8_PRIV_KEY_INFO *p8 = d2i_PKCS8_PRIV_KEY_INFO(NULL, &p, length);
EVP_PKEY *ret;
if (p8 == NULL)
return NULL;
ret = EVP_PKCS82PKEY(p8);
if (ret == NULL)
*carry_on = 0;
PKCS8_PRIV_KEY_INFO_free(p8);
if (ret != NULL)
*pp = p;
return ret;
}
EVP_PKEY *d2i_AutoPrivateKey(EVP_PKEY **a, const unsigned char **pp,
long length)
{
STACK_OF(ASN1_TYPE) *inkey;
const unsigned char *p;
int keytype;
EVP_PKEY *ret = NULL;
int carry_on = 1;
ERR_set_mark();
ret = key_as_pkcs8(pp, length, &carry_on);
if (ret != NULL) {
ERR_clear_last_mark();
if (a != NULL)
*a = ret;
return ret;
}
if (carry_on == 0) {
ERR_clear_last_mark();
ASN1err(ASN1_F_D2I_AUTOPRIVATEKEY,
ASN1_R_UNSUPPORTED_PUBLIC_KEY_TYPE);
return NULL;
}
p = *pp;
/*
* Dirty trick: read in the ASN1 data into a STACK_OF(ASN1_TYPE): by
* analyzing it we can determine the passed structure: this assumes the
......@@ -100,28 +140,15 @@ EVP_PKEY *d2i_AutoPrivateKey(EVP_PKEY **a, const unsigned char **pp,
keytype = EVP_PKEY_DSA;
else if (sk_ASN1_TYPE_num(inkey) == 4)
keytype = EVP_PKEY_EC;
else if (sk_ASN1_TYPE_num(inkey) == 3) { /* This seems to be PKCS8, not
* traditional format */
PKCS8_PRIV_KEY_INFO *p8 = d2i_PKCS8_PRIV_KEY_INFO(NULL, &p, length);
EVP_PKEY *ret;
sk_ASN1_TYPE_pop_free(inkey, ASN1_TYPE_free);
if (!p8) {
ASN1err(ASN1_F_D2I_AUTOPRIVATEKEY,
ASN1_R_UNSUPPORTED_PUBLIC_KEY_TYPE);
return NULL;
}
ret = EVP_PKCS82PKEY(p8);
PKCS8_PRIV_KEY_INFO_free(p8);
if (ret == NULL)
return NULL;
*pp = p;
if (a) {
*a = ret;
}
return ret;
} else
else
keytype = EVP_PKEY_RSA;
sk_ASN1_TYPE_pop_free(inkey, ASN1_TYPE_free);
return d2i_PrivateKey(keytype, a, pp, length);
ret = d2i_PrivateKey(keytype, a, pp, length);
if (ret != NULL)
ERR_pop_to_mark();
else
ERR_clear_last_mark();
return ret;
}
/*
* Copyright 1999-2016 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 1999-2021 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
......
/*
* Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 2016-2022 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
......@@ -689,7 +689,7 @@ int BIO_lookup_ex(const char *host, const char *service, int lookup_type,
hints.ai_protocol = protocol;
# ifdef AI_ADDRCONFIG
# ifdef AF_UNSPEC
if (family == AF_UNSPEC)
if (host != NULL && family == AF_UNSPEC)
# endif
hints.ai_flags |= AI_ADDRCONFIG;
# endif
......@@ -744,7 +744,7 @@ int BIO_lookup_ex(const char *host, const char *service, int lookup_type,
# pragma pointer_size 32
#endif
/* Windows doesn't seem to have in_addr_t */
#ifdef OPENSSL_SYS_WINDOWS
#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MSDOS)
static uint32_t he_fallback_address;
static const char *he_fallback_addresses[] =
{ (char *)&he_fallback_address, NULL };
......
/*
* Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 2016-2021 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
......@@ -243,7 +243,8 @@ int BIO_listen(int sock, const BIO_ADDR *addr, int options)
}
}
# ifdef IPV6_V6ONLY
/* On OpenBSD it is always ipv6 only with ipv6 sockets thus read-only */
# if defined(IPV6_V6ONLY) && !defined(__OpenBSD__)
if (BIO_ADDR_family(addr) == AF_INET6) {
/*
* Note: Windows default of IPV6_V6ONLY is ON, and Linux is OFF.
......
/*
* Copyright 2005-2019 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 2005-2021 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
......@@ -7,6 +7,10 @@
* https://www.openssl.org/source/license.html
*/
#ifndef _GNU_SOURCE
# define _GNU_SOURCE
#endif
#include <stdio.h>
#include <errno.h>
......
/*
* Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
......@@ -280,7 +280,7 @@ static long mem_ctrl(BIO *b, int cmd, long num, void *ptr)
ret = (long)bm->length;
if (ptr != NULL) {
pptr = (char **)ptr;
*pptr = (char *)&(bm->data[0]);
*pptr = (char *)bm->data;
}
break;
case BIO_C_SET_BUF_MEM:
......
#! /usr/bin/env perl
# Copyright 2010-2020 The OpenSSL Project Authors. All Rights Reserved.
# Copyright 2010-2021 The OpenSSL Project Authors. All Rights Reserved.
#
# Licensed under the OpenSSL license (the "License"). You may not use
# this file except in compliance with the License. You can obtain a copy
......
此差异已折叠。
此差异已折叠。
.text
.type _mul_1x1,@function
.align 16
_mul_1x1:
.cfi_startproc
subq $128+8,%rsp
.cfi_adjust_cfa_offset 128+8
movq $-1,%r9
leaq (%rax,%rax,1),%rsi
shrq $3,%r9
leaq (,%rax,4),%rdi
andq %rax,%r9
leaq (,%rax,8),%r12
sarq $63,%rax
leaq (%r9,%r9,1),%r10
sarq $63,%rsi
leaq (,%r9,4),%r11
andq %rbp,%rax
sarq $63,%rdi
movq %rax,%rdx
shlq $63,%rax
andq %rbp,%rsi
shrq $1,%rdx
movq %rsi,%rcx
shlq $62,%rsi
andq %rbp,%rdi
shrq $2,%rcx
xorq %rsi,%rax
movq %rdi,%rbx
shlq $61,%rdi
xorq %rcx,%rdx
shrq $3,%rbx
xorq %rdi,%rax
xorq %rbx,%rdx
movq %r9,%r13
movq $0,0(%rsp)
xorq %r10,%r13
movq %r9,8(%rsp)
movq %r11,%r14
movq %r10,16(%rsp)
xorq %r12,%r14
movq %r13,24(%rsp)
xorq %r11,%r9
movq %r11,32(%rsp)
xorq %r11,%r10
movq %r9,40(%rsp)
xorq %r11,%r13
movq %r10,48(%rsp)
xorq %r14,%r9
movq %r13,56(%rsp)
xorq %r14,%r10
movq %r12,64(%rsp)
xorq %r14,%r13
movq %r9,72(%rsp)
xorq %r11,%r9
movq %r10,80(%rsp)
xorq %r11,%r10
movq %r13,88(%rsp)
xorq %r11,%r13
movq %r14,96(%rsp)
movq %r8,%rsi
movq %r9,104(%rsp)
andq %rbp,%rsi
movq %r10,112(%rsp)
shrq $4,%rbp
movq %r13,120(%rsp)
movq %r8,%rdi
andq %rbp,%rdi
shrq $4,%rbp
movq (%rsp,%rsi,8),%xmm0
movq %r8,%rsi
andq %rbp,%rsi
shrq $4,%rbp
movq (%rsp,%rdi,8),%rcx
movq %r8,%rdi
movq %rcx,%rbx
shlq $4,%rcx
andq %rbp,%rdi
movq (%rsp,%rsi,8),%xmm1
shrq $60,%rbx
xorq %rcx,%rax
pslldq $1,%xmm1
movq %r8,%rsi
shrq $4,%rbp
xorq %rbx,%rdx
andq %rbp,%rsi
shrq $4,%rbp
pxor %xmm1,%xmm0
movq (%rsp,%rdi,8),%rcx
movq %r8,%rdi
movq %rcx,%rbx
shlq $12,%rcx
andq %rbp,%rdi
movq (%rsp,%rsi,8),%xmm1
shrq $52,%rbx
xorq %rcx,%rax
pslldq $2,%xmm1
movq %r8,%rsi
shrq $4,%rbp
xorq %rbx,%rdx
andq %rbp,%rsi
shrq $4,%rbp
pxor %xmm1,%xmm0
movq (%rsp,%rdi,8),%rcx
movq %r8,%rdi
movq %rcx,%rbx
shlq $20,%rcx
andq %rbp,%rdi
movq (%rsp,%rsi,8),%xmm1
shrq $44,%rbx
xorq %rcx,%rax
pslldq $3,%xmm1
movq %r8,%rsi
shrq $4,%rbp
xorq %rbx,%rdx
andq %rbp,%rsi
shrq $4,%rbp
pxor %xmm1,%xmm0
movq (%rsp,%rdi,8),%rcx
movq %r8,%rdi
movq %rcx,%rbx
shlq $28,%rcx
andq %rbp,%rdi
movq (%rsp,%rsi,8),%xmm1
shrq $36,%rbx
xorq %rcx,%rax
pslldq $4,%xmm1
movq %r8,%rsi
shrq $4,%rbp
xorq %rbx,%rdx
andq %rbp,%rsi
shrq $4,%rbp
pxor %xmm1,%xmm0
movq (%rsp,%rdi,8),%rcx
movq %r8,%rdi
movq %rcx,%rbx
shlq $36,%rcx
andq %rbp,%rdi
movq (%rsp,%rsi,8),%xmm1
shrq $28,%rbx
xorq %rcx,%rax
pslldq $5,%xmm1
movq %r8,%rsi
shrq $4,%rbp
xorq %rbx,%rdx
andq %rbp,%rsi
shrq $4,%rbp
pxor %xmm1,%xmm0
movq (%rsp,%rdi,8),%rcx
movq %r8,%rdi
movq %rcx,%rbx
shlq $44,%rcx
andq %rbp,%rdi
movq (%rsp,%rsi,8),%xmm1
shrq $20,%rbx
xorq %rcx,%rax
pslldq $6,%xmm1
movq %r8,%rsi
shrq $4,%rbp
xorq %rbx,%rdx
andq %rbp,%rsi
shrq $4,%rbp
pxor %xmm1,%xmm0
movq (%rsp,%rdi,8),%rcx
movq %r8,%rdi
movq %rcx,%rbx
shlq $52,%rcx
andq %rbp,%rdi
movq (%rsp,%rsi,8),%xmm1
shrq $12,%rbx
xorq %rcx,%rax
pslldq $7,%xmm1
movq %r8,%rsi
shrq $4,%rbp
xorq %rbx,%rdx
andq %rbp,%rsi
shrq $4,%rbp
pxor %xmm1,%xmm0
movq (%rsp,%rdi,8),%rcx
movq %rcx,%rbx
shlq $60,%rcx
.byte 102,72,15,126,198
shrq $4,%rbx
xorq %rcx,%rax
psrldq $8,%xmm0
xorq %rbx,%rdx
.byte 102,72,15,126,199
xorq %rsi,%rax
xorq %rdi,%rdx
addq $128+8,%rsp
.cfi_adjust_cfa_offset -128-8
.byte 0xf3,0xc3
.Lend_mul_1x1:
.cfi_endproc
.size _mul_1x1,.-_mul_1x1
.globl bn_GF2m_mul_2x2
.type bn_GF2m_mul_2x2,@function
.align 16
bn_GF2m_mul_2x2:
.cfi_startproc
movq %rsp,%rax
movq OPENSSL_ia32cap_P(%rip),%r10
btq $33,%r10
jnc .Lvanilla_mul_2x2
.byte 102,72,15,110,198
.byte 102,72,15,110,201
.byte 102,72,15,110,210
.byte 102,73,15,110,216
movdqa %xmm0,%xmm4
movdqa %xmm1,%xmm5
.byte 102,15,58,68,193,0
pxor %xmm2,%xmm4
pxor %xmm3,%xmm5
.byte 102,15,58,68,211,0
.byte 102,15,58,68,229,0
xorps %xmm0,%xmm4
xorps %xmm2,%xmm4
movdqa %xmm4,%xmm5
pslldq $8,%xmm4
psrldq $8,%xmm5
pxor %xmm4,%xmm2
pxor %xmm5,%xmm0
movdqu %xmm2,0(%rdi)
movdqu %xmm0,16(%rdi)
.byte 0xf3,0xc3
.align 16
.Lvanilla_mul_2x2:
leaq -136(%rsp),%rsp
.cfi_adjust_cfa_offset 8*17
movq %r14,80(%rsp)
.cfi_rel_offset %r14,8*10
movq %r13,88(%rsp)
.cfi_rel_offset %r13,8*11
movq %r12,96(%rsp)
.cfi_rel_offset %r12,8*12
movq %rbp,104(%rsp)
.cfi_rel_offset %rbp,8*13
movq %rbx,112(%rsp)
.cfi_rel_offset %rbx,8*14
.Lbody_mul_2x2:
movq %rdi,32(%rsp)
movq %rsi,40(%rsp)
movq %rdx,48(%rsp)
movq %rcx,56(%rsp)
movq %r8,64(%rsp)
movq $0xf,%r8
movq %rsi,%rax
movq %rcx,%rbp
call _mul_1x1
movq %rax,16(%rsp)
movq %rdx,24(%rsp)
movq 48(%rsp),%rax
movq 64(%rsp),%rbp
call _mul_1x1
movq %rax,0(%rsp)
movq %rdx,8(%rsp)
movq 40(%rsp),%rax
movq 56(%rsp),%rbp
xorq 48(%rsp),%rax
xorq 64(%rsp),%rbp
call _mul_1x1
movq 0(%rsp),%rbx
movq 8(%rsp),%rcx
movq 16(%rsp),%rdi
movq 24(%rsp),%rsi
movq 32(%rsp),%rbp
xorq %rdx,%rax
xorq %rcx,%rdx
xorq %rbx,%rax
movq %rbx,0(%rbp)
xorq %rdi,%rdx
movq %rsi,24(%rbp)
xorq %rsi,%rax
xorq %rsi,%rdx
xorq %rdx,%rax
movq %rdx,16(%rbp)
movq %rax,8(%rbp)
movq 80(%rsp),%r14
.cfi_restore %r14
movq 88(%rsp),%r13
.cfi_restore %r13
movq 96(%rsp),%r12
.cfi_restore %r12
movq 104(%rsp),%rbp
.cfi_restore %rbp
movq 112(%rsp),%rbx
.cfi_restore %rbx
leaq 136(%rsp),%rsp
.cfi_adjust_cfa_offset -8*17
.Lepilogue_mul_2x2:
.byte 0xf3,0xc3
.Lend_mul_2x2:
.cfi_endproc
.size bn_GF2m_mul_2x2,.-bn_GF2m_mul_2x2
.byte 71,70,40,50,94,109,41,32,77,117,108,116,105,112,108,105,99,97,116,105,111,110,32,102,111,114,32,120,56,54,95,54,52,44,32,67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103,62,0
.align 16
此差异已折叠。
此差异已折叠。
/*
* Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
......@@ -268,7 +268,7 @@ int bn_div_fixed_top(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num,
BIGNUM *tmp, *snum, *sdiv, *res;
BN_ULONG *resp, *wnum, *wnumtop;
BN_ULONG d0, d1;
int num_n, div_n;
int num_n, div_n, num_neg;
assert(divisor->top > 0 && divisor->d[divisor->top - 1] != 0);
......@@ -326,7 +326,8 @@ int bn_div_fixed_top(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num,
/* Setup quotient */
if (!bn_wexpand(res, loop))
goto err;
res->neg = (num->neg ^ divisor->neg);
num_neg = num->neg;
res->neg = (num_neg ^ divisor->neg);
res->top = loop;
res->flags |= BN_FLG_FIXED_TOP;
resp = &(res->d[loop]);
......@@ -442,7 +443,7 @@ int bn_div_fixed_top(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num,
*--resp = q;
}
/* snum holds remainder, it's as wide as divisor */
snum->neg = num->neg;
snum->neg = num_neg;
snum->top = div_n;
snum->flags |= BN_FLG_FIXED_TOP;
if (rm != NULL)
......
/*
* Copyright 1995-2017 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
......@@ -32,7 +32,7 @@ int BN_mod_exp2_mont(BIGNUM *rr, const BIGNUM *a1, const BIGNUM *p1,
bn_check_top(p2);
bn_check_top(m);
if (!(m->d[0] & 1)) {
if (!BN_is_odd(m)) {
BNerr(BN_F_BN_MOD_EXP2_MONT, BN_R_CALLED_WITH_EVEN_MODULUS);
return 0;
}
......
......@@ -2,7 +2,7 @@
* WARNING: do not edit!
* Generated by crypto/bn/bn_prime.pl
*
* Copyright 1998-2021 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 1998-2022 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
......
......@@ -142,7 +142,7 @@ int BN_hex2bn(BIGNUM **bn, const char *a)
continue;
if (i == 0 || i > INT_MAX / 4)
goto err;
return 0;
num = i + neg;
if (bn == NULL)
......
/*
* Copyright 2000-2019 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 2000-2022 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
......
......@@ -12,7 +12,7 @@
#ifdef OPENSSL_ARM64_PLATFORM
#define PLATFORM "platform: android-arm64"
#define DATE "built on: Tue Aug 3 08:25:48 2021 UTC"
#define DATE "built on: Mon Jun 13 02:52:02 2022 UTC"
/*
* Generate compiler_flags as an array of individual characters. This is a
......@@ -24,30 +24,34 @@ static const char compiler_flags[] = {
'4','-','l','i','n','u','x','-','a','n','d','r','o','i','d','-',
'c','l','a','n','g',' ','-','f','P','I','C',' ','-','p','t','h',
'r','e','a','d',' ',' ','-','-','s','y','s','r','o','o','t','=',
'/','h','o','m','e','/','h','u','a','n','g','j','u','n','/','o',
'p','e','n','s','s','l','/','m','y','-','a','n','d','r','o','i',
'd','6','4','-','t','o','o','l','c','h','a','i','n','/','s','y',
's','r','o','o','t',' ','-','W','a',',','-','-','n','o','e','x',
'e','c','s','t','a','c','k',' ','-','Q','u','n','u','s','e','d',
'-','a','r','g','u','m','e','n','t','s',' ','-','W','a','l','l',
' ','-','O','3',' ','-','D','O','P','E','N','S','S','L','_','U',
'S','E','_','N','O','D','E','L','E','T','E',' ','-','D','O','P',
'E','N','S','S','L','_','P','I','C',' ','-','D','O','P','E','N',
'S','S','L','_','C','P','U','I','D','_','O','B','J',' ','-','D',
'O','P','E','N','S','S','L','_','B','N','_','A','S','M','_','M',
'O','N','T',' ','-','D','S','H','A','1','_','A','S','M',' ','-',
'D','S','H','A','2','5','6','_','A','S','M',' ','-','D','S','H',
'A','5','1','2','_','A','S','M',' ','-','D','K','E','C','C','A',
'K','1','6','0','0','_','A','S','M',' ','-','D','V','P','A','E',
'S','_','A','S','M',' ','-','D','E','C','P','_','N','I','S','T',
'Z','2','5','6','_','A','S','M',' ','-','D','P','O','L','Y','1',
'3','0','5','_','A','S','M',' ','-','D','N','D','E','B','U','G','\0'
'/','h','o','m','e','/','z','h','a','o','z','h','e','n','z','h',
'o','u','/','w','o','r','k','s','p','a','c','e','/','t','h','i',
'r','d','_','p','a','r','t','y','_','o','p','e','n','s','s','l',
'/','o','p','e','n','s','s','l','_','f','r','o','m','_','o','f',
'f','i','c','a','l','/','n','d','k','/','n','d','k','_','t','o',
'o','l','_','r','2','1','e','/','n','d','k','_','a','r','m','6',
'4','/','s','y','s','r','o','o','t',' ','-','W','a',',','-','-',
'n','o','e','x','e','c','s','t','a','c','k',' ','-','Q','u','n',
'u','s','e','d','-','a','r','g','u','m','e','n','t','s',' ','-',
'W','a','l','l',' ','-','O','3',' ','-','D','O','P','E','N','S',
'S','L','_','U','S','E','_','N','O','D','E','L','E','T','E',' ',
'-','D','O','P','E','N','S','S','L','_','P','I','C',' ','-','D',
'O','P','E','N','S','S','L','_','C','P','U','I','D','_','O','B',
'J',' ','-','D','O','P','E','N','S','S','L','_','B','N','_','A',
'S','M','_','M','O','N','T',' ','-','D','S','H','A','1','_','A',
'S','M',' ','-','D','S','H','A','2','5','6','_','A','S','M',' ',
'-','D','S','H','A','5','1','2','_','A','S','M',' ','-','D','K',
'E','C','C','A','K','1','6','0','0','_','A','S','M',' ','-','D',
'V','P','A','E','S','_','A','S','M',' ','-','D','E','C','P','_',
'N','I','S','T','Z','2','5','6','_','A','S','M',' ','-','D','P',
'O','L','Y','1','3','0','5','_','A','S','M',' ','-','D','N','D',
'E','B','U','G','\0'
};
#endif // OPENSSL_ARM64_PLATFORM
#ifdef OPENSSL_ARM_PLATFORM
#define PLATFORM "platform: android-arm"
#define DATE "built on: Tue Aug 3 02:10:27 2021 UTC"
#define DATE "built on: Mon Jun 13 02:53:04 2022 UTC"
/*
* Generate compiler_flags as an array of individual characters. This is a
......@@ -59,33 +63,36 @@ static const char compiler_flags[] = {
'n','u','x','-','a','n','d','r','o','i','d','e','a','b','i','-',
'c','l','a','n','g',' ','-','f','P','I','C',' ','-','p','t','h',
'r','e','a','d',' ',' ','-','-','s','y','s','r','o','o','t','=',
'/','h','o','m','e','/','h','u','a','n','g','j','u','n','/','o',
'p','e','n','s','s','l','/','m','y','-','a','n','d','r','o','i',
'd','-','t','o','o','l','c','h','a','i','n','/','s','y','s','r',
'o','o','t',' ','-','W','a',',','-','-','n','o','e','x','e','c',
's','t','a','c','k',' ','-','Q','u','n','u','s','e','d','-','a',
'r','g','u','m','e','n','t','s',' ','-','W','a','l','l',' ','-',
'O','3',' ','-','D','O','P','E','N','S','S','L','_','U','S','E',
'_','N','O','D','E','L','E','T','E',' ','-','D','O','P','E','N',
'S','S','L','_','P','I','C',' ','-','D','O','P','E','N','S','S',
'L','_','C','P','U','I','D','_','O','B','J',' ','-','D','O','P',
'E','N','S','S','L','_','B','N','_','A','S','M','_','M','O','N',
'T',' ','-','D','O','P','E','N','S','S','L','_','B','N','_','A',
'S','M','_','G','F','2','m',' ','-','D','S','H','A','1','_','A',
'S','M',' ','-','D','S','H','A','2','5','6','_','A','S','M',' ',
'-','D','S','H','A','5','1','2','_','A','S','M',' ','-','D','K',
'E','C','C','A','K','1','6','0','0','_','A','S','M',' ','-','D',
'A','E','S','_','A','S','M',' ','-','D','B','S','A','E','S','_',
'A','S','M',' ','-','D','G','H','A','S','H','_','A','S','M',' ',
'-','D','E','C','P','_','N','I','S','T','Z','2','5','6','_','A',
'S','M',' ','-','D','P','O','L','Y','1','3','0','5','_','A','S',
'M',' ','-','D','N','D','E','B','U','G','\0'
'/','h','o','m','e','/','z','h','a','o','z','h','e','n','z','h',
'o','u','/','w','o','r','k','s','p','a','c','e','/','t','h','i',
'r','d','_','p','a','r','t','y','_','o','p','e','n','s','s','l',
'/','o','p','e','n','s','s','l','_','f','r','o','m','_','o','f',
'f','i','c','a','l','/','n','d','k','/','n','d','k','_','t','o',
'o','l','_','r','2','1','e','/','n','d','k','_','a','r','m','/',
's','y','s','r','o','o','t',' ','-','W','a',',','-','-','n','o',
'e','x','e','c','s','t','a','c','k',' ','-','Q','u','n','u','s',
'e','d','-','a','r','g','u','m','e','n','t','s',' ','-','W','a',
'l','l',' ','-','O','3',' ','-','D','O','P','E','N','S','S','L',
'_','U','S','E','_','N','O','D','E','L','E','T','E',' ','-','D',
'O','P','E','N','S','S','L','_','P','I','C',' ','-','D','O','P',
'E','N','S','S','L','_','C','P','U','I','D','_','O','B','J',' ',
'-','D','O','P','E','N','S','S','L','_','B','N','_','A','S','M',
'_','M','O','N','T',' ','-','D','O','P','E','N','S','S','L','_',
'B','N','_','A','S','M','_','G','F','2','m',' ','-','D','S','H',
'A','1','_','A','S','M',' ','-','D','S','H','A','2','5','6','_',
'A','S','M',' ','-','D','S','H','A','5','1','2','_','A','S','M',
' ','-','D','K','E','C','C','A','K','1','6','0','0','_','A','S',
'M',' ','-','D','A','E','S','_','A','S','M',' ','-','D','B','S',
'A','E','S','_','A','S','M',' ','-','D','G','H','A','S','H','_',
'A','S','M',' ','-','D','E','C','P','_','N','I','S','T','Z','2',
'5','6','_','A','S','M',' ','-','D','P','O','L','Y','1','3','0',
'5','_','A','S','M',' ','-','D','N','D','E','B','U','G','\0'
};
#endif // OPENSSL_ARM_PLATFORM
#ifdef WINDOWS_PLATFORM
#define PLATFORM "platform: mingw64"
#define DATE "built on: Mon Nov 9 09:38:38 2020 UTC"
#define DATE "built on: Wed Jun 15 02:22:52 2022 UTC"
/*
* Generate compiler_flags as an array of individual characters. This is a
......@@ -93,14 +100,17 @@ static const char compiler_flags[] = {
* literal
*/
static const char compiler_flags[] = {
'c','o','m','p','i','l','e','r',':',' ','g','c','c',' ','-','m',
'6','4',' ','-','W','a','l','l',' ','-','O','3',' ','-','D','L',
'_','E','N','D','I','A','N',' ','-','D','O','P','E','N','S','S',
'L','_','P','I','C',' ','-','D','U','N','I','C','O','D','E',' ',
'-','D','_','U','N','I','C','O','D','E',' ','-','D','W','I','N',
'3','2','_','L','E','A','N','_','A','N','D','_','M','E','A','N',
' ','-','D','_','M','T',' ','-','D','N','D','E','B','U','G','\0'
'c','o','m','p','i','l','e','r',':',' ','x','8','6','_','6','4',
'-','w','6','4','-','m','i','n','g','w','3','2','-','g','c','c',
' ','-','m','6','4',' ','-','W','a','l','l',' ','-','O','3',' ',
'-','D','L','_','E','N','D','I','A','N',' ','-','D','O','P','E',
'N','S','S','L','_','P','I','C',' ','-','D','U','N','I','C','O',
'D','E',' ','-','D','_','U','N','I','C','O','D','E',' ','-','D',
'W','I','N','3','2','_','L','E','A','N','_','A','N','D','_','M',
'E','A','N',' ','-','D','_','M','T',' ','-','D','N','D','E','B',
'U','G','\0'
};
#endif // WINDOWS_PLATFORM
#ifdef MAC_PLATFORM
......@@ -120,4 +130,50 @@ static const char compiler_flags[] = {
'I','C',' ','-','D','_','R','E','E','N','T','R','A','N','T',' ',
'-','D','N','D','E','B','U','G','\0'
};
#endif // MAC_PLATFORM
\ No newline at end of file
#endif // MAC_PLATFORM
#ifdef OPENSSL_X86_64_PLATFORM
#define PLATFORM "platform: android-x86_64"
#define DATE "built on: Mon Jun 20 03:40:52 2022 UTC"
/*
* Generate compiler_flags as an array of individual characters. This is a
* workaround for the situation where CFLAGS gets too long for a C90 string
* literal
*/
static const char compiler_flags[] = {
'c','o','m','p','i','l','e','r',':',' ','x','8','6','_','6','4',
'-','l','i','n','u','x','-','a','n','d','r','o','i','d','-','c',
'l','a','n','g',' ','-','f','P','I','C',' ','-','p','t','h','r',
'e','a','d',' ',' ','-','-','s','y','s','r','o','o','t','=','/',
'h','o','m','e','/','z','h','a','o','z','h','e','n','z','h','o',
'u','/','w','o','r','k','s','p','a','c','e','/','t','h','i','r',
'd','_','p','a','r','t','y','_','o','p','e','n','s','s','l','/',
'o','p','e','n','s','s','l','_','f','r','o','m','_','o','f','f',
'i','c','a','l','/','n','d','k','/','n','d','k','_','t','o','o',
'l','_','r','2','1','e','/','n','d','k','_','m','a','c','/','s',
'y','s','r','o','o','t',' ','-','W','a',',','-','-','n','o','e',
'x','e','c','s','t','a','c','k',' ','-','Q','u','n','u','s','e',
'd','-','a','r','g','u','m','e','n','t','s',' ','-','W','a','l',
'l',' ','-','O','3',' ','-','D','O','P','E','N','S','S','L','_',
'U','S','E','_','N','O','D','E','L','E','T','E',' ','-','D','O',
'P','E','N','S','S','L','_','P','I','C',' ','-','D','O','P','E',
'N','S','S','L','_','C','P','U','I','D','_','O','B','J',' ','-',
'D','O','P','E','N','S','S','L','_','I','A','3','2','_','S','S',
'E','2',' ','-','D','O','P','E','N','S','S','L','_','B','N','_',
'A','S','M','_','M','O','N','T',' ','-','D','O','P','E','N','S',
'S','L','_','B','N','_','A','S','M','_','M','O','N','T','5',' ',
'-','D','O','P','E','N','S','S','L','_','B','N','_','A','S','M',
'_','G','F','2','m',' ','-','D','S','H','A','1','_','A','S','M',
' ','-','D','S','H','A','2','5','6','_','A','S','M',' ','-','D',
'S','H','A','5','1','2','_','A','S','M',' ','-','D','K','E','C',
'C','A','K','1','6','0','0','_','A','S','M',' ','-','D','R','C',
'4','_','A','S','M',' ','-','D','M','D','5','_','A','S','M',' ',
'-','D','A','E','S','N','I','_','A','S','M',' ','-','D','V','P',
'A','E','S','_','A','S','M',' ','-','D','G','H','A','S','H','_',
'A','S','M',' ','-','D','E','C','P','_','N','I','S','T','Z','2',
'5','6','_','A','S','M',' ','-','D','X','2','5','5','1','9','_',
'A','S','M',' ','-','D','P','O','L','Y','1','3','0','5','_','A',
'S','M',' ','-','D','N','D','E','B','U','G','\0'
};
#endif // OPENSSL_X86_64_PLATFORM
\ No newline at end of file
此差异已折叠。
此差异已折叠。
/*
* Copyright 2008-2019 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 2008-2021 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
......@@ -737,6 +737,7 @@ static int cms_RecipientInfo_kekri_decrypt(CMS_ContentInfo *cms,
goto err;
}
OPENSSL_clear_free(ec->key, ec->keylen);
ec->key = ukey;
ec->keylen = ukeylen;
......
......@@ -2,7 +2,7 @@
* WARNING: do not edit!
* Generated by crypto/conf/keysets.pl
*
* Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved.
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
/*
* Copyright 2017-2018 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 2017-2021 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 2014 Cryptography Research, Inc.
*
* Licensed under the OpenSSL license (the "License"). You may not use
......@@ -62,7 +62,7 @@ mask_t gf_eq(const gf x, const gf y);
mask_t gf_lobit(const gf x);
mask_t gf_hibit(const gf x);
void gf_serialize(uint8_t *serial, const gf x, int with_highbit);
void gf_serialize(uint8_t serial[SER_BYTES], const gf x, int with_highbit);
mask_t gf_deserialize(gf x, const uint8_t serial[SER_BYTES], int with_hibit,
uint8_t hi_nmask);
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
......@@ -2,7 +2,7 @@
* WARNING: do not edit!
* Generated by crypto/objects/obj_dat.pl
*
* Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved.
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册