mirror of
https://github.com/freebsd/freebsd-src.git
synced 2026-10-28 11:25:21 +01:00
crypto/openssl: update to 3.5.9
This is a security fix release addressing CVE High issues. Users are strongly encouraged to update to this version. See the release notes for the release for more details on what is being fixed. MFC after: 1 day Merge commit 'af5a659dc1cd2b0a6994f2cee1956d0bf50bb1a2'
This commit is contained in:
1254 files changed
+10203
-197912
No files matched your search
@@ -28,6 +28,296 @@ OpenSSL Releases
|
||||
OpenSSL 3.5
|
||||
-----------
|
||||
|
||||
### Changes between 3.5.8 and 3.5.9 [29 Sep 2026]
|
||||
|
||||
* Fixed DTLS retransmissions of handshake messages from a stale buffer offset.
|
||||
|
||||
Severity: High
|
||||
|
||||
Issue summary: The DTLS retransmission logic does not correctly handle
|
||||
a handshake message write that is suspended part-way through.
|
||||
The retransmitted message can be read past the message buffer
|
||||
and the retransmission overwrites the internal state the suspended write
|
||||
needs to resume correctly.
|
||||
|
||||
Impact summary: The retransmitted message can disclose a heap memory
|
||||
to the peer as plaintext handshake data or cause a crash and a Denial
|
||||
of Service when the read reaches an unmapped memory region.
|
||||
|
||||
Reported by: Laurent Gaffie (secorizon.com).
|
||||
|
||||
([CVE-2026-84782])
|
||||
|
||||
*Ryan Hooper*
|
||||
|
||||
* Fixed excessive memory allocation in relative CRLDP processing.
|
||||
|
||||
Severity: Low
|
||||
|
||||
Issue summary: A certificate with many `nameRelativeToCRLIssuer` CRL
|
||||
distribution points causes disproportionate heap growth when OpenSSL caches
|
||||
X.509 extensions.
|
||||
|
||||
Impact summary: Receiving a crafted certificate from a malicious peer
|
||||
can lead to significant memory pressure and possible Denial of Service
|
||||
in clients or in servers that solicit client certificates.
|
||||
|
||||
Reported by: Fuzz0x (ZKSC Institute of Security Research).
|
||||
|
||||
([CVE-2026-35189])
|
||||
|
||||
*Viktor Dukhovni*
|
||||
|
||||
* Fixed QUIC unvalidated amplification credit may be over-accounted.
|
||||
|
||||
Severity: Low
|
||||
|
||||
Issue summary: The OpenSSL QUIC server, when configured to not preform
|
||||
address validation, can be forced to count incoming packets multiple times
|
||||
in its unvalidated credit computation, leading to a violation
|
||||
of the [RFC 9000] unvalidated connection amplification limit of 3 times
|
||||
the amount of data received.
|
||||
|
||||
Impact summary: A remote attacker, who is able to spoof packets to a server
|
||||
using the OpenSSL QUIC implementation, might use the server
|
||||
for an amplification of a Distributed Denial of Service attack.
|
||||
|
||||
Reported by: Ali Firas and Nikolas Gauder (NVIDIA).
|
||||
|
||||
([CVE-2026-35191])
|
||||
|
||||
*Neil Horman*
|
||||
|
||||
* Fixed potential CPU DoS via O(n^2) fragment reassembly in QUIC.
|
||||
|
||||
Severity: Low
|
||||
|
||||
Issue summary: The QUIC stream reassembly algorithm performance deteriorates
|
||||
progressively as packets are arriving out of order. The worst case has
|
||||
a quadratic complexity, proportional to the number of stream frames kept
|
||||
in the buffer for the received stream data.
|
||||
|
||||
Impact summary: A remote QUIC peer that completes the handshake can create
|
||||
a connection-scoped CPU pressure and potentially a Denial of Service using
|
||||
compliant `STREAM` frames inside the advertised receive window, with low
|
||||
attacker bandwidth.
|
||||
|
||||
Reported by: Saku0512 and Opal Wright (Trail of Bits) in collaboration
|
||||
with OpenAI
|
||||
|
||||
([CVE-2026-42772])
|
||||
<!-- https://github.com/openssl/openssl/pull/32769 -->
|
||||
|
||||
*Alexandr Nedvědický*
|
||||
|
||||
* Fixed a timing side-channel in scalar multiplication for mon-NIST EC curves.
|
||||
|
||||
Severity: Low
|
||||
|
||||
Issue summary: The generic elliptic-curve scalar multiplication, used
|
||||
for ECDSA and SM2 signature operations with curves that do not have
|
||||
a dedicated implementation, leaks information about the secret nonce
|
||||
through timing.
|
||||
|
||||
Impact summary: An attacker, who is able to measure signing times, may learn
|
||||
information about the per-signature secret nonce, which over many signatures
|
||||
can, via a Hidden Number Problem (lattice) attack, lead to recovery
|
||||
of the private key.
|
||||
|
||||
Reported by: Alicja Kario and George Pantelakis (Red Hat), based
|
||||
on the report of Youngjae Choi (Korea University).
|
||||
|
||||
([CVE-2026-54872])
|
||||
|
||||
*Igor Ustinov*
|
||||
|
||||
* Fixed QUIC `STREAM` fragment metadata DoS.
|
||||
|
||||
Severity: Low
|
||||
|
||||
Issue summary: QUIC process may keep memory for QUIC packet buffer
|
||||
for much longer period than necessary.
|
||||
|
||||
Impact summary: Remote peer can exploit this vulnerability by sending
|
||||
maliciously crafted packets, making the local QUIC stack to keep the memory
|
||||
for packet buffers allocated. The time for which the memory remains
|
||||
allocated is entirely under the control of the potentially malicious remote
|
||||
peer.
|
||||
|
||||
Reported by: Zhen Yan (AntAISecurityLab) and Bhabani Sankar Das.
|
||||
|
||||
([CVE-2026-54873])
|
||||
<!-- https://github.com/openssl/openssl/pull/32769 -->
|
||||
|
||||
*Alexandr Nedvědický*
|
||||
|
||||
* Fixed non-constant-time SM2 scalar multiplication on ARM64 and RISC-V.
|
||||
|
||||
Severity: Low
|
||||
|
||||
Issue summary: A non-constant-time optimized implementation of scalar
|
||||
point multiplication is used for SM2 private key operations on ARM64
|
||||
and RISC-V platforms.
|
||||
|
||||
Impact summary: An attacker able to measure the time taken by, or to observe
|
||||
the cache-line access pattern of, SM2 signing or decryption on an affected
|
||||
platform can learn information about the secret scalar.
|
||||
|
||||
Reported by: Abhinav Agarwal and Feng Xue.
|
||||
|
||||
([CVE-2026-54875])
|
||||
|
||||
*Igor Ustinov*
|
||||
|
||||
* Fixed out-of-bounds access after `SSL_set_SSL_CTX()` during a handshake.
|
||||
|
||||
Severity: Low
|
||||
|
||||
Issue summary: A TLS server that calls `SSL_set_SSL_CTX()` to switch
|
||||
a connection to a different `SSL_CTX` part way through a handshake may access
|
||||
memory beyond the end of an internal array if the replacement context knows
|
||||
about more provider signature algorithms than the context the connection was
|
||||
created from. Applications that never call `SSL_set_SSL_CTX()`
|
||||
are not affected.
|
||||
|
||||
Impact summary: A remote peer may be able to cause a small out-of-bounds
|
||||
read, and, in some circumstances, a fixed-value out-of-bounds write,
|
||||
on the server heap. This may lead to a Denial of Service.
|
||||
|
||||
Reported by: Filipe Casal (Trail of Bits) in collaboration with OpenAI,
|
||||
Brandon Luo, Luigino Camastra (Aisle Research), and Bhargava Shastry.
|
||||
|
||||
([CVE-2026-72897])
|
||||
|
||||
*Matt Caswell*
|
||||
|
||||
* Fixed QUIC connection-level flow control was not enforced for streams.
|
||||
|
||||
Severity: Low
|
||||
|
||||
Issue summary: OpenSSL QUIC stack does not enforce connection-level flow
|
||||
control for streams. Remote peers may send more bytes, as long as they fit
|
||||
within the stream flow control limits.
|
||||
|
||||
Impact summary: A malicious remote peer may exploit the lack of connection
|
||||
flow control for streams to make the QUIC stack receive ~100 MiB of memory
|
||||
instead of 768 KiB (default flow control window size).
|
||||
|
||||
Reportedby: Moltenbit, Bhabani Sankar Das, Saiyowa Security Team, mzfr.
|
||||
|
||||
([CVE-2026-75804])
|
||||
|
||||
*Alexandr Nedvědický*
|
||||
|
||||
* Fixed a NULL pointer dereference in CMP client revocation response handling.
|
||||
|
||||
Severity: Low
|
||||
|
||||
Issue summary: The OpenSSL Certificate Management Protocol (CMP) client
|
||||
that requests a certificate revocation on the basis of a PKCS#10 CSR may
|
||||
dereference a NULL pointer and terminate abnormally when processing a crafted
|
||||
revocation response.
|
||||
|
||||
Impact summary: The NULL pointer dereference happens on a read, which
|
||||
leads to a crash and a Denial of Service for the affected client application.
|
||||
|
||||
Reported by: Bhabani Sankar Das.
|
||||
|
||||
([CVE-2026-75805])
|
||||
|
||||
*Bhabani Sankar Das and Norbert Pócs*
|
||||
|
||||
* Fixed an unauthenticated and undersized DTLS 1.2 AEAD record causing DoS.
|
||||
|
||||
Severity: Low
|
||||
|
||||
Issue summary: An established DTLS 1.2 association using an AEAD cipher suite
|
||||
can be terminated by a single unauthenticated datagram whose encrypted
|
||||
fragment is shorter than the mandatory explicit IV and authentication tag
|
||||
overhead.
|
||||
|
||||
Impact summary: An attacker who can send a datagram that is routed
|
||||
to an existing DTLS 1.2 association can tear that association down
|
||||
without knowing any key material. This is a Denial of Service, limited
|
||||
to the targeted association. There is no memory safety or confidentiality
|
||||
impact.
|
||||
|
||||
Reported by: Mounir IDRASSI.
|
||||
|
||||
([CVE-2026-75806])
|
||||
|
||||
*Mounir IDRASSI*
|
||||
|
||||
* Fixed a timing side-channel in SM2 signature generation.
|
||||
|
||||
Severity: Low
|
||||
|
||||
Issue summary: SM2 signature generation uses non-constant-time arithmetic
|
||||
on secret values, forming a timing side-channel.
|
||||
|
||||
Impact summary: An attacker able to measure SM2 signing times may learn
|
||||
information about the per-signature secret nonce, which over many signatures
|
||||
can, via a Hidden Number Problem (lattice) attack, lead to recovery
|
||||
of the private key.
|
||||
|
||||
Reported by: Vladimir Tokarev.
|
||||
|
||||
([CVE-2026-77696])
|
||||
|
||||
*Igor Ustinov and Viktor Dukhovni*
|
||||
|
||||
* Fixed an unbounded `RETIRE_CONNECTION_ID` backlog in QUIC stack
|
||||
implementation.
|
||||
|
||||
Severity: Low
|
||||
|
||||
Issue summary: A malicious remote peer may flood the local QUIC stack
|
||||
with `NEW_CONNECTION_ID` frames by avoiding a limit check on how many
|
||||
connection IDs the remote QUIC stack can use.
|
||||
|
||||
Impact summary: The local QUIC stack sends a `RETIRE_CONN_ID` frame
|
||||
for every `NEW_CONNECTION_ID` frame it receives. The `RETIRE_CONN_ID`
|
||||
frame is dispatched via the Control Frame Queue (CFQ). If the remote
|
||||
peer also withholds ACKs, then it can force the local stack to allocate
|
||||
up to ~400 MB (depending on ACK delay).
|
||||
|
||||
Reported by: Bhabani Sankar Das.
|
||||
|
||||
([CVE-2026-84784])
|
||||
|
||||
*Alexandr Nedvědický*
|
||||
|
||||
* Fixed a bug where `EVP_DecryptFinal()` incorrectly reported a stale success
|
||||
on AES-SIV authentication failure after a preciously successful message
|
||||
decryption.
|
||||
<!-- https://github.com/openssl/openssl/pull/31610 -->
|
||||
|
||||
*Abel Thomas*
|
||||
|
||||
* Fixed a bug in `OSSL_HTTP_get()` that allowed to perform HTTPS-to-HTTP
|
||||
downgrade through a relative redirect.
|
||||
<!-- https://github.com/openssl/openssl/pull/32694 -->
|
||||
|
||||
*Mounir IDRASSI*
|
||||
|
||||
* Changed the OpenSSL FIPS provider so that every algorithm advertised
|
||||
with `fips=yes` property explicitly exposes a `fips-indicator` gettable
|
||||
context parameter, that returns 1 for an approved operation. The absence
|
||||
of an indicator is no longer interpreted as approval. Algorithms advertised
|
||||
with `fips=no` property, including X448MLKEM1024, remain unapproved
|
||||
and return 0 when they expose the indicator.
|
||||
<!-- https://github.com/openssl/openssl/pull/32913 -->
|
||||
|
||||
*Shane Lontis*
|
||||
|
||||
* Changed the compiler flags supplied to MSVC targets to no longer include
|
||||
`/Gs0` (resetting the minimum memory size occupied by local variables
|
||||
for including stack probes to the default value of 4096), as it led
|
||||
to mis-compilation of MD4 C implementation on ARM64.
|
||||
<!-- https://github.com/openssl/openssl/pull/32872 -->
|
||||
|
||||
*Norbert Pócs*
|
||||
|
||||
### Changes between 3.5.7 and 3.5.8 [25 Aug 2026]
|
||||
|
||||
* Fixed QUIC server being able to trigger double free when processing `INITIAL`
|
||||
@@ -22521,22 +22811,35 @@ ndif
|
||||
[CVE-2026-34181]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-34181
|
||||
[CVE-2026-34182]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-34182
|
||||
[CVE-2026-34183]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-34183
|
||||
[CVE-2026-35189]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-35189
|
||||
[CVE-2026-35191]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-35191
|
||||
[CVE-2026-42764]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-42764
|
||||
[CVE-2026-42766]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-42766
|
||||
[CVE-2026-42767]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-42767
|
||||
[CVE-2026-42768]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-42768
|
||||
[CVE-2026-42769]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-42769
|
||||
[CVE-2026-42770]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-42770
|
||||
[CVE-2026-42772]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-42772
|
||||
[CVE-2026-45445]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-45445
|
||||
[CVE-2026-45446]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-45446
|
||||
[CVE-2026-45447]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-45447
|
||||
[CVE-2026-54872]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-54872
|
||||
[CVE-2026-54873]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-54873
|
||||
[CVE-2026-54874]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-54874
|
||||
[CVE-2026-54875]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-54875
|
||||
[CVE-2026-63072]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-63072
|
||||
[CVE-2026-63073]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-63073
|
||||
[CVE-2026-63074]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-63074
|
||||
[CVE-2026-63075]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-63075
|
||||
[CVE-2026-63076]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-63076
|
||||
[CVE-2026-72897]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-72897
|
||||
[CVE-2026-75803]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-75803
|
||||
[CVE-2026-75804]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-75804
|
||||
[CVE-2026-75805]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-75805
|
||||
[CVE-2026-75806]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-75806
|
||||
[CVE-2026-77696]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-77696
|
||||
[CVE-2026-84782]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-84782
|
||||
[CVE-2026-84784]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-84784
|
||||
[ESV]: https://csrc.nist.gov/Projects/cryptographic-module-validation-program/entropy-validations
|
||||
[RFC 2578 (STD 58), section 3.5]: https://datatracker.ietf.org/doc/html/rfc2578#section-3.5
|
||||
[RFC 3211]: https://datatracker.ietf.org/doc/html/rfc3211
|
||||
@@ -22545,3 +22848,4 @@ ndif
|
||||
[RFC 8446]: https://datatracker.ietf.org/doc/html/rfc8446
|
||||
[RFC 8446 Section 4.6.1]: https://datatracker.ietf.org/doc/html/rfc8446#section-4.6.1
|
||||
[RFC 8452]: https://datatracker.ietf.org/doc/html/rfc8452
|
||||
[RFC 9000]: https://datatracker.ietf.org/doc/html/rfc9000
|
||||
@@ -1566,7 +1566,7 @@ my %targets = (
|
||||
template => 1,
|
||||
CFLAGS => add(picker(debug => '/Od',
|
||||
release => '/O2')),
|
||||
cflags => add(picker(default => '/Gs0 /GF /Gy',
|
||||
cflags => add(picker(default => '/GF /Gy',
|
||||
debug =>
|
||||
sub {
|
||||
($disabled{shared} ? "" : "/MDd");
|
||||
|
||||
@@ -23,6 +23,56 @@ OpenSSL Releases
|
||||
OpenSSL 3.5
|
||||
-----------
|
||||
|
||||
### Major changes between OpenSSL 3.5.8 and OpenSSL 3.5.9 [29 Sep 2026]
|
||||
|
||||
OpenSSL 3.5.9 is a security patch release. The most severe CVE fixed
|
||||
in this release is High.
|
||||
|
||||
This release incorporates the following bug fixes and mitigations:
|
||||
|
||||
* Fixed DTLS retransmissions of handshake messages from a stale buffer offset.
|
||||
([CVE-2026-84782])
|
||||
|
||||
* Fixed excessive memory allocation in relative CRLDP processing.
|
||||
([CVE-2026-35189])
|
||||
|
||||
* Fixed QUIC unvalidated amplification credit may be over-accounted.
|
||||
([CVE-2026-35191])
|
||||
|
||||
* Fixed potential CPU DoS via O(n^2) fragment reassembly in QUIC.
|
||||
([CVE-2026-42772])
|
||||
|
||||
* Fixed a timing side-channel in scalar multiplication for mon-NIST EC curves.
|
||||
([CVE-2026-54872])
|
||||
|
||||
* Fixed QUIC `STREAM` fragment metadata DoS.
|
||||
([CVE-2026-54873])
|
||||
|
||||
* Fixed non-constant-time SM2 scalar multiplication on ARM64 and RISC-V.
|
||||
([CVE-2026-54875])
|
||||
|
||||
* Fixed out-of-bounds access after `SSL_set_SSL_CTX()` during a handshake.
|
||||
([CVE-2026-72897])
|
||||
|
||||
* Fixed QUIC connection-level flow control was not enforced for streams.
|
||||
([CVE-2026-75804])
|
||||
|
||||
* Fixed a NULL pointer dereference in CMP client revocation response handling.
|
||||
([CVE-2026-75805])
|
||||
|
||||
* Fixed an unauthenticated and undersized DTLS 1.2 AEAD record causing DoS.
|
||||
([CVE-2026-75806])
|
||||
|
||||
* Fixed a timing side-channel in SM2 signature generation.
|
||||
([CVE-2026-77696])
|
||||
|
||||
* Fixed an unbounded `RETIRE_CONNECTION_ID` backlog in QUIC stack
|
||||
implementation.
|
||||
([CVE-2026-84784])
|
||||
|
||||
* Fixed a bug where `EVP_DecryptFinal()` incorrectly reported a stale success
|
||||
on AES-SIV authentication failure.
|
||||
|
||||
### Major changes between OpenSSL 3.5.7 and OpenSSL 3.5.8 [25 Aug 2026]
|
||||
|
||||
OpenSSL 3.5.8 is a security patch release. The most severe CVE fixed
|
||||
@@ -2328,22 +2378,35 @@ OpenSSL 0.9.x
|
||||
[CVE-2026-34181]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-34181
|
||||
[CVE-2026-34182]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-34182
|
||||
[CVE-2026-34183]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-34183
|
||||
[CVE-2026-35189]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-35189
|
||||
[CVE-2026-35191]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-35191
|
||||
[CVE-2026-42764]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-42764
|
||||
[CVE-2026-42766]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-42766
|
||||
[CVE-2026-42767]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-42767
|
||||
[CVE-2026-42768]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-42768
|
||||
[CVE-2026-42769]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-42769
|
||||
[CVE-2026-42770]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-42770
|
||||
[CVE-2026-42772]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-42772
|
||||
[CVE-2026-45445]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-45445
|
||||
[CVE-2026-45446]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-45446
|
||||
[CVE-2026-45447]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-45447
|
||||
[CVE-2026-54872]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-54872
|
||||
[CVE-2026-54873]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-54873
|
||||
[CVE-2026-54874]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-54874
|
||||
[CVE-2026-54875]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-54875
|
||||
[CVE-2026-63072]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-63072
|
||||
[CVE-2026-63073]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-63073
|
||||
[CVE-2026-63074]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-63074
|
||||
[CVE-2026-63075]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-63075
|
||||
[CVE-2026-63076]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-63076
|
||||
[CVE-2026-72897]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-72897
|
||||
[CVE-2026-75803]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-75803
|
||||
[CVE-2026-75804]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-75804
|
||||
[CVE-2026-75805]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-75805
|
||||
[CVE-2026-75806]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-75806
|
||||
[CVE-2026-77696]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-77696
|
||||
[CVE-2026-84782]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-84782
|
||||
[CVE-2026-84784]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-84784
|
||||
[ESV]: https://csrc.nist.gov/Projects/cryptographic-module-validation-program/entropy-validations
|
||||
[OpenSSL Guide]: https://www.openssl.org/docs/manmaster/man7/ossl-guide-introduction.html
|
||||
[README-QUIC.md]: ./README-QUIC.md
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
MAJOR=3
|
||||
MINOR=5
|
||||
PATCH=8
|
||||
PATCH=9
|
||||
PRE_RELEASE_TAG=
|
||||
BUILD_METADATA=
|
||||
RELEASE_DATE="25 Aug 2026"
|
||||
RELEASE_DATE="29 Sep 2026"
|
||||
SHLIB_VERSION=3
|
||||
@@ -470,11 +470,15 @@ int ocsp_main(int argc, char **argv)
|
||||
if (issuer == NULL)
|
||||
goto end;
|
||||
if (issuers == NULL) {
|
||||
if ((issuers = sk_X509_new_null()) == NULL)
|
||||
if ((issuers = sk_X509_new_null()) == NULL) {
|
||||
X509_free(issuer);
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
if (!sk_X509_push(issuers, issuer))
|
||||
if (!sk_X509_push(issuers, issuer)) {
|
||||
X509_free(issuer);
|
||||
goto end;
|
||||
}
|
||||
break;
|
||||
case OPT_CERT:
|
||||
reset_unknown();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 1995-2024 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 1995-2026 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
|
||||
@@ -82,10 +82,15 @@ void *ASN1_item_dup(const ASN1_ITEM *it, const void *x)
|
||||
p = b;
|
||||
ret = ASN1_item_d2i_ex(NULL, &p, i, it, libctx, propq);
|
||||
OPENSSL_free(b);
|
||||
if (ret == NULL)
|
||||
return NULL;
|
||||
|
||||
if (asn1_cb != NULL
|
||||
&& !asn1_cb(ASN1_OP_DUP_POST, &ret, it, (void *)x))
|
||||
goto auxerr;
|
||||
&& !asn1_cb(ASN1_OP_DUP_POST, &ret, it, (void *)x)) {
|
||||
ASN1_item_free(ret, it);
|
||||
ERR_raise_data(ERR_LIB_ASN1, ASN1_R_AUX_ERROR, "Type=%s", it->sname);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2025 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 2016-2026 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
|
||||
@@ -629,7 +629,12 @@ static int addrinfo_wrap(int family, int socktype,
|
||||
all right. */
|
||||
BIO_ADDR *addr = BIO_ADDR_new();
|
||||
if (addr != NULL) {
|
||||
BIO_ADDR_rawmake(addr, family, where, wherelen, port);
|
||||
if (!BIO_ADDR_rawmake(addr, family, where, wherelen, port)) {
|
||||
BIO_ADDR_free(addr);
|
||||
BIO_ADDRINFO_free(*bai);
|
||||
*bai = NULL;
|
||||
return 0;
|
||||
}
|
||||
(*bai)->bai_addr = BIO_ADDR_sockaddr_noconst(addr);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 2014-2026 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
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
#include "internal/cryptlib.h"
|
||||
#include "bn_local.h"
|
||||
#include "internal/constant_time.h"
|
||||
|
||||
/*
|
||||
* Determine the modified width-(w+1) Non-Adjacent Form (wNAF) of 'scalar'.
|
||||
@@ -152,6 +153,43 @@ void bn_set_all_zero(BIGNUM *a)
|
||||
a->d[i] = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Zero-extend |a| so that it occupies exactly |words| words, flag it
|
||||
* BN_FLG_FIXED_TOP and leave its numeric value unchanged.
|
||||
*
|
||||
* This is a companion to bn_correct_top(): where the latter minimises the top
|
||||
* of a BIGNUM, this one pins the top to a caller-chosen, value-independent
|
||||
* width. Constant-time code uses it to make the cost of subsequent word-wise
|
||||
* operations (e.g. BN_uadd()/BN_add()) independent of the magnitude of a
|
||||
* secret value. |words| must be greater than or equal to the current top.
|
||||
*
|
||||
* The routine is itself constant time with respect to the current a->top: it
|
||||
* always sweeps a fixed |words| iterations and selects value-or-zero per word
|
||||
* with an arithmetic mask, rather than looping over the (possibly secret)
|
||||
* a->top..words range. Masking the high words with zero also launders any
|
||||
* uninitialised padding, so it is safe for the memory sanitiser.
|
||||
*/
|
||||
int bn_set_top_fixed(BIGNUM *a, int words)
|
||||
{
|
||||
size_t i, n = (size_t)words;
|
||||
BN_ULONG mask;
|
||||
|
||||
if (words < a->top)
|
||||
return 0;
|
||||
if (bn_wexpand(a, words) == NULL) {
|
||||
ERR_raise(ERR_LIB_BN, ERR_R_BN_LIB);
|
||||
return 0;
|
||||
}
|
||||
for (i = 0; i < n; i++) {
|
||||
/* mask = all ones iff i < a->top, else all zeros */
|
||||
mask = value_barrier_bn((BN_ULONG)0 - ((i - a->top) >> (8 * sizeof(i) - 1)));
|
||||
a->d[i] &= mask;
|
||||
}
|
||||
a->top = words;
|
||||
a->flags |= BN_FLG_FIXED_TOP;
|
||||
return 1;
|
||||
}
|
||||
|
||||
int bn_copy_words(BN_ULONG *out, const BIGNUM *in, int size)
|
||||
{
|
||||
if (in->top > size)
|
||||
|
||||
@@ -6,7 +6,7 @@ SUBDIRS=objects buffer bio stack lhash hashtable rand evp asn1 pem x509 conf \
|
||||
siphash sm3 des aes rc2 rc4 rc5 idea aria bf cast camellia \
|
||||
seed sm4 chacha modes bn ec rsa dsa dh sm2 dso engine \
|
||||
err comp http ocsp cms ts srp cmac ct async ess crmf cmp encode_decode \
|
||||
ffc hpke thread ml_dsa slh_dsa
|
||||
ffc hpke thread ml_dsa slh_dsa rbtree
|
||||
|
||||
LIBS=../libcrypto
|
||||
|
||||
|
||||
@@ -999,16 +999,23 @@ int OSSL_CMP_exec_RR_ses(OSSL_CMP_CTX *ctx)
|
||||
ret = 0;
|
||||
goto err;
|
||||
}
|
||||
if (X509_NAME_cmp(issuer, OSSL_CRMF_CERTID_get0_issuer(cid)) != 0) {
|
||||
/*
|
||||
* The issuer and serial number are absent if the certificate to be
|
||||
* revoked was given as a PKCS#10 CSR, in which case there is nothing
|
||||
* to check the CertId of the response against.
|
||||
*/
|
||||
if (issuer != NULL
|
||||
&& X509_NAME_cmp(issuer, OSSL_CRMF_CERTID_get0_issuer(cid)) != 0) {
|
||||
#ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
|
||||
ERR_raise(ERR_LIB_CMP, CMP_R_WRONG_CERTID_IN_RP);
|
||||
ret = 0;
|
||||
goto err;
|
||||
#endif
|
||||
}
|
||||
if (ASN1_INTEGER_cmp(serial,
|
||||
OSSL_CRMF_CERTID_get0_serialNumber(cid))
|
||||
!= 0) {
|
||||
if (serial != NULL
|
||||
&& ASN1_INTEGER_cmp(serial,
|
||||
OSSL_CRMF_CERTID_get0_serialNumber(cid))
|
||||
!= 0) {
|
||||
#ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
|
||||
ERR_raise(ERR_LIB_CMP, CMP_R_WRONG_SERIAL_IN_RP);
|
||||
ret = 0;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2007-2025 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 2007-2026 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright Nokia 2007-2019
|
||||
* Copyright Siemens AG 2015-2019
|
||||
*
|
||||
@@ -61,7 +61,6 @@ OSSL_CMP_SRV_CTX *OSSL_CMP_SRV_CTX_new(OSSL_LIB_CTX *libctx, const char *propq)
|
||||
if ((ctx->ctx = OSSL_CMP_CTX_new(libctx, propq)) == NULL)
|
||||
goto err;
|
||||
ctx->certReqId = OSSL_CMP_CERTREQID_INVALID;
|
||||
ctx->polling = 0;
|
||||
|
||||
/* all other elements are initialized to 0 or NULL, respectively */
|
||||
return ctx;
|
||||
@@ -577,6 +576,60 @@ static int unprotected_exception(const OSSL_CMP_CTX *ctx,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int assuming_new_transaction(OSSL_CMP_CTX *ctx, const OSSL_CMP_MSG *req)
|
||||
{
|
||||
int body_type = OSSL_CMP_MSG_get_bodytype(req);
|
||||
ASN1_OCTET_STRING *tid;
|
||||
|
||||
if (ctx->transactionID == NULL) /* no currently active transaction */
|
||||
return 1;
|
||||
|
||||
tid = OSSL_CMP_HDR_get0_transactionID(OSSL_CMP_MSG_get0_header(req));
|
||||
if (tid != NULL && ASN1_OCTET_STRING_cmp(tid, ctx->transactionID) != 0) {
|
||||
char *ctx_str = i2s_ASN1_OCTET_STRING(NULL, ctx->transactionID);
|
||||
char *tid_str = i2s_ASN1_OCTET_STRING(NULL, tid);
|
||||
|
||||
ossl_cmp_log2(WARN, ctx, "Assuming that last transaction with ID=%s got aborted, new ID=%s",
|
||||
ctx_str != NULL ? ctx_str : "(null)",
|
||||
tid_str != NULL ? tid_str : "(null)");
|
||||
OPENSSL_free(tid_str);
|
||||
OPENSSL_free(ctx_str);
|
||||
return 1;
|
||||
}
|
||||
|
||||
switch (body_type) {
|
||||
case OSSL_CMP_PKIBODY_IR:
|
||||
case OSSL_CMP_PKIBODY_CR:
|
||||
case OSSL_CMP_PKIBODY_P10CR:
|
||||
case OSSL_CMP_PKIBODY_KUR:
|
||||
case OSSL_CMP_PKIBODY_RR:
|
||||
case OSSL_CMP_PKIBODY_GENM:
|
||||
ossl_cmp_log1(WARN, ctx, "Assuming new transaction due to received body type %s",
|
||||
ossl_cmp_bodytype_to_string(body_type));
|
||||
return 1;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* Prepare for next transaction */
|
||||
static int transaction_reinit(OSSL_CMP_SRV_CTX *srv_ctx)
|
||||
{
|
||||
int ret = 1;
|
||||
|
||||
srv_ctx->ctx->status = OSSL_CMP_PKISTATUS_unspecified; /* transaction closed */
|
||||
srv_ctx->certReqId = OSSL_CMP_CERTREQID_INVALID;
|
||||
srv_ctx->polling = 0;
|
||||
|
||||
if (srv_ctx->clean_transaction != NULL)
|
||||
ret = srv_ctx->clean_transaction(srv_ctx, srv_ctx->ctx->transactionID);
|
||||
if (!OSSL_CMP_CTX_set1_transactionID(srv_ctx->ctx, NULL))
|
||||
ret = 0;
|
||||
if (!OSSL_CMP_CTX_set1_senderNonce(srv_ctx->ctx, NULL))
|
||||
ret = 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
* returns created message and NULL on internal error
|
||||
*/
|
||||
@@ -613,42 +666,18 @@ OSSL_CMP_MSG *OSSL_CMP_SRV_process_request(OSSL_CMP_SRV_CTX *srv_ctx,
|
||||
if (!OSSL_CMP_CTX_set1_recipient(ctx, hdr->sender->d.directoryName))
|
||||
goto err;
|
||||
|
||||
if (srv_ctx->polling && req_type != OSSL_CMP_PKIBODY_POLLREQ
|
||||
&& req_type != OSSL_CMP_PKIBODY_ERROR) {
|
||||
ERR_raise(ERR_LIB_CMP, CMP_R_EXPECTED_POLLREQ);
|
||||
goto err;
|
||||
}
|
||||
|
||||
switch (req_type) {
|
||||
case OSSL_CMP_PKIBODY_IR:
|
||||
case OSSL_CMP_PKIBODY_CR:
|
||||
case OSSL_CMP_PKIBODY_P10CR:
|
||||
case OSSL_CMP_PKIBODY_KUR:
|
||||
case OSSL_CMP_PKIBODY_RR:
|
||||
case OSSL_CMP_PKIBODY_GENM:
|
||||
case OSSL_CMP_PKIBODY_ERROR:
|
||||
if (ctx->transactionID != NULL) {
|
||||
char *tid = i2s_ASN1_OCTET_STRING(NULL, ctx->transactionID);
|
||||
|
||||
if (tid != NULL)
|
||||
ossl_cmp_log1(WARN, ctx,
|
||||
"Assuming that last transaction with ID=%s got aborted",
|
||||
tid);
|
||||
OPENSSL_free(tid);
|
||||
}
|
||||
/* start of a new transaction, reset transactionID and senderNonce */
|
||||
if (!OSSL_CMP_CTX_set1_transactionID(ctx, NULL)
|
||||
|| !OSSL_CMP_CTX_set1_senderNonce(ctx, NULL))
|
||||
goto err;
|
||||
|
||||
if (srv_ctx->clean_transaction != NULL
|
||||
&& !srv_ctx->clean_transaction(srv_ctx, NULL)) {
|
||||
if (assuming_new_transaction(ctx, req)) {
|
||||
/*
|
||||
* Start of a new transaction, resetting transactionID and senderNonce.
|
||||
* Must in this case reset transactionID beforehand such that the clean()
|
||||
* callback function gets a NULL transactionID argument, as documented.
|
||||
*/
|
||||
(void)OSSL_CMP_CTX_set1_transactionID(ctx, NULL);
|
||||
if (!transaction_reinit(srv_ctx)) {
|
||||
ERR_raise(ERR_LIB_CMP, CMP_R_ERROR_PROCESSING_MESSAGE);
|
||||
goto err;
|
||||
}
|
||||
|
||||
break;
|
||||
default:
|
||||
} else {
|
||||
/* transactionID should be already initialized */
|
||||
if (ctx->transactionID == NULL) {
|
||||
#ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
|
||||
@@ -656,6 +685,11 @@ OSSL_CMP_MSG *OSSL_CMP_SRV_process_request(OSSL_CMP_SRV_CTX *srv_ctx,
|
||||
goto err;
|
||||
#endif
|
||||
}
|
||||
if (srv_ctx->polling && req_type != OSSL_CMP_PKIBODY_POLLREQ
|
||||
&& req_type != OSSL_CMP_PKIBODY_ERROR) {
|
||||
ERR_raise(ERR_LIB_CMP, CMP_R_EXPECTED_POLLREQ);
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
|
||||
req_verified = ossl_cmp_msg_check_update(ctx, req, unprotected_exception,
|
||||
@@ -741,13 +775,9 @@ err:
|
||||
case OSSL_CMP_PKIBODY_PKICONF:
|
||||
case OSSL_CMP_PKIBODY_GENP:
|
||||
/* Other terminating response message types are not supported */
|
||||
srv_ctx->certReqId = OSSL_CMP_CERTREQID_INVALID;
|
||||
/* Prepare for next transaction, ignoring any errors here: */
|
||||
if (srv_ctx->clean_transaction != NULL)
|
||||
(void)srv_ctx->clean_transaction(srv_ctx, ctx->transactionID);
|
||||
(void)OSSL_CMP_CTX_set1_transactionID(ctx, NULL);
|
||||
(void)OSSL_CMP_CTX_set1_senderNonce(ctx, NULL);
|
||||
ctx->status = OSSL_CMP_PKISTATUS_unspecified; /* transaction closed */
|
||||
|
||||
/* Prepare for next transaction, ignoring any errors here */
|
||||
(void)transaction_reinit(srv_ctx);
|
||||
|
||||
default: /* not closing transaction in other cases */
|
||||
break;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 1998-2023 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 1998-2026 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
|
||||
@@ -292,6 +292,7 @@ DEFINE_RUN_ONCE_STATIC(ossl_comp_brotli_init)
|
||||
#define LIBBROTLIDEC "brotlidec"
|
||||
#endif
|
||||
|
||||
ERR_set_mark();
|
||||
brotli_encode_dso = DSO_load(NULL, LIBBROTLIENC, NULL, 0);
|
||||
if (brotli_encode_dso != NULL) {
|
||||
p_encode_init = (encode_init_ft)DSO_bind_func(brotli_encode_dso, "BrotliEncoderCreateInstance");
|
||||
@@ -318,9 +319,12 @@ DEFINE_RUN_ONCE_STATIC(ossl_comp_brotli_init)
|
||||
|| p_decode_stream == NULL || p_decode_has_more == NULL || p_decode_end == NULL
|
||||
|| p_decode_error == NULL || p_decode_error_string == NULL || p_decode_is_finished == NULL
|
||||
|| p_decode_oneshot == NULL) {
|
||||
ERR_clear_last_mark();
|
||||
ossl_comp_brotli_cleanup();
|
||||
return 0;
|
||||
}
|
||||
/* Do not leave errors behind on success. */
|
||||
ERR_pop_to_mark();
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -281,6 +281,7 @@ DEFINE_RUN_ONCE_STATIC(ossl_comp_zlib_init)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
ERR_set_mark();
|
||||
zlib_dso = DSO_load(NULL, LIBZ, NULL, 0);
|
||||
if (zlib_dso != NULL) {
|
||||
p_compress = (compress_ft)DSO_bind_func(zlib_dso, "compress");
|
||||
@@ -298,9 +299,12 @@ DEFINE_RUN_ONCE_STATIC(ossl_comp_zlib_init)
|
||||
|| p_inflate == NULL || p_inflateInit_ == NULL
|
||||
|| p_deflateEnd == NULL || p_deflate == NULL
|
||||
|| p_deflateInit_ == NULL || p_zError == NULL) {
|
||||
ERR_clear_last_mark();
|
||||
ossl_comp_zlib_cleanup();
|
||||
return 0;
|
||||
}
|
||||
/* Do not leave errors behind on success. */
|
||||
ERR_pop_to_mark();
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 1998-2023 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 1998-2026 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
|
||||
@@ -366,6 +366,7 @@ DEFINE_RUN_ONCE_STATIC(ossl_comp_zstd_init)
|
||||
#define LIBZSTD "zstd"
|
||||
#endif
|
||||
|
||||
ERR_set_mark();
|
||||
zstd_dso = DSO_load(NULL, LIBZSTD, NULL, 0);
|
||||
if (zstd_dso != NULL) {
|
||||
p_createCStream = (createCStream_ft)DSO_bind_func(zstd_dso, "ZSTD_createCStream");
|
||||
@@ -392,9 +393,12 @@ DEFINE_RUN_ONCE_STATIC(ossl_comp_zstd_init)
|
||||
|| p_freeDStream == NULL || p_decompressStream == NULL || p_decompress == NULL
|
||||
|| p_isError == NULL || p_getErrorName == NULL || p_DStreamInSize == NULL
|
||||
|| p_CStreamInSize == NULL) {
|
||||
ERR_clear_last_mark();
|
||||
ossl_comp_zstd_cleanup();
|
||||
return 0;
|
||||
}
|
||||
/* Do not leave errors behind on success. */
|
||||
ERR_pop_to_mark();
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -55,6 +55,8 @@ static HINSTANCE LoadLibraryA(LPCSTR lpLibFileName)
|
||||
}
|
||||
#endif
|
||||
|
||||
#define GETPROCADDRESS(h, name, type) ((type)(void (*)(void))GetProcAddress((h), (name)))
|
||||
|
||||
/* Part of the hack in "win32_load" ... */
|
||||
#define DSO_MAX_TRANSLATED_SIZE 256
|
||||
|
||||
@@ -177,7 +179,7 @@ static DSO_FUNC_TYPE win32_bind_func(DSO *dso, const char *symname)
|
||||
ERR_raise(ERR_LIB_DSO, DSO_R_NULL_HANDLE);
|
||||
return NULL;
|
||||
}
|
||||
sym.f = GetProcAddress(*ptr, symname);
|
||||
sym.f = GETPROCADDRESS(*ptr, symname, FARPROC);
|
||||
if (sym.p == NULL) {
|
||||
ERR_raise_data(ERR_LIB_DSO, DSO_R_SYM_FAILURE, "symname(%s)", symname);
|
||||
return NULL;
|
||||
@@ -485,12 +487,11 @@ typedef BOOL(WINAPI *MODULE32)(HANDLE, MODULEENTRY32 *);
|
||||
|
||||
static int win32_pathbyaddr(void *addr, char *path, int sz)
|
||||
{
|
||||
HMODULE dll;
|
||||
HANDLE hModuleSnap = INVALID_HANDLE_VALUE;
|
||||
MODULEENTRY32 me32;
|
||||
CREATETOOLHELP32SNAPSHOT create_snap;
|
||||
CLOSETOOLHELP32SNAPSHOT close_snap;
|
||||
MODULE32 module_first, module_next;
|
||||
HMODULE hModule = NULL;
|
||||
const DWORD wpathSize = 32768; /* 32768 is the maximum possible path length on Windows */
|
||||
WCHAR *wpath = NULL;
|
||||
DWORD wlen, wsz;
|
||||
int utf8len = -1;
|
||||
|
||||
if (addr == NULL) {
|
||||
union {
|
||||
@@ -502,89 +503,55 @@ static int win32_pathbyaddr(void *addr, char *path, int sz)
|
||||
addr = t.p;
|
||||
}
|
||||
|
||||
dll = LoadLibrary(TEXT(DLLNAME));
|
||||
if (dll == NULL) {
|
||||
ERR_raise(ERR_LIB_DSO, DSO_R_UNSUPPORTED);
|
||||
return -1;
|
||||
if (!GetModuleHandleExW(
|
||||
GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT,
|
||||
(LPCWSTR)addr, &hModule)) {
|
||||
ERR_raise_data(ERR_LIB_DSO, DSO_R_SYM_FAILURE, "Unable to get module handle (%lu)\n",
|
||||
GetLastError());
|
||||
goto out;
|
||||
}
|
||||
|
||||
create_snap = (CREATETOOLHELP32SNAPSHOT)
|
||||
GetProcAddress(dll, "CreateToolhelp32Snapshot");
|
||||
if (create_snap == NULL) {
|
||||
FreeLibrary(dll);
|
||||
ERR_raise(ERR_LIB_DSO, DSO_R_UNSUPPORTED);
|
||||
return -1;
|
||||
wpath = (WCHAR *)OPENSSL_malloc(wpathSize * sizeof(WCHAR));
|
||||
if (wpath == NULL) {
|
||||
ERR_raise_data(ERR_LIB_DSO, DSO_R_NULL_HANDLE, "Path allocation failure (%lu)\n",
|
||||
GetLastError());
|
||||
goto out;
|
||||
}
|
||||
wlen = GetModuleFileNameW(hModule, wpath, wpathSize);
|
||||
if (wlen == 0 || GetLastError() == ERROR_INSUFFICIENT_BUFFER) {
|
||||
ERR_raise_data(ERR_LIB_DSO, DSO_R_NAME_TRANSLATION_FAILED, "Module name fetch failed (%lu)\n",
|
||||
GetLastError());
|
||||
goto out;
|
||||
}
|
||||
/* We take the rest for granted... */
|
||||
#ifdef _WIN32_WCE
|
||||
close_snap = (CLOSETOOLHELP32SNAPSHOT)
|
||||
GetProcAddress(dll, "CloseToolhelp32Snapshot");
|
||||
#else
|
||||
close_snap = (CLOSETOOLHELP32SNAPSHOT)CloseHandle;
|
||||
#endif
|
||||
module_first = (MODULE32)GetProcAddress(dll, "Module32First");
|
||||
module_next = (MODULE32)GetProcAddress(dll, "Module32Next");
|
||||
|
||||
/*
|
||||
* Take a snapshot of current process which includes
|
||||
* list of all involved modules.
|
||||
* If we pass a size of 0 or less, invoke the size-query pattern,
|
||||
* in which we do not actually copy the name to the path buffer,
|
||||
* but return the size the path buffer needs to be for this object
|
||||
*/
|
||||
hModuleSnap = (*create_snap)(TH32CS_SNAPMODULE, 0);
|
||||
if (hModuleSnap == INVALID_HANDLE_VALUE) {
|
||||
FreeLibrary(dll);
|
||||
ERR_raise(ERR_LIB_DSO, DSO_R_UNSUPPORTED);
|
||||
return -1;
|
||||
if (sz <= 0) {
|
||||
utf8len = (int)(wlen + 1);
|
||||
goto out;
|
||||
}
|
||||
|
||||
me32.dwSize = sizeof(me32);
|
||||
|
||||
if (!(*module_first)(hModuleSnap, &me32)) {
|
||||
(*close_snap)(hModuleSnap);
|
||||
FreeLibrary(dll);
|
||||
ERR_raise(ERR_LIB_DSO, DSO_R_FAILURE);
|
||||
return -1;
|
||||
/*
|
||||
* Convert the wide path to UTF-8
|
||||
*/
|
||||
wsz = (DWORD)sz;
|
||||
utf8len = WideCharToMultiByte(CP_UTF8, 0, wpath, -1, NULL, 0, NULL, NULL);
|
||||
if (utf8len <= 0 || (DWORD)utf8len > wsz) {
|
||||
ERR_raise_data(ERR_LIB_DSO, DSO_R_NAME_TRANSLATION_FAILED, "UTF8 query failed (%lu)\n",
|
||||
GetLastError());
|
||||
goto out;
|
||||
}
|
||||
|
||||
/* Enumerate the modules to find one which includes me. */
|
||||
do {
|
||||
if ((size_t)addr >= (size_t)me32.modBaseAddr && (size_t)addr < (size_t)(me32.modBaseAddr + me32.modBaseSize)) {
|
||||
(*close_snap)(hModuleSnap);
|
||||
FreeLibrary(dll);
|
||||
#ifdef _WIN32_WCE
|
||||
#if _WIN32_WCE >= 101
|
||||
return WideCharToMultiByte(CP_ACP, 0, me32.szExePath, -1,
|
||||
path, sz, NULL, NULL);
|
||||
#else
|
||||
{
|
||||
int i, len = (int)wcslen(me32.szExePath);
|
||||
if (sz <= 0)
|
||||
return len + 1;
|
||||
if (len >= sz)
|
||||
len = sz - 1;
|
||||
for (i = 0; i < len; i++)
|
||||
path[i] = (char)me32.szExePath[i];
|
||||
path[len++] = '\0';
|
||||
return len;
|
||||
}
|
||||
#endif
|
||||
#else
|
||||
{
|
||||
int len = (int)strlen(me32.szExePath);
|
||||
if (sz <= 0)
|
||||
return len + 1;
|
||||
if (len >= sz)
|
||||
len = sz - 1;
|
||||
memcpy(path, me32.szExePath, len);
|
||||
path[len++] = '\0';
|
||||
return len;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
} while ((*module_next)(hModuleSnap, &me32));
|
||||
|
||||
(*close_snap)(hModuleSnap);
|
||||
FreeLibrary(dll);
|
||||
return 0;
|
||||
if (WideCharToMultiByte(CP_UTF8, 0, wpath, -1, path, wsz, NULL, NULL) <= 0) {
|
||||
ERR_raise_data(ERR_LIB_DSO, DSO_R_NAME_TRANSLATION_FAILED, "UTF8 translation failed (%lu)\n",
|
||||
GetLastError());
|
||||
goto out;
|
||||
}
|
||||
out:
|
||||
OPENSSL_free(wpath);
|
||||
return utf8len;
|
||||
}
|
||||
|
||||
static void *win32_globallookup(const char *name)
|
||||
@@ -606,8 +573,7 @@ static void *win32_globallookup(const char *name)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
create_snap = (CREATETOOLHELP32SNAPSHOT)
|
||||
GetProcAddress(dll, "CreateToolhelp32Snapshot");
|
||||
create_snap = GETPROCADDRESS(dll, "CreateToolhelp32Snapshot", CREATETOOLHELP32SNAPSHOT);
|
||||
if (create_snap == NULL) {
|
||||
FreeLibrary(dll);
|
||||
ERR_raise(ERR_LIB_DSO, DSO_R_UNSUPPORTED);
|
||||
@@ -615,13 +581,12 @@ static void *win32_globallookup(const char *name)
|
||||
}
|
||||
/* We take the rest for granted... */
|
||||
#ifdef _WIN32_WCE
|
||||
close_snap = (CLOSETOOLHELP32SNAPSHOT)
|
||||
GetProcAddress(dll, "CloseToolhelp32Snapshot");
|
||||
close_snap = GETPROCADDRESS(dll, "CloseToolhelp32Snapshot", CLOSETOOLHELP32SNAPSHOT);
|
||||
#else
|
||||
close_snap = (CLOSETOOLHELP32SNAPSHOT)CloseHandle;
|
||||
#endif
|
||||
module_first = (MODULE32)GetProcAddress(dll, "Module32First");
|
||||
module_next = (MODULE32)GetProcAddress(dll, "Module32Next");
|
||||
module_first = GETPROCADDRESS(dll, "Module32First", MODULE32);
|
||||
module_next = GETPROCADDRESS(dll, "Module32Next", MODULE32);
|
||||
|
||||
hModuleSnap = (*create_snap)(TH32CS_SNAPMODULE, 0);
|
||||
if (hModuleSnap == INVALID_HANDLE_VALUE) {
|
||||
@@ -639,7 +604,7 @@ static void *win32_globallookup(const char *name)
|
||||
}
|
||||
|
||||
do {
|
||||
if ((ret.f = GetProcAddress(me32.hModule, name))) {
|
||||
if ((ret.f = GETPROCADDRESS(me32.hModule, name, FARPROC))) {
|
||||
(*close_snap)(hModuleSnap);
|
||||
FreeLibrary(dll);
|
||||
return ret.p;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2001-2023 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 2001-2026 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved
|
||||
*
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
@@ -213,6 +213,17 @@ int ossl_ec_scalar_mul_ladder(const EC_GROUP *group, EC_POINT *r,
|
||||
goto err;
|
||||
}
|
||||
|
||||
/*
|
||||
* Constant-timeness of this copy depends on the caller: BN_copy() moves
|
||||
* scalar->top words unless |scalar| is flagged BN_FLG_CONSTTIME (in which
|
||||
* case scalar->dmax words are moved). Secret scalars are therefore
|
||||
* expected to arrive either BN_FLG_CONSTTIME or fixed-top, so that their
|
||||
* top is a public, value-independent width and the copy length does not
|
||||
* leak their magnitude. ECDSA satisfies this via
|
||||
* ossl_bn_priv_rand_range_fixed_top(). The fixed-top pinning below makes
|
||||
* the subsequent arithmetic constant time regardless, but cannot
|
||||
* retroactively fix the copy length here.
|
||||
*/
|
||||
if (!BN_copy(k, scalar)) {
|
||||
ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
|
||||
goto err;
|
||||
@@ -231,10 +242,36 @@ int ossl_ec_scalar_mul_ladder(const EC_GROUP *group, EC_POINT *r,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* |k| may still carry a top that depends on the value of the secret
|
||||
* scalar: callers pass either a fixed-top BIGNUM (e.g. the ECDSA nonce)
|
||||
* or a minimal-top one (e.g. SM2), and BN_copy() above preserves that
|
||||
* top. Pin |k| to a fixed number of words (matching the group
|
||||
* cardinality) so that the additions below run in constant time,
|
||||
* independently of the bit length of the scalar. Otherwise the work
|
||||
* done by BN_add()/BN_uadd() depends on the operand tops and leaks the
|
||||
* magnitude of the secret scalar.
|
||||
*/
|
||||
if (!bn_set_top_fixed(k, group_top)) {
|
||||
ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
|
||||
goto err;
|
||||
}
|
||||
|
||||
if (!BN_add(lambda, k, cardinality)) {
|
||||
ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
|
||||
goto err;
|
||||
}
|
||||
/*
|
||||
* |lambda| = scalar + cardinality may or may not have produced a carry
|
||||
* into an extra word depending on the secret scalar. Pin its top to one
|
||||
* word above the group top so that the second addition, which consumes
|
||||
* |lambda|, is likewise constant time and so that the BN_is_bit_set()
|
||||
* below always inspects a defined word.
|
||||
*/
|
||||
if (!bn_set_top_fixed(lambda, group_top + 1)) {
|
||||
ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
|
||||
goto err;
|
||||
}
|
||||
BN_set_flags(lambda, BN_FLG_CONSTTIME);
|
||||
if (!BN_add(k, lambda, cardinality)) {
|
||||
ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
|
||||
|
||||
@@ -171,22 +171,35 @@ static ossl_inline void ecp_sm2p256_mod_inverse(BN_ULONG *out,
|
||||
BN_MOD_INV(out, in, ecp_sm2p256_div_by_2, ecp_sm2p256_sub, def_p);
|
||||
}
|
||||
|
||||
/* Point double: R <- P + P */
|
||||
static void ecp_sm2p256_point_double(P256_POINT *R, const P256_POINT *P)
|
||||
/*
|
||||
* Constant-time conditional copy: r = mask ? a : r, where mask is either 0 or
|
||||
* all-ones. Used to select point-addition results without branching.
|
||||
*/
|
||||
static ossl_inline void ecp_sm2p256_cond_copy(P256_POINT *r,
|
||||
const P256_POINT *a, BN_ULONG mask)
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
for (i = 0; i < P256_LIMBS; ++i) {
|
||||
r->X[i] = constant_time_select_64(mask, a->X[i], r->X[i]);
|
||||
r->Y[i] = constant_time_select_64(mask, a->Y[i], r->Y[i]);
|
||||
r->Z[i] = constant_time_select_64(mask, a->Z[i], r->Z[i]);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Point double: R <- P + P
|
||||
*
|
||||
* Branch-free: the doubling formula already produces Z = 0 (the point at
|
||||
* infinity) when the input Z is 0 (R->Z = 2*Y*Z), and the resulting X, Y are
|
||||
* irrelevant for a Z = 0 point, so no is_zeros(P->Z) special case is needed.
|
||||
*/
|
||||
static void ecp_sm2p256_point_double(P256_POINT *R, const P256_POINT *P)
|
||||
{
|
||||
ALIGN32 BN_ULONG tmp0[P256_LIMBS];
|
||||
ALIGN32 BN_ULONG tmp1[P256_LIMBS];
|
||||
ALIGN32 BN_ULONG tmp2[P256_LIMBS];
|
||||
|
||||
/* zero-check P->Z */
|
||||
if (is_zeros(P->Z)) {
|
||||
for (i = 0; i < P256_LIMBS; ++i)
|
||||
R->Z[i] = 0;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
ecp_sm2p256_sqr(tmp0, P->Z);
|
||||
ecp_sm2p256_sub(tmp1, P->X, tmp0);
|
||||
ecp_sm2p256_add(tmp0, P->X, tmp0);
|
||||
@@ -208,6 +221,13 @@ static void ecp_sm2p256_point_double(P256_POINT *R, const P256_POINT *P)
|
||||
}
|
||||
|
||||
/* Point add affine: R <- P + Q */
|
||||
/*
|
||||
* NB: this function is deliberately NOT constant time. It is used only to
|
||||
* precompute the table of small multiples of the *public* input point (see
|
||||
* ecp_sm2p256_point_P_mul_by_scalar); the secret scalar never flows through
|
||||
* it, so its identity-dependent branches cannot leak it. Keeping the fast
|
||||
* branchy formula here avoids the constant-time overhead on the table build.
|
||||
*/
|
||||
static void ecp_sm2p256_point_add_affine(P256_POINT *R, const P256_POINT *P,
|
||||
const P256_POINT_AFFINE *Q)
|
||||
{
|
||||
@@ -274,107 +294,164 @@ static void ecp_sm2p256_point_add_affine(P256_POINT *R, const P256_POINT *P,
|
||||
static void ecp_sm2p256_point_add(P256_POINT *R, const P256_POINT *P,
|
||||
const P256_POINT *Q)
|
||||
{
|
||||
unsigned int i;
|
||||
ALIGN32 BN_ULONG tmp0[P256_LIMBS] = { 0 };
|
||||
ALIGN32 BN_ULONG tmp1[P256_LIMBS] = { 0 };
|
||||
ALIGN32 BN_ULONG tmp2[P256_LIMBS] = { 0 };
|
||||
P256_POINT sum, dbl, res;
|
||||
BN_ULONG p_inf, q_inf, is_dbl;
|
||||
|
||||
/* zero-check P | Q ->Z */
|
||||
if (is_zeros(P->Z)) {
|
||||
for (i = 0; i < P256_LIMBS; ++i) {
|
||||
R->X[i] = Q->X[i];
|
||||
R->Y[i] = Q->Y[i];
|
||||
R->Z[i] = Q->Z[i];
|
||||
}
|
||||
|
||||
return;
|
||||
} else if (is_zeros(Q->Z)) {
|
||||
for (i = 0; i < P256_LIMBS; ++i) {
|
||||
R->X[i] = P->X[i];
|
||||
R->Y[i] = P->Y[i];
|
||||
R->Z[i] = P->Z[i];
|
||||
}
|
||||
|
||||
return;
|
||||
} else if (is_point_equal(P, Q)) {
|
||||
ecp_sm2p256_point_double(R, Q);
|
||||
|
||||
return;
|
||||
}
|
||||
p_inf = is_zeros(P->Z);
|
||||
q_inf = is_zeros(Q->Z);
|
||||
|
||||
/*
|
||||
* General P + Q addition into |sum|, valid unless P or Q is infinity or
|
||||
* P == +-Q. tmp0 = H and tmp1 = R are the coordinate differences: P and Q
|
||||
* are the same point iff both are zero; P == -Q iff only H is zero (the
|
||||
* formula then yields Z = 0, i.e. infinity, on its own).
|
||||
*/
|
||||
ecp_sm2p256_sqr(tmp0, P->Z);
|
||||
ecp_sm2p256_mul(tmp1, tmp0, P->Z);
|
||||
ecp_sm2p256_mul(tmp0, tmp0, Q->X);
|
||||
ecp_sm2p256_mul(tmp1, tmp1, Q->Y);
|
||||
ecp_sm2p256_mul(R->Y, P->Y, Q->Z);
|
||||
ecp_sm2p256_mul(R->Z, Q->Z, P->Z);
|
||||
ecp_sm2p256_mul(sum.Y, P->Y, Q->Z);
|
||||
ecp_sm2p256_mul(sum.Z, Q->Z, P->Z);
|
||||
ecp_sm2p256_sqr(tmp2, Q->Z);
|
||||
ecp_sm2p256_mul(R->Y, tmp2, R->Y);
|
||||
ecp_sm2p256_mul(R->X, tmp2, P->X);
|
||||
ecp_sm2p256_sub(tmp0, tmp0, R->X);
|
||||
ecp_sm2p256_mul(R->Z, tmp0, R->Z);
|
||||
ecp_sm2p256_sub(tmp1, tmp1, R->Y);
|
||||
ecp_sm2p256_mul(sum.Y, tmp2, sum.Y);
|
||||
ecp_sm2p256_mul(sum.X, tmp2, P->X);
|
||||
ecp_sm2p256_sub(tmp0, tmp0, sum.X);
|
||||
ecp_sm2p256_mul(sum.Z, tmp0, sum.Z);
|
||||
ecp_sm2p256_sub(tmp1, tmp1, sum.Y);
|
||||
is_dbl = is_zeros(tmp0) & is_zeros(tmp1);
|
||||
ecp_sm2p256_sqr(tmp2, tmp0);
|
||||
ecp_sm2p256_mul(tmp0, tmp0, tmp2);
|
||||
ecp_sm2p256_mul(tmp2, tmp2, R->X);
|
||||
ecp_sm2p256_sqr(R->X, tmp1);
|
||||
ecp_sm2p256_sub(R->X, R->X, tmp2);
|
||||
ecp_sm2p256_sub(R->X, R->X, tmp2);
|
||||
ecp_sm2p256_sub(R->X, R->X, tmp0);
|
||||
ecp_sm2p256_sub(tmp2, tmp2, R->X);
|
||||
ecp_sm2p256_mul(tmp2, tmp2, sum.X);
|
||||
ecp_sm2p256_sqr(sum.X, tmp1);
|
||||
ecp_sm2p256_sub(sum.X, sum.X, tmp2);
|
||||
ecp_sm2p256_sub(sum.X, sum.X, tmp2);
|
||||
ecp_sm2p256_sub(sum.X, sum.X, tmp0);
|
||||
ecp_sm2p256_sub(tmp2, tmp2, sum.X);
|
||||
ecp_sm2p256_mul(tmp2, tmp1, tmp2);
|
||||
ecp_sm2p256_mul(tmp0, tmp0, R->Y);
|
||||
ecp_sm2p256_sub(R->Y, tmp2, tmp0);
|
||||
ecp_sm2p256_mul(tmp0, tmp0, sum.Y);
|
||||
ecp_sm2p256_sub(sum.Y, tmp2, tmp0);
|
||||
|
||||
/* 2*P, for the P == Q case. */
|
||||
ecp_sm2p256_point_double(&dbl, P);
|
||||
|
||||
/*
|
||||
* Select the result without branching, in increasing priority:
|
||||
* default -> sum (distinct points; also P == -Q which gives infinity)
|
||||
* is_dbl -> dbl (P == Q)
|
||||
* q_inf -> P (Q is infinity)
|
||||
* p_inf -> Q (P is infinity; highest priority)
|
||||
* All reads of P and Q happen before R is written, so R may alias P or Q.
|
||||
*/
|
||||
memcpy(&res, &sum, sizeof(res));
|
||||
ecp_sm2p256_cond_copy(&res, &dbl, is_dbl);
|
||||
ecp_sm2p256_cond_copy(&res, P, q_inf);
|
||||
ecp_sm2p256_cond_copy(&res, Q, p_inf);
|
||||
memcpy(R, &res, sizeof(res));
|
||||
}
|
||||
|
||||
#if !defined(OPENSSL_NO_SM2_PRECOMP)
|
||||
/* Base point mul by scalar: k - scalar, G - base point */
|
||||
/*
|
||||
* Constant-time gather of the affine entry |index| from a 256-entry sub-table.
|
||||
* |sub| points to the sub-table for one 8-bit comb window; entry v is stored
|
||||
* as X[P256_LIMBS] followed by Y[P256_LIMBS] at sub + v * (2 * P256_LIMBS).
|
||||
* Entry 0 is not stored, so index 0 yields the all-zero (X, Y) placeholder,
|
||||
* which the caller turns into the point at infinity.
|
||||
*/
|
||||
static void ecp_sm2p256_select_G(P256_POINT_AFFINE *R, const BN_ULONG *sub,
|
||||
unsigned int index)
|
||||
{
|
||||
unsigned int v, j;
|
||||
|
||||
memset(R, 0, sizeof(*R));
|
||||
for (v = 1; v < 256; ++v) {
|
||||
BN_ULONG mask = constant_time_is_zero_64((BN_ULONG)(index ^ v));
|
||||
const BN_ULONG *e = sub + (size_t)v * (2 * P256_LIMBS);
|
||||
|
||||
for (j = 0; j < P256_LIMBS; ++j) {
|
||||
R->X[j] |= constant_time_select_64(mask, e[j], 0);
|
||||
R->Y[j] |= constant_time_select_64(mask, e[P256_LIMBS + j], 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* R = k*G using the precomputed comb. Constant-time: every 8-bit window is
|
||||
* gathered from its full 256-entry sub-table with a mask and lifted to a
|
||||
* Jacobian point whose Z is 1 for a non-zero window and 0 (infinity) for a
|
||||
* zero window, so the unconditional, branch-free addition contributes nothing
|
||||
* for a zero window and no secret-dependent branch or table index remains.
|
||||
*/
|
||||
static void ecp_sm2p256_point_G_mul_by_scalar(P256_POINT *R, const BN_ULONG *k)
|
||||
{
|
||||
unsigned int i, index, mask = 0xff;
|
||||
P256_POINT_AFFINE Q;
|
||||
unsigned int i, j, index;
|
||||
P256_POINT_AFFINE Qaff;
|
||||
P256_POINT QJ;
|
||||
|
||||
memset(R, 0, sizeof(P256_POINT));
|
||||
|
||||
if (is_zeros(k))
|
||||
return;
|
||||
for (i = 0; i < 32; ++i) {
|
||||
index = (k[i / 8] >> (8 * (i % 8))) & 0xff;
|
||||
ecp_sm2p256_select_G(&Qaff,
|
||||
ecp_sm2p256_precomputed + (size_t)i * 256 * (2 * P256_LIMBS),
|
||||
index);
|
||||
|
||||
index = k[0] & mask;
|
||||
if (index) {
|
||||
index = index * 8;
|
||||
memcpy(R->X, ecp_sm2p256_precomputed + index, 32);
|
||||
memcpy(R->Y, ecp_sm2p256_precomputed + index + P256_LIMBS, 32);
|
||||
R->Z[0] = 1;
|
||||
}
|
||||
{
|
||||
/* Z = 1 iff the window is non-zero, else 0 (point at infinity). */
|
||||
BN_ULONG nz = ~constant_time_is_zero_64((BN_ULONG)index);
|
||||
|
||||
for (i = 1; i < 32; ++i) {
|
||||
index = (k[i / 8] >> (8 * (i % 8))) & mask;
|
||||
|
||||
if (index) {
|
||||
index = index + i * 256;
|
||||
index = index * 8;
|
||||
memcpy(Q.X, ecp_sm2p256_precomputed + index, 32);
|
||||
memcpy(Q.Y, ecp_sm2p256_precomputed + index + P256_LIMBS, 32);
|
||||
ecp_sm2p256_point_add_affine(R, R, &Q);
|
||||
for (j = 0; j < P256_LIMBS; ++j) {
|
||||
QJ.X[j] = Qaff.X[j];
|
||||
QJ.Y[j] = Qaff.Y[j];
|
||||
QJ.Z[j] = 0;
|
||||
}
|
||||
QJ.Z[0] = nz & 1;
|
||||
}
|
||||
ecp_sm2p256_point_add(R, R, &QJ);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Constant-time gather of |index| from a 16-entry table of Jacobian points.
|
||||
* Index 0 yields the all-zero point (Z = 0, i.e. the point at infinity).
|
||||
*/
|
||||
static void ecp_sm2p256_select_P(P256_POINT *R, const P256_POINT tbl[16],
|
||||
unsigned int index)
|
||||
{
|
||||
unsigned int i, j;
|
||||
|
||||
memset(R, 0, sizeof(*R));
|
||||
for (i = 1; i < 16; ++i) {
|
||||
BN_ULONG mask = constant_time_is_zero_64((BN_ULONG)(index ^ i));
|
||||
|
||||
for (j = 0; j < P256_LIMBS; ++j) {
|
||||
R->X[j] |= constant_time_select_64(mask, tbl[i].X[j], 0);
|
||||
R->Y[j] |= constant_time_select_64(mask, tbl[i].Y[j], 0);
|
||||
R->Z[j] |= constant_time_select_64(mask, tbl[i].Z[j], 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Affine point mul by scalar: k - scalar, P - affine point
|
||||
*
|
||||
* Constant-time windowed multiplication: every 4-bit window is processed
|
||||
* uniformly with four doublings followed by a masked table gather and an
|
||||
* unconditional, branch-free addition. There is no init/skip logic and no
|
||||
* secret-dependent table index, so the running time and memory-access pattern
|
||||
* do not depend on the value of the secret scalar.
|
||||
*/
|
||||
static void ecp_sm2p256_point_P_mul_by_scalar(P256_POINT *R, const BN_ULONG *k,
|
||||
P256_POINT_AFFINE P)
|
||||
{
|
||||
int i, init = 0;
|
||||
int i;
|
||||
unsigned int index, mask = 0x0f;
|
||||
ALIGN64 P256_POINT precomputed[16];
|
||||
|
||||
memset(R, 0, sizeof(P256_POINT));
|
||||
|
||||
if (is_zeros(k))
|
||||
return;
|
||||
P256_POINT T;
|
||||
|
||||
/* The first value of the precomputed table is P. */
|
||||
memcpy(precomputed[1].X, P.X, 32);
|
||||
@@ -391,22 +468,18 @@ static void ecp_sm2p256_point_P_mul_by_scalar(P256_POINT *R, const BN_ULONG *k,
|
||||
for (i = 3; i < 16; ++i)
|
||||
ecp_sm2p256_point_add_affine(&precomputed[i], &precomputed[i - 1], &P);
|
||||
|
||||
memset(R, 0, sizeof(*R)); /* R = point at infinity */
|
||||
|
||||
for (i = 64 - 1; i >= 0; --i) {
|
||||
index = (k[i / 16] >> (4 * (i % 16))) & mask;
|
||||
|
||||
if (init == 0) {
|
||||
if (index) {
|
||||
memcpy(R, &precomputed[index], sizeof(P256_POINT));
|
||||
init = 1;
|
||||
}
|
||||
} else {
|
||||
ecp_sm2p256_point_double(R, R);
|
||||
ecp_sm2p256_point_double(R, R);
|
||||
ecp_sm2p256_point_double(R, R);
|
||||
ecp_sm2p256_point_double(R, R);
|
||||
if (index)
|
||||
ecp_sm2p256_point_add(R, R, &precomputed[index]);
|
||||
}
|
||||
ecp_sm2p256_point_double(R, R);
|
||||
ecp_sm2p256_point_double(R, R);
|
||||
ecp_sm2p256_point_double(R, R);
|
||||
ecp_sm2p256_point_double(R, R);
|
||||
|
||||
ecp_sm2p256_select_P(&T, precomputed, index);
|
||||
ecp_sm2p256_point_add(R, R, &T);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 1995-2023 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 1995-2026 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
|
||||
@@ -312,6 +312,10 @@ int ERR_unload_strings(int lib, ERR_STRING_DATA *str)
|
||||
if (!RUN_ONCE(&err_string_init, do_err_strings_init))
|
||||
return 0;
|
||||
|
||||
/* The error string table may already have been cleaned up. */
|
||||
if (err_string_lock == NULL)
|
||||
return 1;
|
||||
|
||||
if (!CRYPTO_THREAD_write_lock(err_string_lock))
|
||||
return 0;
|
||||
/*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 1995-2026 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
|
||||
@@ -383,9 +383,6 @@ static long enc_ctrl(BIO *b, int cmd, long num, void *ptr)
|
||||
case BIO_CTRL_DUP:
|
||||
dbio = (BIO *)ptr;
|
||||
dctx = BIO_get_data(dbio);
|
||||
dctx->cipher = EVP_CIPHER_CTX_new();
|
||||
if (dctx->cipher == NULL)
|
||||
return 0;
|
||||
ret = EVP_CIPHER_CTX_copy(dctx->cipher, ctx->cipher);
|
||||
if (ret)
|
||||
BIO_set_init(dbio, 1);
|
||||
|
||||
@@ -194,7 +194,9 @@ int evp_cipher_asn1_to_param_ex(EVP_CIPHER_CTX *c, ASN1_TYPE *type,
|
||||
break;
|
||||
|
||||
default:
|
||||
ret = EVP_CIPHER_get_asn1_iv(c, type) >= 0 ? 1 : -1;
|
||||
ret = EVP_CIPHER_get_asn1_iv(c, type);
|
||||
if (ret == 0 && EVP_CIPHER_CTX_get_iv_length(c) == 0)
|
||||
ret = 1;
|
||||
}
|
||||
} else if (cipher->prov != NULL) {
|
||||
/* We cheat, there's no need for an object ID for this use */
|
||||
|
||||
@@ -1264,7 +1264,7 @@ BIO *OSSL_HTTP_exchange(OSSL_HTTP_REQ_CTX *rctx, char **redirection_url)
|
||||
return resp;
|
||||
}
|
||||
|
||||
static int redirection_ok(int n_redir, const char *old_url, const char *new_url)
|
||||
static int redirection_ok(int n_redir, int use_ssl, const char *new_url)
|
||||
{
|
||||
if (n_redir >= HTTP_VERSION_MAX_REDIRECTIONS) {
|
||||
ERR_raise(ERR_LIB_HTTP, HTTP_R_TOO_MANY_REDIRECTIONS);
|
||||
@@ -1272,7 +1272,7 @@ static int redirection_ok(int n_redir, const char *old_url, const char *new_url)
|
||||
}
|
||||
if (*new_url == '/') /* redirection to same server => same protocol */
|
||||
return 1;
|
||||
if (HAS_PREFIX(old_url, OSSL_HTTPS_NAME ":") && !HAS_PREFIX(new_url, OSSL_HTTPS_NAME ":")) {
|
||||
if (use_ssl && !HAS_PREFIX(new_url, OSSL_HTTPS_NAME ":")) {
|
||||
ERR_raise(ERR_LIB_HTTP, HTTP_R_REDIRECTION_FROM_HTTPS_TO_HTTP);
|
||||
return 0;
|
||||
}
|
||||
@@ -1331,7 +1331,7 @@ BIO *OSSL_HTTP_get(const char *url, const char *proxy, const char *no_proxy,
|
||||
}
|
||||
OPENSSL_free(path);
|
||||
if (resp == NULL && redirection_url != NULL) {
|
||||
if (redirection_ok(++n_redirs, current_url, redirection_url)
|
||||
if (redirection_ok(++n_redirs, use_ssl, redirection_url)
|
||||
&& may_still_retry(max_time, &timeout)) {
|
||||
(void)BIO_reset(bio);
|
||||
OPENSSL_free(current_url);
|
||||
|
||||
@@ -496,6 +496,7 @@ void OPENSSL_cleanup(void)
|
||||
int OPENSSL_init_crypto(uint64_t opts, const OPENSSL_INIT_SETTINGS *settings)
|
||||
{
|
||||
uint64_t tmp;
|
||||
uint64_t optsdone_bits = opts;
|
||||
int aloaddone = 0;
|
||||
|
||||
/* Applications depend on 0 being returned when cleanup was already done */
|
||||
@@ -621,8 +622,15 @@ int OPENSSL_init_crypto(uint64_t opts, const OPENSSL_INIT_SETTINGS *settings)
|
||||
if (opts & OPENSSL_INIT_LOAD_CONFIG) {
|
||||
int loading = CRYPTO_THREAD_get_local(&in_init_config_local) != NULL;
|
||||
|
||||
/* If called recursively from OBJ_ calls, just skip it. */
|
||||
if (!loading) {
|
||||
/* If called recursively from OBJ_ calls during config loading,
|
||||
* we have to mask OPENSSL_INIT_LOAD_CONFIG in optsdone to not
|
||||
* advertise that config loading is complete, otherwise other
|
||||
* threads may proceed, e.g., to fetching from a provider that
|
||||
* is not yet loaded.
|
||||
*/
|
||||
if (loading) {
|
||||
optsdone_bits &= ~(uint64_t)OPENSSL_INIT_LOAD_CONFIG;
|
||||
} else {
|
||||
int ret;
|
||||
|
||||
if (!CRYPTO_THREAD_set_local(&in_init_config_local, (void *)-1))
|
||||
@@ -687,7 +695,7 @@ int OPENSSL_init_crypto(uint64_t opts, const OPENSSL_INIT_SETTINGS *settings)
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!CRYPTO_atomic_or(&optsdone, opts, &tmp, optsdone_lock))
|
||||
if (!CRYPTO_atomic_or(&optsdone, optsdone_bits, &tmp, optsdone_lock))
|
||||
return 0;
|
||||
|
||||
return 1;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2018-2025 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 2018-2026 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
|
||||
@@ -276,23 +276,29 @@ int ossl_siv128_encrypt(SIV128_CONTEXT *ctx,
|
||||
size_t len)
|
||||
{
|
||||
SIV_BLOCK q;
|
||||
int ret = 0;
|
||||
int final_ret_value = -1;
|
||||
|
||||
/* can only do one crypto operation */
|
||||
if (ctx->crypto_ok == 0)
|
||||
return 0;
|
||||
goto end;
|
||||
ctx->crypto_ok--;
|
||||
|
||||
if (!siv128_do_s2v_p(ctx, &q, in, len))
|
||||
return 0;
|
||||
goto end;
|
||||
|
||||
memcpy(ctx->tag.byte, &q, SIV_LEN);
|
||||
q.byte[8] &= 0x7f;
|
||||
q.byte[12] &= 0x7f;
|
||||
|
||||
if (!siv128_do_encrypt(ctx->cipher_ctx, out, in, len, &q))
|
||||
return 0;
|
||||
ctx->final_ret = 0;
|
||||
return 1;
|
||||
goto end;
|
||||
|
||||
ret = 1;
|
||||
final_ret_value = 0;
|
||||
end:
|
||||
ctx->final_ret = final_ret_value;
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -305,10 +311,12 @@ int ossl_siv128_decrypt(SIV128_CONTEXT *ctx,
|
||||
unsigned char *p;
|
||||
SIV_BLOCK t, q;
|
||||
int i;
|
||||
int ret = 0;
|
||||
int final_ret_value = -1;
|
||||
|
||||
/* can only do one crypto operation */
|
||||
if (ctx->crypto_ok == 0)
|
||||
return 0;
|
||||
goto end;
|
||||
ctx->crypto_ok--;
|
||||
|
||||
memcpy(&q, ctx->tag.byte, SIV_LEN);
|
||||
@@ -317,7 +325,7 @@ int ossl_siv128_decrypt(SIV128_CONTEXT *ctx,
|
||||
|
||||
if (!siv128_do_encrypt(ctx->cipher_ctx, out, in, len, &q)
|
||||
|| !siv128_do_s2v_p(ctx, &t, out, len))
|
||||
return 0;
|
||||
goto end;
|
||||
|
||||
p = ctx->tag.byte;
|
||||
for (i = 0; i < SIV_LEN; i++)
|
||||
@@ -325,10 +333,13 @@ int ossl_siv128_decrypt(SIV128_CONTEXT *ctx,
|
||||
|
||||
if ((t.word[0] | t.word[1]) != 0) {
|
||||
OPENSSL_cleanse(out, len);
|
||||
return 0;
|
||||
goto end;
|
||||
}
|
||||
ctx->final_ret = 0;
|
||||
return 1;
|
||||
ret = 1;
|
||||
final_ret_value = 0;
|
||||
end:
|
||||
ctx->final_ret = final_ret_value;
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2001-2021 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 2001-2026 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
|
||||
@@ -310,7 +310,7 @@ int OCSP_resp_find_status(OCSP_BASICRESP *bs, OCSP_CERTID *id, int *status,
|
||||
int OCSP_check_validity(ASN1_GENERALIZEDTIME *thisupd,
|
||||
ASN1_GENERALIZEDTIME *nextupd, long nsec, long maxsec)
|
||||
{
|
||||
int ret = 1;
|
||||
int ret = 1, cmp;
|
||||
time_t t_now, t_tmp;
|
||||
|
||||
time(&t_now);
|
||||
@@ -320,16 +320,20 @@ int OCSP_check_validity(ASN1_GENERALIZEDTIME *thisupd,
|
||||
ret = 0;
|
||||
} else {
|
||||
t_tmp = t_now + nsec;
|
||||
if (X509_cmp_time(thisupd, &t_tmp) > 0) {
|
||||
cmp = X509_cmp_time(thisupd, &t_tmp);
|
||||
if (cmp == 0) {
|
||||
ERR_raise(ERR_LIB_OCSP, OCSP_R_ERROR_IN_THISUPDATE_FIELD);
|
||||
ret = 0;
|
||||
} else if (cmp > 0) {
|
||||
ERR_raise(ERR_LIB_OCSP, OCSP_R_STATUS_NOT_YET_VALID);
|
||||
ret = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* If maxsec specified check thisUpdate is not more than maxsec in
|
||||
* the past
|
||||
* the past. Skip this check if thisUpdate could not be compared above.
|
||||
*/
|
||||
if (maxsec >= 0) {
|
||||
if (cmp != 0 && maxsec >= 0) {
|
||||
t_tmp = t_now - maxsec;
|
||||
if (X509_cmp_time(thisupd, &t_tmp) < 0) {
|
||||
ERR_raise(ERR_LIB_OCSP, OCSP_R_STATUS_TOO_OLD);
|
||||
@@ -347,7 +351,11 @@ int OCSP_check_validity(ASN1_GENERALIZEDTIME *thisupd,
|
||||
ret = 0;
|
||||
} else {
|
||||
t_tmp = t_now - nsec;
|
||||
if (X509_cmp_time(nextupd, &t_tmp) < 0) {
|
||||
cmp = X509_cmp_time(nextupd, &t_tmp);
|
||||
if (cmp == 0) {
|
||||
ERR_raise(ERR_LIB_OCSP, OCSP_R_ERROR_IN_NEXTUPDATE_FIELD);
|
||||
ret = 0;
|
||||
} else if (cmp < 0) {
|
||||
ERR_raise(ERR_LIB_OCSP, OCSP_R_STATUS_EXPIRED);
|
||||
ret = 0;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2019-2025 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
@@ -64,7 +64,7 @@ typedef struct {
|
||||
|
||||
struct ossl_method_store_st {
|
||||
OSSL_LIB_CTX *ctx;
|
||||
SPARSE_ARRAY_OF(ALGORITHM) * algs;
|
||||
SPARSE_ARRAY_OF(ALGORITHM) *algs;
|
||||
/*
|
||||
* Lock to protect the |algs| array from concurrent writing, when
|
||||
* individual implementations or queries are inserted. This is used
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2019-2025 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 2019-2026 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
|
||||
@@ -1668,10 +1668,10 @@ int OSSL_PROVIDER_available(OSSL_LIB_CTX *libctx, const char *name)
|
||||
|
||||
prov = ossl_provider_find(libctx, name, 0);
|
||||
if (prov != NULL) {
|
||||
if (!CRYPTO_THREAD_read_lock(prov->flag_lock))
|
||||
return 0;
|
||||
available = prov->flag_activated;
|
||||
CRYPTO_THREAD_unlock(prov->flag_lock);
|
||||
if (CRYPTO_THREAD_read_lock(prov->flag_lock)) {
|
||||
available = prov->flag_activated;
|
||||
CRYPTO_THREAD_unlock(prov->flag_lock);
|
||||
}
|
||||
ossl_provider_free(prov);
|
||||
}
|
||||
return available;
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
LIBS=../../libcrypto
|
||||
SOURCE[../../libcrypto]=\
|
||||
rbtree.c
|
||||
@@ -0,0 +1,561 @@
|
||||
/*
|
||||
* Copyright 2026 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright (c) 2016 David Gwynne <david@gwynne.id.au>
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
/*
|
||||
* The code here comes from David Gwynne <david@gwynne.id.au>. The original
|
||||
* version can be found:
|
||||
* https://github.com/dgwynne/data-structures/
|
||||
* file bst.h. The same code is also part of OpenBSD OS where it is shipped
|
||||
* under BSD license.
|
||||
*
|
||||
* David Gwynne agrees to include modified version to OpenSSL and ship it
|
||||
* under OpenSSL Apache 2.0 license.
|
||||
*/
|
||||
|
||||
#include "internal/ossl_rbtree.h"
|
||||
|
||||
#ifndef NDEBUG
|
||||
#include <assert.h>
|
||||
#endif
|
||||
|
||||
#define OSSL_RBT_BLACK 0
|
||||
#define OSSL_RBT_RED 1
|
||||
|
||||
static struct ossl_rbt_entry *
|
||||
rbt_n2e(const struct ossl_rbt_type *t, void *node)
|
||||
{
|
||||
uintptr_t addr = (uintptr_t)node;
|
||||
|
||||
return (struct ossl_rbt_entry *)(addr + t->t_offset);
|
||||
}
|
||||
|
||||
static void *
|
||||
rbt_e2n(const struct ossl_rbt_type *t, struct ossl_rbt_entry *rbe)
|
||||
{
|
||||
uintptr_t addr = (uintptr_t)rbe;
|
||||
|
||||
return (void *)(addr - t->t_offset);
|
||||
}
|
||||
|
||||
#define OSSL_RBE_LEFT(_rbe) (_rbe)->rb_left
|
||||
#define OSSL_RBE_RIGHT(_rbe) (_rbe)->rb_right
|
||||
#define OSSL_RBE_PARENT(_rbe) (_rbe)->rb_parent
|
||||
#define OSSL_RBE_COLOR(_rbe) (_rbe)->rb_color
|
||||
|
||||
#define OSSL_RBH_ROOT(_rbt) (_rbt)->rb_root
|
||||
|
||||
static void
|
||||
rbe_set(struct ossl_rbt_entry *rbe, struct ossl_rbt_entry *parent)
|
||||
{
|
||||
OSSL_RBE_PARENT(rbe) = parent;
|
||||
OSSL_RBE_LEFT(rbe) = OSSL_RBE_RIGHT(rbe) = NULL;
|
||||
OSSL_RBE_COLOR(rbe) = OSSL_RBT_RED;
|
||||
}
|
||||
|
||||
static void
|
||||
rbe_set_blackred(struct ossl_rbt_entry *black, struct ossl_rbt_entry *red)
|
||||
{
|
||||
OSSL_RBE_COLOR(black) = OSSL_RBT_BLACK;
|
||||
OSSL_RBE_COLOR(red) = OSSL_RBT_RED;
|
||||
}
|
||||
|
||||
static void
|
||||
rbe_rotate_left(struct ossl_rbt_tree *rbt, struct ossl_rbt_entry *rbe)
|
||||
{
|
||||
struct ossl_rbt_entry *parent;
|
||||
struct ossl_rbt_entry *tmp;
|
||||
|
||||
tmp = OSSL_RBE_RIGHT(rbe);
|
||||
OSSL_RBE_RIGHT(rbe) = OSSL_RBE_LEFT(tmp);
|
||||
if (OSSL_RBE_RIGHT(rbe) != NULL)
|
||||
OSSL_RBE_PARENT(OSSL_RBE_LEFT(tmp)) = rbe;
|
||||
|
||||
parent = OSSL_RBE_PARENT(rbe);
|
||||
OSSL_RBE_PARENT(tmp) = parent;
|
||||
if (parent != NULL) {
|
||||
if (rbe == OSSL_RBE_LEFT(parent))
|
||||
OSSL_RBE_LEFT(parent) = tmp;
|
||||
else
|
||||
OSSL_RBE_RIGHT(parent) = tmp;
|
||||
} else
|
||||
OSSL_RBH_ROOT(rbt) = tmp;
|
||||
|
||||
OSSL_RBE_LEFT(tmp) = rbe;
|
||||
OSSL_RBE_PARENT(rbe) = tmp;
|
||||
}
|
||||
|
||||
static void
|
||||
rbe_rotate_right(struct ossl_rbt_tree *rbt, struct ossl_rbt_entry *rbe)
|
||||
{
|
||||
struct ossl_rbt_entry *parent;
|
||||
struct ossl_rbt_entry *tmp;
|
||||
|
||||
tmp = OSSL_RBE_LEFT(rbe);
|
||||
OSSL_RBE_LEFT(rbe) = OSSL_RBE_RIGHT(tmp);
|
||||
if (OSSL_RBE_LEFT(rbe) != NULL)
|
||||
OSSL_RBE_PARENT(OSSL_RBE_RIGHT(tmp)) = rbe;
|
||||
|
||||
parent = OSSL_RBE_PARENT(rbe);
|
||||
OSSL_RBE_PARENT(tmp) = parent;
|
||||
if (parent != NULL) {
|
||||
if (rbe == OSSL_RBE_LEFT(parent))
|
||||
OSSL_RBE_LEFT(parent) = tmp;
|
||||
else
|
||||
OSSL_RBE_RIGHT(parent) = tmp;
|
||||
} else
|
||||
OSSL_RBH_ROOT(rbt) = tmp;
|
||||
|
||||
OSSL_RBE_RIGHT(tmp) = rbe;
|
||||
OSSL_RBE_PARENT(rbe) = tmp;
|
||||
}
|
||||
|
||||
static void
|
||||
rbe_insert_color(struct ossl_rbt_tree *rbt, struct ossl_rbt_entry *rbe)
|
||||
{
|
||||
struct ossl_rbt_entry *parent, *gparent, *tmp;
|
||||
|
||||
while ((parent = OSSL_RBE_PARENT(rbe)) != NULL && OSSL_RBE_COLOR(parent) == OSSL_RBT_RED) {
|
||||
gparent = OSSL_RBE_PARENT(parent);
|
||||
|
||||
if (parent == OSSL_RBE_LEFT(gparent)) {
|
||||
tmp = OSSL_RBE_RIGHT(gparent);
|
||||
if (tmp != NULL && OSSL_RBE_COLOR(tmp) == OSSL_RBT_RED) {
|
||||
OSSL_RBE_COLOR(tmp) = OSSL_RBT_BLACK;
|
||||
rbe_set_blackred(parent, gparent);
|
||||
rbe = gparent;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (OSSL_RBE_RIGHT(parent) == rbe) {
|
||||
rbe_rotate_left(rbt, parent);
|
||||
tmp = parent;
|
||||
parent = rbe;
|
||||
rbe = tmp;
|
||||
}
|
||||
|
||||
rbe_set_blackred(parent, gparent);
|
||||
rbe_rotate_right(rbt, gparent);
|
||||
} else {
|
||||
tmp = OSSL_RBE_LEFT(gparent);
|
||||
if (tmp != NULL && OSSL_RBE_COLOR(tmp) == OSSL_RBT_RED) {
|
||||
OSSL_RBE_COLOR(tmp) = OSSL_RBT_BLACK;
|
||||
rbe_set_blackred(parent, gparent);
|
||||
rbe = gparent;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (OSSL_RBE_LEFT(parent) == rbe) {
|
||||
rbe_rotate_right(rbt, parent);
|
||||
tmp = parent;
|
||||
parent = rbe;
|
||||
rbe = tmp;
|
||||
}
|
||||
|
||||
rbe_set_blackred(parent, gparent);
|
||||
rbe_rotate_left(rbt, gparent);
|
||||
}
|
||||
}
|
||||
|
||||
OSSL_RBE_COLOR(OSSL_RBH_ROOT(rbt)) = OSSL_RBT_BLACK;
|
||||
}
|
||||
|
||||
static void
|
||||
rbe_remove_color(struct ossl_rbt_tree *rbt,
|
||||
struct ossl_rbt_entry *parent, struct ossl_rbt_entry *rbe)
|
||||
{
|
||||
struct ossl_rbt_entry *tmp;
|
||||
|
||||
while ((rbe == NULL || OSSL_RBE_COLOR(rbe) == OSSL_RBT_BLACK) && rbe != OSSL_RBH_ROOT(rbt)) {
|
||||
if (OSSL_RBE_LEFT(parent) == rbe) {
|
||||
tmp = OSSL_RBE_RIGHT(parent);
|
||||
if (OSSL_RBE_COLOR(tmp) == OSSL_RBT_RED) {
|
||||
rbe_set_blackred(tmp, parent);
|
||||
rbe_rotate_left(rbt, parent);
|
||||
tmp = OSSL_RBE_RIGHT(parent);
|
||||
}
|
||||
if ((OSSL_RBE_LEFT(tmp) == NULL || OSSL_RBE_COLOR(OSSL_RBE_LEFT(tmp)) == OSSL_RBT_BLACK) && (OSSL_RBE_RIGHT(tmp) == NULL || OSSL_RBE_COLOR(OSSL_RBE_RIGHT(tmp)) == OSSL_RBT_BLACK)) {
|
||||
OSSL_RBE_COLOR(tmp) = OSSL_RBT_RED;
|
||||
rbe = parent;
|
||||
parent = OSSL_RBE_PARENT(rbe);
|
||||
} else {
|
||||
if (OSSL_RBE_RIGHT(tmp) == NULL || OSSL_RBE_COLOR(OSSL_RBE_RIGHT(tmp)) == OSSL_RBT_BLACK) {
|
||||
struct ossl_rbt_entry *oleft;
|
||||
|
||||
oleft = OSSL_RBE_LEFT(tmp);
|
||||
if (oleft != NULL)
|
||||
OSSL_RBE_COLOR(oleft) = OSSL_RBT_BLACK;
|
||||
|
||||
OSSL_RBE_COLOR(tmp) = OSSL_RBT_RED;
|
||||
rbe_rotate_right(rbt, tmp);
|
||||
tmp = OSSL_RBE_RIGHT(parent);
|
||||
}
|
||||
|
||||
OSSL_RBE_COLOR(tmp) = OSSL_RBE_COLOR(parent);
|
||||
OSSL_RBE_COLOR(parent) = OSSL_RBT_BLACK;
|
||||
if (OSSL_RBE_RIGHT(tmp))
|
||||
OSSL_RBE_COLOR(OSSL_RBE_RIGHT(tmp)) = OSSL_RBT_BLACK;
|
||||
|
||||
rbe_rotate_left(rbt, parent);
|
||||
rbe = OSSL_RBH_ROOT(rbt);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
tmp = OSSL_RBE_LEFT(parent);
|
||||
if (OSSL_RBE_COLOR(tmp) == OSSL_RBT_RED) {
|
||||
rbe_set_blackred(tmp, parent);
|
||||
rbe_rotate_right(rbt, parent);
|
||||
tmp = OSSL_RBE_LEFT(parent);
|
||||
}
|
||||
|
||||
if ((OSSL_RBE_LEFT(tmp) == NULL || OSSL_RBE_COLOR(OSSL_RBE_LEFT(tmp)) == OSSL_RBT_BLACK) && (OSSL_RBE_RIGHT(tmp) == NULL || OSSL_RBE_COLOR(OSSL_RBE_RIGHT(tmp)) == OSSL_RBT_BLACK)) {
|
||||
OSSL_RBE_COLOR(tmp) = OSSL_RBT_RED;
|
||||
rbe = parent;
|
||||
parent = OSSL_RBE_PARENT(rbe);
|
||||
} else {
|
||||
if (OSSL_RBE_LEFT(tmp) == NULL || OSSL_RBE_COLOR(OSSL_RBE_LEFT(tmp)) == OSSL_RBT_BLACK) {
|
||||
struct ossl_rbt_entry *oright;
|
||||
|
||||
oright = OSSL_RBE_RIGHT(tmp);
|
||||
if (oright != NULL)
|
||||
OSSL_RBE_COLOR(oright) = OSSL_RBT_BLACK;
|
||||
|
||||
OSSL_RBE_COLOR(tmp) = OSSL_RBT_RED;
|
||||
rbe_rotate_left(rbt, tmp);
|
||||
tmp = OSSL_RBE_LEFT(parent);
|
||||
}
|
||||
|
||||
OSSL_RBE_COLOR(tmp) = OSSL_RBE_COLOR(parent);
|
||||
OSSL_RBE_COLOR(parent) = OSSL_RBT_BLACK;
|
||||
if (OSSL_RBE_LEFT(tmp) != NULL)
|
||||
OSSL_RBE_COLOR(OSSL_RBE_LEFT(tmp)) = OSSL_RBT_BLACK;
|
||||
|
||||
rbe_rotate_right(rbt, parent);
|
||||
rbe = OSSL_RBH_ROOT(rbt);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (rbe != NULL)
|
||||
OSSL_RBE_COLOR(rbe) = OSSL_RBT_BLACK;
|
||||
}
|
||||
|
||||
static struct ossl_rbt_entry *
|
||||
rbe_remove(struct ossl_rbt_tree *rbt, struct ossl_rbt_entry *rbe)
|
||||
{
|
||||
struct ossl_rbt_entry *child, *parent, *old = rbe;
|
||||
unsigned int color;
|
||||
|
||||
if (OSSL_RBE_LEFT(rbe) == NULL)
|
||||
child = OSSL_RBE_RIGHT(rbe);
|
||||
else if (OSSL_RBE_RIGHT(rbe) == NULL)
|
||||
child = OSSL_RBE_LEFT(rbe);
|
||||
else {
|
||||
struct ossl_rbt_entry *tmp;
|
||||
|
||||
rbe = OSSL_RBE_RIGHT(rbe);
|
||||
while ((tmp = OSSL_RBE_LEFT(rbe)) != NULL)
|
||||
rbe = tmp;
|
||||
|
||||
child = OSSL_RBE_RIGHT(rbe);
|
||||
parent = OSSL_RBE_PARENT(rbe);
|
||||
color = OSSL_RBE_COLOR(rbe);
|
||||
if (child != NULL)
|
||||
OSSL_RBE_PARENT(child) = parent;
|
||||
if (parent != NULL) {
|
||||
if (OSSL_RBE_LEFT(parent) == rbe)
|
||||
OSSL_RBE_LEFT(parent) = child;
|
||||
else
|
||||
OSSL_RBE_RIGHT(parent) = child;
|
||||
} else
|
||||
OSSL_RBH_ROOT(rbt) = child;
|
||||
if (OSSL_RBE_PARENT(rbe) == old)
|
||||
parent = rbe;
|
||||
*rbe = *old;
|
||||
|
||||
tmp = OSSL_RBE_PARENT(old);
|
||||
if (tmp != NULL) {
|
||||
if (OSSL_RBE_LEFT(tmp) == old)
|
||||
OSSL_RBE_LEFT(tmp) = rbe;
|
||||
else
|
||||
OSSL_RBE_RIGHT(tmp) = rbe;
|
||||
} else
|
||||
OSSL_RBH_ROOT(rbt) = rbe;
|
||||
|
||||
OSSL_RBE_PARENT(OSSL_RBE_LEFT(old)) = rbe;
|
||||
if (OSSL_RBE_RIGHT(old))
|
||||
OSSL_RBE_PARENT(OSSL_RBE_RIGHT(old)) = rbe;
|
||||
goto color;
|
||||
}
|
||||
|
||||
parent = OSSL_RBE_PARENT(rbe);
|
||||
color = OSSL_RBE_COLOR(rbe);
|
||||
|
||||
if (child != NULL)
|
||||
OSSL_RBE_PARENT(child) = parent;
|
||||
if (parent != NULL) {
|
||||
if (OSSL_RBE_LEFT(parent) == rbe)
|
||||
OSSL_RBE_LEFT(parent) = child;
|
||||
else
|
||||
OSSL_RBE_RIGHT(parent) = child;
|
||||
} else
|
||||
OSSL_RBH_ROOT(rbt) = child;
|
||||
color:
|
||||
if (color == OSSL_RBT_BLACK)
|
||||
rbe_remove_color(rbt, parent, child);
|
||||
|
||||
#ifndef NDEBUG
|
||||
if (old != NULL) {
|
||||
OSSL_RBE_PARENT(old) = NULL;
|
||||
OSSL_RBE_LEFT(old) = NULL;
|
||||
OSSL_RBE_RIGHT(old) = NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
return old;
|
||||
}
|
||||
|
||||
void *
|
||||
ossl_rbt_remove(const struct ossl_rbt_type *t, struct ossl_rbt_tree *rbt, void *elm)
|
||||
{
|
||||
struct ossl_rbt_entry *rbe = rbt_n2e(t, elm);
|
||||
struct ossl_rbt_entry *old;
|
||||
|
||||
old = rbe_remove(rbt, rbe);
|
||||
|
||||
return old == NULL ? NULL : rbt_e2n(t, old);
|
||||
}
|
||||
|
||||
void *
|
||||
ossl_rbt_insert(const struct ossl_rbt_type *t, struct ossl_rbt_tree *rbt, void *elm)
|
||||
{
|
||||
struct ossl_rbt_entry *rbe = rbt_n2e(t, elm);
|
||||
struct ossl_rbt_entry *tmp;
|
||||
struct ossl_rbt_entry *parent = NULL;
|
||||
void *node;
|
||||
int comp = 0;
|
||||
|
||||
#ifndef NDEBUG
|
||||
assert(rbe->rb_parent == NULL);
|
||||
assert(rbe->rb_left == NULL);
|
||||
assert(rbe->rb_right == NULL);
|
||||
#endif
|
||||
|
||||
tmp = OSSL_RBH_ROOT(rbt);
|
||||
while (tmp != NULL) {
|
||||
parent = tmp;
|
||||
|
||||
node = rbt_e2n(t, tmp);
|
||||
comp = (*t->t_compare)(elm, node);
|
||||
if (comp < 0)
|
||||
tmp = OSSL_RBE_LEFT(tmp);
|
||||
else if (comp > 0)
|
||||
tmp = OSSL_RBE_RIGHT(tmp);
|
||||
else
|
||||
return node;
|
||||
}
|
||||
|
||||
rbe_set(rbe, parent);
|
||||
|
||||
if (parent != NULL) {
|
||||
if (comp < 0)
|
||||
OSSL_RBE_LEFT(parent) = rbe;
|
||||
else
|
||||
OSSL_RBE_RIGHT(parent) = rbe;
|
||||
} else
|
||||
OSSL_RBH_ROOT(rbt) = rbe;
|
||||
|
||||
rbe_insert_color(rbt, rbe);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Finds the node with the same key as elm */
|
||||
void *
|
||||
ossl_rbt_find(const struct ossl_rbt_type *t, struct ossl_rbt_tree *rbt, const void *key)
|
||||
{
|
||||
struct ossl_rbt_entry *tmp = OSSL_RBH_ROOT(rbt);
|
||||
void *node;
|
||||
int comp;
|
||||
|
||||
while (tmp != NULL) {
|
||||
node = rbt_e2n(t, tmp);
|
||||
comp = (*t->t_compare)(key, node);
|
||||
if (comp < 0)
|
||||
tmp = OSSL_RBE_LEFT(tmp);
|
||||
else if (comp > 0)
|
||||
tmp = OSSL_RBE_RIGHT(tmp);
|
||||
else
|
||||
return node;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Finds the first node greater than or equal to the search key */
|
||||
void *
|
||||
ossl_rbt_nfind(const struct ossl_rbt_type *t, struct ossl_rbt_tree *rbt, const void *key)
|
||||
{
|
||||
struct ossl_rbt_entry *tmp = OSSL_RBH_ROOT(rbt);
|
||||
void *node;
|
||||
void *res = NULL;
|
||||
int comp;
|
||||
|
||||
while (tmp != NULL) {
|
||||
node = rbt_e2n(t, tmp);
|
||||
comp = (*t->t_compare)(key, node);
|
||||
if (comp < 0) {
|
||||
res = node;
|
||||
tmp = OSSL_RBE_LEFT(tmp);
|
||||
} else if (comp > 0)
|
||||
tmp = OSSL_RBE_RIGHT(tmp);
|
||||
else
|
||||
return node;
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
void *
|
||||
ossl_rbt_next(const struct ossl_rbt_type *t, void *elm)
|
||||
{
|
||||
struct ossl_rbt_entry *rbe = rbt_n2e(t, elm);
|
||||
|
||||
if (OSSL_RBE_RIGHT(rbe) != NULL) {
|
||||
rbe = OSSL_RBE_RIGHT(rbe);
|
||||
while (OSSL_RBE_LEFT(rbe) != NULL)
|
||||
rbe = OSSL_RBE_LEFT(rbe);
|
||||
} else {
|
||||
if (OSSL_RBE_PARENT(rbe) && (rbe == OSSL_RBE_LEFT(OSSL_RBE_PARENT(rbe))))
|
||||
rbe = OSSL_RBE_PARENT(rbe);
|
||||
else {
|
||||
while (OSSL_RBE_PARENT(rbe) && (rbe == OSSL_RBE_RIGHT(OSSL_RBE_PARENT(rbe))))
|
||||
rbe = OSSL_RBE_PARENT(rbe);
|
||||
rbe = OSSL_RBE_PARENT(rbe);
|
||||
}
|
||||
}
|
||||
|
||||
return rbe == NULL ? NULL : rbt_e2n(t, rbe);
|
||||
}
|
||||
|
||||
void *
|
||||
ossl_rbt_prev(const struct ossl_rbt_type *t, void *elm)
|
||||
{
|
||||
struct ossl_rbt_entry *rbe = rbt_n2e(t, elm);
|
||||
|
||||
if (OSSL_RBE_LEFT(rbe)) {
|
||||
rbe = OSSL_RBE_LEFT(rbe);
|
||||
while (OSSL_RBE_RIGHT(rbe))
|
||||
rbe = OSSL_RBE_RIGHT(rbe);
|
||||
} else {
|
||||
if (OSSL_RBE_PARENT(rbe) && (rbe == OSSL_RBE_RIGHT(OSSL_RBE_PARENT(rbe))))
|
||||
rbe = OSSL_RBE_PARENT(rbe);
|
||||
else {
|
||||
while (OSSL_RBE_PARENT(rbe) && (rbe == OSSL_RBE_LEFT(OSSL_RBE_PARENT(rbe))))
|
||||
rbe = OSSL_RBE_PARENT(rbe);
|
||||
rbe = OSSL_RBE_PARENT(rbe);
|
||||
}
|
||||
}
|
||||
|
||||
return rbe == NULL ? NULL : rbt_e2n(t, rbe);
|
||||
}
|
||||
|
||||
void *
|
||||
ossl_rbt_root(const struct ossl_rbt_type *t, struct ossl_rbt_tree *rbt)
|
||||
{
|
||||
struct ossl_rbt_entry *rbe = OSSL_RBH_ROOT(rbt);
|
||||
|
||||
return rbe == NULL ? rbe : rbt_e2n(t, rbe);
|
||||
}
|
||||
|
||||
void *
|
||||
ossl_rbt_min(const struct ossl_rbt_type *t, struct ossl_rbt_tree *rbt)
|
||||
{
|
||||
struct ossl_rbt_entry *rbe = OSSL_RBH_ROOT(rbt);
|
||||
struct ossl_rbt_entry *parent = NULL;
|
||||
|
||||
while (rbe != NULL) {
|
||||
parent = rbe;
|
||||
rbe = OSSL_RBE_LEFT(rbe);
|
||||
}
|
||||
|
||||
return parent == NULL ? NULL : rbt_e2n(t, parent);
|
||||
}
|
||||
|
||||
void *
|
||||
ossl_rbt_max(const struct ossl_rbt_type *t, struct ossl_rbt_tree *rbt)
|
||||
{
|
||||
struct ossl_rbt_entry *rbe = OSSL_RBH_ROOT(rbt);
|
||||
struct ossl_rbt_entry *parent = NULL;
|
||||
|
||||
while (rbe != NULL) {
|
||||
parent = rbe;
|
||||
rbe = OSSL_RBE_RIGHT(rbe);
|
||||
}
|
||||
|
||||
return parent == NULL ? NULL : rbt_e2n(t, parent);
|
||||
}
|
||||
|
||||
void *
|
||||
ossl_rbt_left(const struct ossl_rbt_type *t, void *node)
|
||||
{
|
||||
struct ossl_rbt_entry *rbe = rbt_n2e(t, node);
|
||||
rbe = OSSL_RBE_LEFT(rbe);
|
||||
return rbe == NULL ? NULL : rbt_e2n(t, rbe);
|
||||
}
|
||||
|
||||
void *
|
||||
ossl_rbt_right(const struct ossl_rbt_type *t, void *node)
|
||||
{
|
||||
struct ossl_rbt_entry *rbe = rbt_n2e(t, node);
|
||||
rbe = OSSL_RBE_RIGHT(rbe);
|
||||
return rbe == NULL ? NULL : rbt_e2n(t, rbe);
|
||||
}
|
||||
|
||||
void *
|
||||
ossl_rbt_parent(const struct ossl_rbt_type *t, void *node)
|
||||
{
|
||||
struct ossl_rbt_entry *rbe = rbt_n2e(t, node);
|
||||
rbe = OSSL_RBE_PARENT(rbe);
|
||||
return rbe == NULL ? NULL : rbt_e2n(t, rbe);
|
||||
}
|
||||
|
||||
void ossl_rbt_set_left(const struct ossl_rbt_type *t, void *node, void *left)
|
||||
{
|
||||
struct ossl_rbt_entry *rbe = rbt_n2e(t, node);
|
||||
struct ossl_rbt_entry *rbl = (left == NULL) ? NULL : rbt_n2e(t, left);
|
||||
|
||||
OSSL_RBE_LEFT(rbe) = rbl;
|
||||
}
|
||||
|
||||
void ossl_rbt_set_right(const struct ossl_rbt_type *t, void *node, void *right)
|
||||
{
|
||||
struct ossl_rbt_entry *rbe = rbt_n2e(t, node);
|
||||
struct ossl_rbt_entry *rbr = (right == NULL) ? NULL : rbt_n2e(t, right);
|
||||
|
||||
OSSL_RBE_RIGHT(rbe) = rbr;
|
||||
}
|
||||
|
||||
void ossl_rbt_set_parent(const struct ossl_rbt_type *t, void *node, void *parent)
|
||||
{
|
||||
struct ossl_rbt_entry *rbe = rbt_n2e(t, node);
|
||||
struct ossl_rbt_entry *rbp = (parent == NULL) ? NULL : rbt_n2e(t, parent);
|
||||
|
||||
OSSL_RBE_PARENT(rbe) = rbp;
|
||||
}
|
||||
|
||||
void ossl_rbt_init_rbe(const struct ossl_rbt_type *t, void *node)
|
||||
{
|
||||
struct ossl_rbt_entry *rbe = rbt_n2e(t, node);
|
||||
|
||||
OSSL_RBE_PARENT(rbe) = NULL;
|
||||
OSSL_RBE_LEFT(rbe) = NULL;
|
||||
OSSL_RBE_RIGHT(rbe) = NULL;
|
||||
}
|
||||
@@ -14,6 +14,7 @@
|
||||
#include "crypto/sm2.h"
|
||||
#include "crypto/sm2err.h"
|
||||
#include "crypto/ec.h" /* ossl_ec_group_do_inverse_ord() */
|
||||
#include "crypto/bn.h" /* fixed-top / Montgomery constant-time BN helpers */
|
||||
#include "internal/numbers.h"
|
||||
#include <openssl/err.h>
|
||||
#include <openssl/evp.h>
|
||||
@@ -215,17 +216,22 @@ static ECDSA_SIG *sm2_sig_gen(const EC_KEY *key, const BIGNUM *e)
|
||||
EC_POINT *kG = NULL;
|
||||
BN_CTX *ctx = NULL;
|
||||
BIGNUM *k = NULL;
|
||||
BIGNUM *rk = NULL;
|
||||
BIGNUM *r = NULL;
|
||||
BIGNUM *s = NULL;
|
||||
BIGNUM *x1 = NULL;
|
||||
BIGNUM *tmp = NULL;
|
||||
BN_MONT_CTX *mont = EC_GROUP_get_mont_data(group);
|
||||
OSSL_LIB_CTX *libctx = ossl_ec_key_get_libctx(key);
|
||||
|
||||
if (dA == NULL) {
|
||||
ERR_raise(ERR_LIB_SM2, SM2_R_INVALID_PRIVATE_KEY);
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (mont == NULL) {
|
||||
ERR_raise(ERR_LIB_SM2, ERR_R_EC_LIB);
|
||||
goto done;
|
||||
}
|
||||
kG = EC_POINT_new(group);
|
||||
if (kG == NULL) {
|
||||
ERR_raise(ERR_LIB_SM2, ERR_R_EC_LIB);
|
||||
@@ -239,7 +245,6 @@ static ECDSA_SIG *sm2_sig_gen(const EC_KEY *key, const BIGNUM *e)
|
||||
|
||||
BN_CTX_start(ctx);
|
||||
k = BN_CTX_get(ctx);
|
||||
rk = BN_CTX_get(ctx);
|
||||
x1 = BN_CTX_get(ctx);
|
||||
tmp = BN_CTX_get(ctx);
|
||||
if (tmp == NULL) {
|
||||
@@ -273,6 +278,18 @@ static ECDSA_SIG *sm2_sig_gen(const EC_KEY *key, const BIGNUM *e)
|
||||
ERR_raise(ERR_LIB_SM2, ERR_R_INTERNAL_ERROR);
|
||||
goto done;
|
||||
}
|
||||
/*
|
||||
* Pin the nonce to a fixed, value-independent width and flag it
|
||||
* BN_FLG_CONSTTIME, so its magnitude does not leak through operand
|
||||
* lengths in the scalar copy inside the ladder or in the arithmetic
|
||||
* below. BN_priv_rand_range_ex() is kept so the nonce value itself
|
||||
* is unchanged; only its representation is pinned.
|
||||
*/
|
||||
BN_set_flags(k, BN_FLG_CONSTTIME);
|
||||
if (!bn_set_top_fixed(k, bn_get_top(order))) {
|
||||
ERR_raise(ERR_LIB_SM2, ERR_R_BN_LIB);
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (!EC_POINT_mul(group, kG, k, NULL, NULL, ctx)
|
||||
|| !EC_POINT_get_affine_coordinates(group, kG, x1, NULL,
|
||||
@@ -282,23 +299,49 @@ static ECDSA_SIG *sm2_sig_gen(const EC_KEY *key, const BIGNUM *e)
|
||||
goto done;
|
||||
}
|
||||
|
||||
/* try again if r == 0 or r+k == n */
|
||||
/* try again if r == 0 or r + k == n */
|
||||
if (BN_is_zero(r))
|
||||
continue;
|
||||
|
||||
if (!BN_add(rk, r, k)) {
|
||||
ERR_raise(ERR_LIB_SM2, ERR_R_INTERNAL_ERROR);
|
||||
/*
|
||||
* Since 0 < r < n and 0 < k < n, r + k == n is the same as
|
||||
* k == n - r. Both operands of the subtraction are public, so
|
||||
* compute it in the open and then compare against the nonce with a
|
||||
* fixed-width constant-time comparison. A BN_cmp() on r + k would
|
||||
* branch on whether the sum carried into an extra word, which
|
||||
* depends on the value of k.
|
||||
*/
|
||||
if (!BN_sub(tmp, order, r)
|
||||
|| !bn_set_top_fixed(tmp, bn_get_top(order))) {
|
||||
ERR_raise(ERR_LIB_SM2, ERR_R_BN_LIB);
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (BN_cmp(rk, order) == 0)
|
||||
if (CRYPTO_memcmp(bn_get_words(k), bn_get_words(tmp),
|
||||
bn_get_top(order) * sizeof(BN_ULONG))
|
||||
== 0)
|
||||
continue;
|
||||
|
||||
/*
|
||||
* s = ((1 + dA)^-1 * (k - r * dA)) mod order
|
||||
*
|
||||
* Computed with fixed-top / Montgomery constant-time primitives, so
|
||||
* that the running time does not depend on the secret k or dA (the
|
||||
* generic BN_mod_mul()/BN_sub() used previously reduce via BN_div(),
|
||||
* whose timing is value dependent). This mirrors the ECDSA path.
|
||||
*
|
||||
* s holds (1 + dA)^-1 throughout; the (k - r * dA) term is built in
|
||||
* tmp. bn_mul_mont_fixed_top() with one operand in the Montgomery
|
||||
* domain yields the plain product, and the final
|
||||
* BN_mod_mul_montgomery() returns the user-visible, normalised value.
|
||||
*/
|
||||
if (!BN_add(s, dA, BN_value_one())
|
||||
|| !ossl_ec_group_do_inverse_ord(group, s, s, ctx)
|
||||
|| !BN_mod_mul(tmp, dA, r, order, ctx)
|
||||
|| !BN_sub(tmp, k, tmp)
|
||||
|| !BN_mod_mul(s, s, tmp, order, ctx)) {
|
||||
|| !bn_to_mont_fixed_top(tmp, r, mont, ctx)
|
||||
|| !bn_mul_mont_fixed_top(tmp, tmp, dA, mont, ctx)
|
||||
|| !bn_mod_sub_fixed_top(tmp, k, tmp, order)
|
||||
|| !bn_to_mont_fixed_top(tmp, tmp, mont, ctx)
|
||||
|| !BN_mod_mul_montgomery(s, tmp, s, mont, ctx)) {
|
||||
ERR_raise(ERR_LIB_SM2, ERR_R_BN_LIB);
|
||||
goto done;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 1999-2021 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 1999-2026 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
|
||||
@@ -58,7 +58,14 @@ static X509_EXTENSION *X509V3_EXT_nconf_int(CONF *conf, X509V3_CTX *ctx,
|
||||
X509_EXTENSION *X509V3_EXT_nconf(CONF *conf, X509V3_CTX *ctx, const char *name,
|
||||
const char *value)
|
||||
{
|
||||
return X509V3_EXT_nconf_int(conf, ctx, NULL, name, value);
|
||||
X509V3_CTX tmpctx;
|
||||
|
||||
if (ctx == NULL) {
|
||||
X509V3_set_ctx(&tmpctx, NULL, NULL, NULL, NULL, 0);
|
||||
X509V3_set_nconf(&tmpctx, conf);
|
||||
}
|
||||
|
||||
return X509V3_EXT_nconf_int(conf, ctx ? ctx : &tmpctx, NULL, name, value);
|
||||
}
|
||||
|
||||
X509_EXTENSION *X509V3_EXT_nconf_nid(CONF *conf, X509V3_CTX *ctx, int ext_nid,
|
||||
@@ -66,12 +73,18 @@ X509_EXTENSION *X509V3_EXT_nconf_nid(CONF *conf, X509V3_CTX *ctx, int ext_nid,
|
||||
{
|
||||
int crit;
|
||||
int ext_type;
|
||||
X509V3_CTX tmpctx;
|
||||
|
||||
if (ctx == NULL) {
|
||||
X509V3_set_ctx(&tmpctx, NULL, NULL, NULL, NULL, 0);
|
||||
X509V3_set_nconf(&tmpctx, conf);
|
||||
}
|
||||
|
||||
crit = v3_check_critical(&value);
|
||||
if ((ext_type = v3_check_generic(&value)))
|
||||
return v3_generic_extension(OBJ_nid2sn(ext_nid),
|
||||
value, crit, ext_type, ctx);
|
||||
return do_ext_nconf(conf, ctx, ext_nid, crit, value);
|
||||
value, crit, ext_type, ctx ? ctx : &tmpctx);
|
||||
return do_ext_nconf(conf, ctx ? ctx : &tmpctx, ext_nid, crit, value);
|
||||
}
|
||||
|
||||
/* CONF *conf: Config file */
|
||||
@@ -313,6 +326,13 @@ int X509V3_EXT_add_nconf_sk(CONF *conf, X509V3_CTX *ctx, const char *section,
|
||||
STACK_OF(CONF_VALUE) *nval;
|
||||
const CONF_VALUE *val;
|
||||
int i, akid = -1, skid = -1;
|
||||
X509V3_CTX tmpctx;
|
||||
|
||||
if (ctx == NULL) {
|
||||
X509V3_set_ctx(&tmpctx, NULL, NULL, NULL, NULL, 0);
|
||||
X509V3_set_nconf(&tmpctx, conf);
|
||||
ctx = &tmpctx;
|
||||
}
|
||||
|
||||
if ((nval = NCONF_get_section(conf, section)) == NULL)
|
||||
return 0;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 1999-2025 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 1999-2026 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
|
||||
@@ -522,33 +522,43 @@ static int i2r_object(const X509V3_EXT_METHOD *method, void *oid, BIO *bp,
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Append any nameRelativeToCRLIssuer in dpn to iname, set in dpn->dpname */
|
||||
int DIST_POINT_set_dpname(DIST_POINT_NAME *dpn, const X509_NAME *iname)
|
||||
/*
|
||||
* Return a new X509_NAME consisting of iname with the nameRelativeToCRLIssuer
|
||||
* fragment of dpn appended, with its DER encoding already cached.
|
||||
* dpn must be a relative name (type 1). Returns NULL on error.
|
||||
*/
|
||||
X509_NAME *ossl_dist_point_name_full(const DIST_POINT_NAME *dpn,
|
||||
const X509_NAME *iname)
|
||||
{
|
||||
int i;
|
||||
STACK_OF(X509_NAME_ENTRY) *frag;
|
||||
STACK_OF(X509_NAME_ENTRY) *frag = dpn->name.relativename;
|
||||
X509_NAME_ENTRY *ne;
|
||||
X509_NAME *dpname = X509_NAME_dup(iname);
|
||||
|
||||
if (dpn == NULL || dpn->type != 1)
|
||||
return 1;
|
||||
frag = dpn->name.relativename;
|
||||
X509_NAME_free(dpn->dpname); /* just in case it was already set */
|
||||
dpn->dpname = X509_NAME_dup(iname);
|
||||
if (dpn->dpname == NULL)
|
||||
return 0;
|
||||
if (dpname == NULL)
|
||||
return NULL;
|
||||
for (i = 0; i < sk_X509_NAME_ENTRY_num(frag); i++) {
|
||||
ne = sk_X509_NAME_ENTRY_value(frag, i);
|
||||
if (!X509_NAME_add_entry(dpn->dpname, ne, -1, i ? 0 : 1))
|
||||
if (!X509_NAME_add_entry(dpname, ne, -1, i ? 0 : 1))
|
||||
goto err;
|
||||
}
|
||||
/* generate cached encoding of name */
|
||||
if (i2d_X509_NAME(dpn->dpname, NULL) >= 0)
|
||||
return 1;
|
||||
if (i2d_X509_NAME(dpname, NULL) >= 0)
|
||||
return dpname;
|
||||
|
||||
err:
|
||||
X509_NAME_free(dpn->dpname);
|
||||
dpn->dpname = NULL;
|
||||
return 0;
|
||||
X509_NAME_free(dpname);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Append any nameRelativeToCRLIssuer in dpn to iname, set in dpn->dpname */
|
||||
int DIST_POINT_set_dpname(DIST_POINT_NAME *dpn, const X509_NAME *iname)
|
||||
{
|
||||
if (dpn == NULL || dpn->type != 1)
|
||||
return 1;
|
||||
X509_NAME_free(dpn->dpname); /* just in case it was already set */
|
||||
dpn->dpname = ossl_dist_point_name_full(dpn, iname);
|
||||
return dpn->dpname != NULL;
|
||||
}
|
||||
|
||||
ASN1_SEQUENCE(OSSL_AA_DIST_POINT) = {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 1999-2025 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 1999-2026 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
|
||||
@@ -345,12 +345,17 @@ int X509_supported_extension(X509_EXTENSION *ex)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Returns 1 on success, 0 if x is invalid, -1 on (internal) error. */
|
||||
static int setup_dp(const X509 *x, DIST_POINT *dp)
|
||||
/*
|
||||
* The full name of a nameRelativeToCRLIssuer distribution point is not
|
||||
* computed here. Doing so for every parsed certificate cost an
|
||||
* X509_NAME_dup() of the issuer name per relative distribution point,
|
||||
* which a certificate with many such entries could turn into hundreds of
|
||||
* megabytes of heap on a plain TLS handshake, while the result is only
|
||||
* needed when a CRL is actually being matched against the certificate.
|
||||
* That name is now built on demand in the CRL checking code instead.
|
||||
*/
|
||||
static int setup_dp(DIST_POINT *dp)
|
||||
{
|
||||
const X509_NAME *iname = NULL;
|
||||
int i;
|
||||
|
||||
if (dp->distpoint == NULL && sk_GENERAL_NAME_num(dp->CRLissuer) <= 0) {
|
||||
ERR_raise(ERR_LIB_X509, X509_R_INVALID_DISTPOINT);
|
||||
return 0;
|
||||
@@ -364,30 +369,10 @@ static int setup_dp(const X509 *x, DIST_POINT *dp)
|
||||
} else {
|
||||
dp->dp_reasons = CRLDP_ALL_REASONS;
|
||||
}
|
||||
if (dp->distpoint == NULL || dp->distpoint->type != 1)
|
||||
return 1;
|
||||
|
||||
/* Handle name fragment given by nameRelativeToCRLIssuer */
|
||||
/*
|
||||
* Note that the below way of determining iname is not really compliant
|
||||
* with https://tools.ietf.org/html/rfc5280#section-4.2.1.13
|
||||
* According to it, sk_GENERAL_NAME_num(dp->CRLissuer) MUST be <= 1
|
||||
* and any CRLissuer could be of type different to GEN_DIRNAME.
|
||||
*/
|
||||
for (i = 0; i < sk_GENERAL_NAME_num(dp->CRLissuer); i++) {
|
||||
GENERAL_NAME *gen = sk_GENERAL_NAME_value(dp->CRLissuer, i);
|
||||
|
||||
if (gen->type == GEN_DIRNAME) {
|
||||
iname = gen->d.directoryName;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (iname == NULL)
|
||||
iname = X509_get_issuer_name(x);
|
||||
return DIST_POINT_set_dpname(dp->distpoint, iname) ? 1 : -1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Return 1 on success, 0 if x is invalid, -1 on (internal) error. */
|
||||
/* Return 1 on success, 0 on error. */
|
||||
static int setup_crldp(X509 *x)
|
||||
{
|
||||
int i;
|
||||
@@ -397,10 +382,8 @@ static int setup_crldp(X509 *x)
|
||||
return 0;
|
||||
|
||||
for (i = 0; i < sk_DIST_POINT_num(x->crldp); i++) {
|
||||
int res = setup_dp(x, sk_DIST_POINT_value(x->crldp, i));
|
||||
|
||||
if (res < 1)
|
||||
return res;
|
||||
if (!setup_dp(sk_DIST_POINT_value(x->crldp, i)))
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -1521,16 +1521,59 @@ static int check_crl_chain(X509_STORE_CTX *ctx,
|
||||
return X509_cmp(cert_ta, crl_ta) == 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Return the full name of the certificate CRL distribution point dp, whose
|
||||
* distpoint is a nameRelativeToCRLIssuer fragment: the CRL issuer name with
|
||||
* the fragment appended. The CRL issuer is the directoryName in
|
||||
* dp->CRLissuer if there is one, else the issuer of the certificate.
|
||||
*
|
||||
* The result is a fresh X509_NAME owned by the caller. It is deliberately
|
||||
* not stored in dp->distpoint->dpname: once its extension cache has been
|
||||
* published a certificate is shared between threads without locking, and
|
||||
* computing the name here rather than when the certificate is parsed keeps
|
||||
* a certificate with many relative distribution points from costing a copy
|
||||
* of the issuer name per entry on every parse. Returns NULL on error.
|
||||
*/
|
||||
static X509_NAME *crldp_full_name(const X509 *x, const DIST_POINT *dp)
|
||||
{
|
||||
const X509_NAME *iname = NULL;
|
||||
int i;
|
||||
|
||||
/*
|
||||
* Note that the below way of determining iname is not really compliant
|
||||
* with https://tools.ietf.org/html/rfc5280#section-4.2.1.13
|
||||
* According to it, sk_GENERAL_NAME_num(dp->CRLissuer) MUST be <= 1
|
||||
* and any CRLissuer could be of type different to GEN_DIRNAME.
|
||||
*/
|
||||
for (i = 0; i < sk_GENERAL_NAME_num(dp->CRLissuer); i++) {
|
||||
GENERAL_NAME *gen = sk_GENERAL_NAME_value(dp->CRLissuer, i);
|
||||
|
||||
if (gen->type == GEN_DIRNAME) {
|
||||
iname = gen->d.directoryName;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (iname == NULL)
|
||||
iname = X509_get_issuer_name(x);
|
||||
return ossl_dist_point_name_full(dp->distpoint, iname);
|
||||
}
|
||||
|
||||
/*-
|
||||
* Check for match between two dist point names: three separate cases.
|
||||
* 1. Both are relative names and compare X509_NAME types.
|
||||
* 2. One full, one relative. Compare X509_NAME to GENERAL_NAMES.
|
||||
* 3. Both are full names and compare two GENERAL_NAMES.
|
||||
* 4. One is NULL: automatic match.
|
||||
*
|
||||
* a is the certificate's distribution point name and b the CRL's issuing
|
||||
* distribution point name. When a is a relative name, aname is its full
|
||||
* name as built by crldp_full_name(); a->dpname itself is not consulted.
|
||||
* For b the full name is the cached b->dpname set when the CRL was parsed.
|
||||
*/
|
||||
static int idp_check_dp(DIST_POINT_NAME *a, DIST_POINT_NAME *b)
|
||||
static int idp_check_dp(DIST_POINT_NAME *a, const X509_NAME *aname,
|
||||
DIST_POINT_NAME *b)
|
||||
{
|
||||
X509_NAME *nm = NULL;
|
||||
const X509_NAME *nm = NULL;
|
||||
GENERAL_NAMES *gens = NULL;
|
||||
GENERAL_NAME *gena, *genb;
|
||||
int i, j;
|
||||
@@ -1538,16 +1581,16 @@ static int idp_check_dp(DIST_POINT_NAME *a, DIST_POINT_NAME *b)
|
||||
if (a == NULL || b == NULL)
|
||||
return 1;
|
||||
if (a->type == 1) {
|
||||
if (a->dpname == NULL)
|
||||
if (aname == NULL)
|
||||
return 0;
|
||||
/* Case 1: two X509_NAME */
|
||||
if (b->type == 1) {
|
||||
if (b->dpname == NULL)
|
||||
return 0;
|
||||
return X509_NAME_cmp(a->dpname, b->dpname) == 0;
|
||||
return X509_NAME_cmp(aname, b->dpname) == 0;
|
||||
}
|
||||
/* Case 2: set name and GENERAL_NAMES appropriately */
|
||||
nm = a->dpname;
|
||||
nm = aname;
|
||||
gens = b->name.fullname;
|
||||
} else if (b->type == 1) {
|
||||
if (b->dpname == NULL)
|
||||
@@ -1620,13 +1663,28 @@ static int crl_crldp_check(X509 *x, X509_CRL *crl, int crl_score,
|
||||
*preasons = crl->idp_reasons;
|
||||
for (i = 0; i < sk_DIST_POINT_num(x->crldp); i++) {
|
||||
DIST_POINT *dp = sk_DIST_POINT_value(x->crldp, i);
|
||||
X509_NAME *dpname = NULL;
|
||||
int match;
|
||||
|
||||
if (crldp_check_crlissuer(dp, crl, crl_score)) {
|
||||
if (crl->idp == NULL
|
||||
|| idp_check_dp(dp->distpoint, crl->idp->distpoint)) {
|
||||
*preasons &= dp->dp_reasons;
|
||||
return 1;
|
||||
}
|
||||
if (!crldp_check_crlissuer(dp, crl, crl_score))
|
||||
continue;
|
||||
if (crl->idp == NULL) {
|
||||
match = 1;
|
||||
} else {
|
||||
/*
|
||||
* A relative distribution point name is only comparable in
|
||||
* full form. Build it for this one comparison and discard it;
|
||||
* if that fails the entry simply does not match.
|
||||
*/
|
||||
if (dp->distpoint != NULL && dp->distpoint->type == 1
|
||||
&& (dpname = crldp_full_name(x, dp)) == NULL)
|
||||
continue;
|
||||
match = idp_check_dp(dp->distpoint, dpname, crl->idp->distpoint);
|
||||
X509_NAME_free(dpname);
|
||||
}
|
||||
if (match) {
|
||||
*preasons &= dp->dp_reasons;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return (crl->idp == NULL || crl->idp->distpoint == NULL)
|
||||
|
||||
@@ -2911,6 +2911,10 @@ DEPEND[html/man3/UI_new.html]=man3/UI_new.pod
|
||||
GENERATE[html/man3/UI_new.html]=man3/UI_new.pod
|
||||
DEPEND[man/man3/UI_new.3]=man3/UI_new.pod
|
||||
GENERATE[man/man3/UI_new.3]=man3/UI_new.pod
|
||||
DEPEND[html/man3/X509V3_EXT_nconf_nid.html]=man3/X509V3_EXT_nconf_nid.pod
|
||||
GENERATE[html/man3/X509V3_EXT_nconf_nid.html]=man3/X509V3_EXT_nconf_nid.pod
|
||||
DEPEND[man/man3/X509V3_EXT_nconf_nid.3]=man3/X509V3_EXT_nconf_nid.pod
|
||||
GENERATE[man/man3/X509V3_EXT_nconf_nid.3]=man3/X509V3_EXT_nconf_nid.pod
|
||||
DEPEND[html/man3/X509V3_EXT_print.html]=man3/X509V3_EXT_print.pod
|
||||
GENERATE[html/man3/X509V3_EXT_print.html]=man3/X509V3_EXT_print.pod
|
||||
DEPEND[man/man3/X509V3_EXT_print.3]=man3/X509V3_EXT_print.pod
|
||||
@@ -3801,6 +3805,7 @@ html/man3/UI_STRING.html \
|
||||
html/man3/UI_UTIL_read_pw.html \
|
||||
html/man3/UI_create_method.html \
|
||||
html/man3/UI_new.html \
|
||||
html/man3/X509V3_EXT_nconf_nid.html \
|
||||
html/man3/X509V3_EXT_print.html \
|
||||
html/man3/X509V3_get_d2i.html \
|
||||
html/man3/X509V3_set_ctx.html \
|
||||
@@ -4480,6 +4485,7 @@ man/man3/UI_STRING.3 \
|
||||
man/man3/UI_UTIL_read_pw.3 \
|
||||
man/man3/UI_create_method.3 \
|
||||
man/man3/UI_new.3 \
|
||||
man/man3/X509V3_EXT_nconf_nid.3 \
|
||||
man/man3/X509V3_EXT_print.3 \
|
||||
man/man3/X509V3_get_d2i.3 \
|
||||
man/man3/X509V3_set_ctx.3 \
|
||||
|
||||
@@ -36,7 +36,7 @@ there are unambiguous choices for its encoding and decoding functions.
|
||||
It may be noted that the *wire-form* public key is "compressed".
|
||||
Instead of the bulky "A" ("m" in the code) matrix, which represents the majority
|
||||
of the storage required for ML-KEM public and private keys, the *wire-form* public
|
||||
key, holds a 32-byte seed from which the the matrix is regenerated by the recipient
|
||||
key, holds a 32-byte seed from which the matrix is regenerated by the recipient
|
||||
of the public key.
|
||||
In the OpenSSL implementation, the matrix is *eagerly* evaluated as part of
|
||||
decoding the public key, and stored in memory in the internal form needed for
|
||||
|
||||
@@ -4,6 +4,13 @@ OpenSSL FIPS Indicators
|
||||
The following document refers to behaviour required by the OpenSSL FIPS provider,
|
||||
the changes should not affect the default provider.
|
||||
|
||||
Every algorithm implementation advertised with `fips=yes` by the FIPS provider
|
||||
must advertise `OSSL_ALG_PARAM_FIPS_APPROVED_INDICATOR` as a gettable context
|
||||
parameter and its getter must return 1 for an approved operation. Missing
|
||||
indicator support is not an implicit indication of approval. Implementations
|
||||
advertised with `fips=no` return 0 when they expose the indicator. The default
|
||||
provider may omit the parameter; if it exposes the parameter, it returns 0.
|
||||
|
||||
References
|
||||
----------
|
||||
|
||||
@@ -103,6 +110,11 @@ This initially has a value of 1, and may be set to 0 if the algorithm is
|
||||
unapproved. The getter allows you to access the indicator value after the
|
||||
operation has completed (e.g. Final or Derive related functions)
|
||||
|
||||
An implementation that is always approved still supplies the gettable
|
||||
parameter and getter. Such a getter returns 1 without requiring an approval
|
||||
flag in its context. This makes approval explicit instead of relying on the
|
||||
absence of an indicator.
|
||||
|
||||
- Example Algorithm Check
|
||||
|
||||
```c
|
||||
|
||||
@@ -56,7 +56,7 @@ dispatches calls to libssl public APIs to the APL.
|
||||
|
||||
**Engine:** See `QUIC_ENGINE`.
|
||||
|
||||
**Event Leader:** The QSO which is is the top-level QSO in a hierarchy of QSOs,
|
||||
**Event Leader:** The QSO which is the top-level QSO in a hierarchy of QSOs,
|
||||
and which is responsible for event processing for all QSOs in that hierarchy.
|
||||
This may be a QLSO or QCSO. See [the server API
|
||||
design](server/quic-server-api.md).
|
||||
|
||||
@@ -421,7 +421,7 @@ one that is not either
|
||||
process it safely).
|
||||
|
||||
This should be called for a packet before attempting to process its contents.
|
||||
Failure to do so may may result in processing a duplicated packet in violation
|
||||
Failure to do so may result in processing a duplicated packet in violation
|
||||
of the RFC.
|
||||
|
||||
The returrn value of this function transitions from 1 to 0 for a given PN once
|
||||
|
||||
@@ -453,7 +453,7 @@ use cases.
|
||||
|
||||
The design is similar to that of `DTLSv1_get_timeout` and uses a `struct
|
||||
timeval`. However, this function can also output an infinite timeout using the
|
||||
`is_infinite` argument, whereas whereas `DTLSv1_get_timeout` represents an
|
||||
`is_infinite` argument, whereas `DTLSv1_get_timeout` represents an
|
||||
infinite timeout using a 0 return value, which does not allow a failure
|
||||
condition to be distinguished.
|
||||
|
||||
|
||||
@@ -189,7 +189,7 @@ B<OPT_PARAMETERS> macro:
|
||||
OPT_PARAMETERS()
|
||||
{OPT_PARAM_STR, 1, '-', "Parameters:\n"}
|
||||
|
||||
Every "option" after after this should contain the parameter and
|
||||
Every "option" after this should contain the parameter and
|
||||
the help string:
|
||||
|
||||
{"text", 0, 0, "Words to display (optional)"},
|
||||
@@ -247,7 +247,7 @@ The opt_arg() function returns the option's argument value, if there is one.
|
||||
The opt_unknown() function returns the unknown option.
|
||||
In an option list, there can be at most one option with the empty string.
|
||||
This is a "wildcard" or "unknown" option. For example, it allows an
|
||||
option to be be taken as digest algorithm, like C<-sha1>. The function
|
||||
option to be taken as digest algorithm, like C<-sha1>. The function
|
||||
opt_md() takes the specified I<name> and fills in the digest into I<mdp>.
|
||||
The functions opt_cipher(), opt_cipher_any() and opt_cipher_silent()
|
||||
each takes the specified I<name> and fills in the cipher into I<cipherp>.
|
||||
@@ -333,7 +333,7 @@ things very differently.
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
Copyright 2021-2022 The OpenSSL Project Authors. All Rights Reserved.
|
||||
Copyright 2021-2026 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
|
||||
|
||||
@@ -89,7 +89,7 @@ the string will be C<3.0.0>.
|
||||
=item $config{full_version}
|
||||
|
||||
The fully loaded version number, a string composed from $config{version},
|
||||
$config{prerelease} and $config{build_metadata}. See See L</EXAMPLES> for
|
||||
$config{prerelease} and $config{build_metadata}. See L</EXAMPLES> for
|
||||
a few examples.
|
||||
|
||||
=back
|
||||
@@ -139,7 +139,7 @@ L<OpenSSL_version(3)>
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
Copyright 2019-2026 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
|
||||
|
||||
@@ -0,0 +1,303 @@
|
||||
=pod
|
||||
|
||||
=head1 NAME
|
||||
|
||||
OSSL_RBT_PROTOTYPE, OSSL_RBT_GENERATE, OSSL_RBT_ENTRY, OSSL_RBT_HEAD,
|
||||
OSSL_RBT_INITIALIZER, OSSL_RBT_ROOT, OSSL_RBT_EMPTY, OSSL_RBT_NEXT,
|
||||
OSSL_RBT_PREV, OSSL_RBT_MIN, OSSL_RBT_MAX, OSSL_RBT_FIND, OSSL_RBT_NFIND,
|
||||
OSSL_RBT_LEFT, OSSL_RBT_RIGHT, OSSL_RBT_PARENT, OSSL_RBT_SET_LEFT,
|
||||
OSSL_RBT_SET_RIGHT, OSSL_RBT_SET_PARENT, OSSL_RBT_FOREACH,
|
||||
OSSL_RBT_FOREACH_SAFE, OSSL_RBT_FOREACH_REVERSE, OSSL_RBT_FOREACH_REVERSE_SAFE,
|
||||
OSSL_RBT_INIT, OSSL_RBT_INSERT, OSSL_RBT_REMOVE,
|
||||
ossl_rbtree - implementation of red-black tree
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
#include "internal/ossl_rbtree.h"
|
||||
|
||||
/* int (*CMP)(const NODE_TYPE *, const NODE_TYPE *); */
|
||||
|
||||
OSSL_RBT_PROTOTYPE(NAME, NODE_TYPE, FIELD, CMP)
|
||||
|
||||
OSSL_RBT_GENERATE(NAME, NODE_TYPE, FIELD, CMP);
|
||||
|
||||
OSSL_RBT_ENTRY(NODE_TYPE)
|
||||
|
||||
OSSL_RBT_HEAD(HEADNAME, NODE_TYPE)
|
||||
|
||||
OSSL_RBT_INITIALIZER(OSSL_RBT_HEAD *head);
|
||||
|
||||
struct NODE_TYPE * OSSL_RBT_ROOT(NAME, OSSL_RBT_HEAD *head);
|
||||
|
||||
int OSSL_RBT_EMPTY(NAME, OSSL_RBT_HEAD *head);
|
||||
|
||||
struct NODE_TYPE * OSSL_RBT_NEXT(NAME, struct NODE_TYPE *elm);
|
||||
|
||||
struct NODE_TYPE * OSSL_RBT_PREV(NAME, struct NODE_TYPE *elm);
|
||||
|
||||
struct NODE_TYPE * OSSL_RBT_MIN(NAME, OSSL_RBT_HEAD *head);
|
||||
|
||||
struct NODE_TYPE * OSSL_RBT_MAX(NAME, OSSL_RBT_HEAD *head);
|
||||
|
||||
struct NODE_TYPE * OSSL_RBT_FIND(NAME, OSSL_RBT_HEAD *head, struct NODE_TYPE *elm);
|
||||
|
||||
struct NODE_TYPE * OSSL_RBT_NFIND(NAME, OSSL_RBT_HEAD *head, struct NODE_TYPE *elm);
|
||||
|
||||
struct NODE_TYPE * OSSL_RBT_LEFT(NAME, struct NODE_TYPE *elm);
|
||||
|
||||
struct NODE_TYPE * OSSL_RBT_RIGHT(NAME, struct NODE_TYPE *elm);
|
||||
|
||||
struct NODE_TYPE * OSSL_RBT_PARENT(NAME, struct NODE_TYPE *elm);
|
||||
|
||||
void OSSL_RBT_SET_LEFT(NAME, struct NODE_TYPE *elm, struct NODE_TYPE *left);
|
||||
|
||||
void OSSL_RBT_SET_RIGHT(NAME, struct NODE_TYPE *elm, struct NODE_TYPE *right);
|
||||
|
||||
void OSSL_RBT_SET_PARENT(NAME, struct NODE_TYPE *elm, struct NODE_TYPE *parent);
|
||||
|
||||
OSSL_RBT_FOREACH(VARNAME, NAME, OSSL_RBT_HEAD *head);
|
||||
|
||||
OSSL_RBT_FOREACH_SAFE(VARNAME, NAME, OSSL_RBT_HEAD *head, TEMP_VARNAME);
|
||||
|
||||
OSSL_RBT_FOREACH_REVERSE(VARNAME, NAME, OSSL_RBT_HEAD *head);
|
||||
|
||||
OSSL_RBT_FOREACH_REVERSE_SAFE(VARNAME, NAME, OSSL_RBT_HEAD *head, TEMP_VARNAME);
|
||||
|
||||
void OSSL_RBT_INIT(NAME, OSSL_RBT_HEAD *head);
|
||||
|
||||
struct NODE_TYPE * OSSL_RBT_INSERT(NAME, OSSL_RBT_HEAD *head, struct NODE_TYPE *elm);
|
||||
|
||||
struct NODE_TYPE * OSSL_RBT_REMOVE(NAME, OSSL_RBT_HEAD *head, struct NODE_TYPE *elm);
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
These macros define data structures for a red-black tree.
|
||||
Every operation on a red-black tree is bounded as O(lg n). The maximum
|
||||
height of a red-black tree is 2lg (n+1).
|
||||
|
||||
In the macro definitions, B<NODE_TYPE> is the name tag of a user defined
|
||||
structure that must contain a field named B<FIELD>, of type B<OSSL_RBT_ENTRY>.
|
||||
The argument B<HEADNAME> is the name tag of a user defined
|
||||
structure that must be declared using the macro OSSL_RBT_HEAD().
|
||||
The argument B<NAME> has to be a unique name prefix for every
|
||||
tree that is defined.
|
||||
|
||||
The function prototypes are declared with B<OSSL_RBT_PROTOTYPE>,
|
||||
B<OSSL_RBT_GENERATE>. See the examples below for further
|
||||
explanation of how these macros are used.
|
||||
|
||||
A red-black tree is a binary search tree with the node color as an extra
|
||||
attribute. It fulfills a set of conditions:
|
||||
|
||||
=over 4
|
||||
|
||||
=item 1.
|
||||
every search path from the root to a leaf consists of the same
|
||||
number of black nodes,
|
||||
|
||||
=item 2.
|
||||
each red node (except for the root) has a black parent,
|
||||
|
||||
=item 3.
|
||||
each leaf node is black.
|
||||
|
||||
=back
|
||||
|
||||
A red-black tree is headed by a structure defined by the OSSL_RBT_HEAD macro.
|
||||
An OSSL_RBT_HEAD structure is declared as follows:
|
||||
|
||||
OSSL_RBT_HEAD(HEADNAME, NODE_TYPE) head;
|
||||
|
||||
where B<HEADNAME> is the name of the structure to be defined, and B<struct
|
||||
NODE_TYPE> is the type of the elements to be inserted into the tree.
|
||||
|
||||
The OSSL_RBT_ENTRY macro declares a structure that allows elements to be
|
||||
connected in the tree.
|
||||
|
||||
In order to use the functions that manipulate the tree structure, their
|
||||
prototypes need to be declared with the OSSL_RBT_PROTOTYPE() macro,
|
||||
where B<NAME> is a unique identifier for this
|
||||
particular tree. The B<NODE_TYPE> argument is the type of the structure that is
|
||||
being managed by the tree. The B<FIELD> argument is the name of the element
|
||||
defined by OSSL_RBT_ENTRY().
|
||||
|
||||
The function bodies are generated with the OSSL_RBT_GENERATE() macro.
|
||||
These macros take the same arguments as the
|
||||
OSSL_RBT_PROTOTYPE() macro, but should be used only once.
|
||||
|
||||
Finally, the B<CMP> argument is the name of a function used to compare
|
||||
trees' nodes with each other. The function takes two arguments of type
|
||||
B<const struct NODE_TYPE *>. If the first argument is smaller than the second,
|
||||
the function returns a value smaller than zero. If they are equal, the
|
||||
function returns zero. Otherwise, it should return a value greater than
|
||||
zero. The compare function defines the order of the tree elements.
|
||||
|
||||
The OSSL_RBT_INIT() macro initializes the tree referenced by B<head>.
|
||||
|
||||
The red-black tree can also be initialized statically by using the
|
||||
OSSL_RBT_INITIALIZER() macro like this:
|
||||
|
||||
OSSL_RBT_HEAD(HEADNAME, NODE_TYPE) head = OSSL_RBT_INITIALIZER(&head);
|
||||
|
||||
The OSSL_RBT_INSERT() macro inserts the new element B<elm> into the tree pointed by B<head>.
|
||||
Upon success, NULL is returned. If a matching element already exists in the
|
||||
tree, the insertion is aborted, and a pointer to the existing element is
|
||||
returned.
|
||||
|
||||
The OSSL_RBT_REMOVE() macro removes the element B<elm> from the tree pointed by
|
||||
B<head>. OSSL_RBT_REMOVE() returns B<elm>.
|
||||
|
||||
The OSSL_RBT_LEFT() macro returns a pointer to the left child element of B<elm>
|
||||
in a red-black tree of type B<NAME>.
|
||||
|
||||
The OSSL_RBT_RIGHT() macro returns a pointer to the right child element
|
||||
of B<elm> in a red-black tree of type B<NAME>.
|
||||
|
||||
The OSSL_RBT_PARENT() macro returns a pointer to the parent element of B<elm>
|
||||
in a red-black tree of type B<NAME>.
|
||||
|
||||
The OSSL_RBT_SET_LEFT() macro sets the left child pointer of element B<elm>
|
||||
to B<left> in a red-black tree of type B<NAME>.
|
||||
|
||||
The OSSL_RBT_SET_RIGHT() macro sets the right child pointer of element B<elm>
|
||||
to B<right> in a red-black tree of type B<NAME>.
|
||||
|
||||
The OSSL_RBT_SET_PARENT() macro sets the parent pointer of element B<elm>
|
||||
to B<parent> in a red-black tree of type B<NAME>.
|
||||
|
||||
The OSSL_RBT_FIND() and OSSL_RBT_NFIND() macros can be used to find a particular
|
||||
element in the tree. OSSL_RBT_FIND() finds the node with the same key as B<elm>.
|
||||
OSSL_RBT_NFIND() finds the first node greater than or equal to the search key.
|
||||
|
||||
struct NODE_TYPE find, *res;
|
||||
find.key = 30;
|
||||
res = OSSL_RBT_FIND(NAME, &head, &find);
|
||||
|
||||
The OSSL_RBT_ROOT(), OSSL_RBT_MIN(), OSSL_RBT_MAX(), OSSL_RBT_NEXT(), and
|
||||
OSSL_RBT_PREV() macros can be used to traverse the tree:
|
||||
|
||||
for (np = OSSL_RBT_MIN(NAME, &head); np != NULL; np = OSSL_RBT_NEXT(NAME, &head, np))
|
||||
|
||||
Or, for simplicity, one can use the OSSL_RBT_FOREACH() or OSSL_RBT_FOREACH_REVERSE()
|
||||
macros:
|
||||
|
||||
OSSL_RBT_FOREACH(np, NAME, &head)
|
||||
|
||||
The macros OSSL_RBT_FOREACH_SAFE() and OSSL_RBT_FOREACH_REVERSE_SAFE() traverse the
|
||||
tree referenced by head in a forward or reverse direction respectively,
|
||||
assigning each element in turn to B<VARNAME>. However, unlike their unsafe
|
||||
counterparts, they permit both the removal of B<VARNAME> as well as freeing it
|
||||
from within the loop safely without interfering with the traversal.
|
||||
|
||||
The OSSL_RBT_EMPTY() macro should be used to check whether a red-black tree is
|
||||
empty.
|
||||
|
||||
=head1 EXAMPLES
|
||||
|
||||
The following example demonstrates how to declare a red-black tree
|
||||
holding integers. Values are inserted into it and the contents of the
|
||||
tree are printed in order. Lastly, the internal structure of the tree
|
||||
is printed.
|
||||
|
||||
#include <err.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "internal/nelem.h"
|
||||
#include "internal/ossl_rbtree.h"
|
||||
|
||||
struct node {
|
||||
OSSL_RBT_ENTRY(node) entry;
|
||||
int i;
|
||||
};
|
||||
|
||||
static int intcmp(const struct node *, const struct node *);
|
||||
|
||||
OSSL_RBT_HEAD(inttree, node) head = OSSL_RBT_INITIALIZER(&head);
|
||||
OSSL_RBT_PROTOTYPE(inttree, node, entry, intcmp)
|
||||
OSSL_RBT_GENERATE(inttree, node, entry, intcmp);
|
||||
|
||||
static const int testdata[] = {
|
||||
20, 16, 17, 13, 3, 6, 1, 8, 2, 4,
|
||||
10, 19, 5, 9, 12, 15, 18, 7, 11, 14
|
||||
};
|
||||
|
||||
static int intcmp(const struct node *e1, const struct node *e2)
|
||||
{
|
||||
return e1->i < e2->i ? -1 : e1->i > e2->i;
|
||||
}
|
||||
|
||||
static void print_tree(struct node *n)
|
||||
{
|
||||
struct node *left, *right;
|
||||
|
||||
if (n == NULL) {
|
||||
printf("nil");
|
||||
return;
|
||||
}
|
||||
|
||||
left = OSSL_RBT_LEFT(inttree, n);
|
||||
right = OSSL_RBT_RIGHT(inttree, n);
|
||||
|
||||
if (left == NULL && right == NULL) {
|
||||
printf("%d", n->i);
|
||||
} else {
|
||||
printf("%d(", n->i);
|
||||
print_tree(left);
|
||||
printf(",");
|
||||
print_tree(right);
|
||||
printf(")");
|
||||
}
|
||||
}
|
||||
|
||||
int main(void)
|
||||
{
|
||||
size_t i;
|
||||
struct node *n;
|
||||
|
||||
for (i = 0; i < OSSL_NELEM(testdata); i++) {
|
||||
if ((n = OPENSSL_malloc(sizeof(struct node))) == NULL)
|
||||
err(1, NULL);
|
||||
n->i = testdata[i];
|
||||
OSSL_RBT_INSERT(inttree, &head, n);
|
||||
}
|
||||
|
||||
OSSL_RBT_FOREACH (n, inttree, &head) {
|
||||
printf("%d\n", n->i);
|
||||
}
|
||||
|
||||
print_tree(OSSL_RBT_ROOT(inttree, &head));
|
||||
printf("\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
=head1 HISTORY
|
||||
|
||||
The red-black tree implementation comes from David Gwynne. It can be found
|
||||
here: L<https://github.com/dgwynne/data-structures>. OpenSSL project
|
||||
obtained a permission from David Gwynne to license his work under
|
||||
Apache License 2.0
|
||||
|
||||
Apart from B<OSSL_RBT_> prefix, the API is compatible with implementation
|
||||
done by Neils Provos for OpenBSD.
|
||||
|
||||
The text in this manual page comes from C<tree(3)> in OpenBSD, the text was
|
||||
authored by Neils Provos (according to the commit history)
|
||||
|
||||
The red-black tree implementation was added in OpenSSL 4.1.
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
Copyright 2002 Niels Provos <[email protected]>
|
||||
All rights reserved.
|
||||
|
||||
Copyright 2026 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
|
||||
L<https://www.openssl.org/source/license.html>.
|
||||
|
||||
=cut
|
||||
@@ -104,14 +104,19 @@ Print out a usage message.
|
||||
|
||||
=item B<-passin> I<arg>
|
||||
|
||||
The password source for the input, and for encrypting any private keys that
|
||||
are output.
|
||||
The password source for input files. With B<-export>, it is used to decrypt
|
||||
the input private key. Otherwise, it is the password for the input PKCS#12
|
||||
file.
|
||||
For more information about the format of B<arg>
|
||||
see L<openssl-passphrase-options(1)>.
|
||||
|
||||
=item B<-passout> I<arg>
|
||||
|
||||
The password source for output files.
|
||||
The password source for output files. With B<-export>, it is the password for
|
||||
the output PKCS#12 file. Otherwise, it is used to encrypt any private keys that
|
||||
are output.
|
||||
For more information about the format of B<arg>
|
||||
see L<openssl-passphrase-options(1)>.
|
||||
|
||||
=item B<-password> I<arg>
|
||||
|
||||
@@ -490,7 +495,7 @@ The B<-nodes> option was deprecated in OpenSSL 3.0, too; use B<-noenc> instead.
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
Copyright 2000-2025 The OpenSSL Project Authors. All Rights Reserved.
|
||||
Copyright 2000-2026 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
|
||||
|
||||
@@ -33,7 +33,7 @@ Once the timeout expires, DTLSv1_handle_timeout() should be called to handle any
|
||||
internal processing which is due; for more information, see
|
||||
L<DTLSv1_handle_timeout(3)>.
|
||||
|
||||
L<SSL_get_event_timeout(3)> supersedes all use cases for this this function and
|
||||
L<SSL_get_event_timeout(3)> supersedes all use cases for this function and
|
||||
may be used instead of it.
|
||||
|
||||
=head1 RETURN VALUES
|
||||
@@ -48,7 +48,7 @@ L<DTLSv1_handle_timeout(3)>, L<SSL_get_event_timeout(3)>, L<ssl(7)>
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
Copyright 2023 The OpenSSL Project Authors. All Rights Reserved.
|
||||
Copyright 2023-2026 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
|
||||
|
||||
@@ -1001,11 +1001,17 @@ This option is used by the OpenSSL FIPS provider.
|
||||
A getter that returns 1 if the operation is FIPS approved, or 0 otherwise.
|
||||
This may be used after calling a cipher final operation such as
|
||||
EVP_EncryptFinal_ex(). It may return 0 if the "encrypt-check" option is set to 0.
|
||||
For GCM encryption it also returns 0 if the IV was supplied externally instead
|
||||
of being generated by the FIPS provider. The separate "iv-generated"
|
||||
parameter reports the IV source directly, but callers can use
|
||||
"fips-indicator" to determine the overall approval status. For GCM encryption
|
||||
and decryption, tag lengths other than 4, 8, or 12 through 16 bytes also cause
|
||||
this indicator to return 0.
|
||||
|
||||
=item "iv-generated" (B<OSSL_CIPHER_PARAM_AEAD_IV_GENERATED>) <unsigned integer>
|
||||
|
||||
An indicator that returns 1 if an IV was generated internally during encryption,
|
||||
or O otherwise.
|
||||
or 0 otherwise.
|
||||
This may be used by GCM ciphers after calling a cipher final operation such
|
||||
as EVP_EncryptFinal_ex().
|
||||
GCM should generate an IV internally if the IV is not specified during a
|
||||
|
||||
@@ -102,6 +102,9 @@ If I<type> is C<RSA>,
|
||||
a B<size_t> parameter must be given to specify the size of the RSA key.
|
||||
If I<type> is C<EC>,
|
||||
a string parameter must be given to specify the name of the EC curve.
|
||||
The list of built-in curves can be obtained programmatically using
|
||||
L<EC_get_builtin_curves(3)>, and their names can be retrieved using
|
||||
L<OSSL_EC_curve_nid2name(3)>.
|
||||
If I<type> is:
|
||||
C<ED25519>,
|
||||
C<ED448>,
|
||||
|
||||
@@ -63,7 +63,7 @@ enabled.
|
||||
Name: B<PPC_CRYPTO207>
|
||||
|
||||
Meaning: Use instructions added in ISA level 2.07. The associated probe
|
||||
instruction instruction is vcipher (vector AES cipher round).
|
||||
instruction is vcipher (vector AES cipher round).
|
||||
|
||||
Effect: Enables AES, SHA-2 sigma, and other ISA 2.07 instructions for AES, SHA-2,
|
||||
GHASH, and Poly1305.
|
||||
@@ -145,7 +145,7 @@ Enable base AltiVec extensions:
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
|
||||
Copyright 2025-2026 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
|
||||
|
||||
@@ -94,15 +94,27 @@ OSSL_CMP_SRV_CTX_set_grant_implicit_confirm
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
OSSL_CMP_SRV_process_request() implements the generic aspects of a CMP server.
|
||||
Its arguments are the B<OSSL_CMP_SRV_CTX> I<srv_ctx> and the CMP request message
|
||||
OSSL_CMP_SRV_process_request() implements the generic core aspects
|
||||
of Certificate Management Protocol (CMP) servers.
|
||||
Its arguments are the B<OSSL_CMP_SRV_CTX> I<srv_ctx> and a CMP request message
|
||||
I<req>. It does the typical generic checks on I<req>, calls
|
||||
the respective callback function (if present) for more specific processing,
|
||||
and then assembles a result message, which may be a CMP error message.
|
||||
and then assembles a response message, which may be a CMP error message.
|
||||
|
||||
Since OSSL_CMP_SRV_process_request() handles only a single CMP request message,
|
||||
it may need to be called multiple times until a CMP transaction has ended.
|
||||
If after return of the function the expression
|
||||
I<OSSL_CMP_CTX_get_status(OSSL_CMP_SRV_CTX_get0_cmp_ctx(srv_ctx))> yields -1
|
||||
then the function has closed the current transaction,
|
||||
which may be due to normal successful end of the transaction or due to an error.
|
||||
Otherwise, it should be called again with the next request message of the same
|
||||
transaction (which can be a certificate confirmation or a poll request message).
|
||||
The function should not be called by multiple threads sharing
|
||||
the same I<srv_ctx> without explicitly serialising the calls;
|
||||
calling it in parallel leads to undefined behavior.
|
||||
When an earlier call did not yet finish the respective transaction,
|
||||
calling it in an interleaved way with a new request belonging to a different
|
||||
transaction will abort the earlier transaction and begin the new one.
|
||||
|
||||
OSSL_CMP_CTX_server_perform() is an interface to
|
||||
OSSL_CMP_SRV_process_request() that can be used by a CMP client
|
||||
@@ -160,11 +172,21 @@ confirmation of newly enrolled certificates if requested.
|
||||
|
||||
CMP is defined in RFC 9810 (and CRMF in RFC 4211).
|
||||
|
||||
So far the CMP server implementation is limited to one request per CMP message
|
||||
(and consequently to at most one response component per CMP message).
|
||||
Like the OpenSSL CMP client, the CMP server implementation documented here
|
||||
focuses on the Lightweight CMP Profile (RFC 9483).
|
||||
Among other things, this implies that only commonly used CMP message types are supported
|
||||
and that each CMP message may not contain multiple certificate requests or responses.
|
||||
|
||||
So far, this server implementation is single-threaded and
|
||||
should not be called in parallel for any given B<OSSL_CMP_SRV_CTX> I<srv_ctx>.
|
||||
It can handle only one CMP transaction at a time (which, of course, is not a problem
|
||||
for transactions consisting of just a single request/response message pair).
|
||||
|
||||
=head1 RETURN VALUES
|
||||
|
||||
OSSL_CMP_SRV_process_request() returns a CMP response message, which may be an
|
||||
error message, or NULL on internal errors that preclude producing a response.
|
||||
|
||||
OSSL_CMP_SRV_CTX_new() returns a B<OSSL_CMP_SRV_CTX> structure on success,
|
||||
NULL on error.
|
||||
|
||||
@@ -188,7 +210,7 @@ was added in OpenSSL 3.3.
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
Copyright 2007-2024 The OpenSSL Project Authors. All Rights Reserved.
|
||||
Copyright 2007-2026 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
|
||||
|
||||
@@ -51,8 +51,9 @@ OSSL_CMP_get1_certReqTemplate
|
||||
OSSL_CMP_ATAVS **keySpec);
|
||||
=head1 DESCRIPTION
|
||||
|
||||
This is the OpenSSL API for doing CMP (Certificate Management Protocol)
|
||||
client-server transactions, i.e., sequences of CMP requests and responses.
|
||||
This is the OpenSSL main API for Certificate Management Protocol (CMP) clients.
|
||||
Each of the OSSL_CMP_exec_*() functions performs a whole CMP transaction,
|
||||
which is a sequence of related CMP request messages and response messages.
|
||||
|
||||
All functions take a populated OSSL_CMP_CTX structure as their first argument.
|
||||
Usually the server name, port, and path ("CMP alias") need to be set, as well as
|
||||
@@ -185,8 +186,9 @@ Both must be freed by the caller.
|
||||
|
||||
CMP is defined in RFC 9810 (and CRMF in RFC 4211).
|
||||
|
||||
The CMP client implementation is limited to one request per CMP message
|
||||
(and consequently to at most one response component per CMP message).
|
||||
This CMP implementation focuses on the Lightweight CMP Profile (RFC 9483).
|
||||
Among other things, this implies that only commonly used CMP message types are supported
|
||||
and that each CMP message may not contain multiple certificate requests or responses.
|
||||
|
||||
When a client obtains from a CMP server CA certificates that it is going to
|
||||
trust, for instance via the caPubs field of a certificate response or using
|
||||
@@ -253,7 +255,7 @@ were added in OpenSSL 3.4.
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
Copyright 2007-2024 The OpenSSL Project Authors. All Rights Reserved.
|
||||
Copyright 2007-2026 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
|
||||
|
||||
@@ -207,7 +207,8 @@ The caller is responsible for freeing the BIO pointer obtained.
|
||||
|
||||
OSSL_HTTP_get() uses HTTP GET to obtain data from I<bio> if non-NULL,
|
||||
else from the server contained in the I<url>, and returns it as a BIO.
|
||||
It supports redirection via HTTP status code 301 or 302. It is meant for
|
||||
It supports redirection via HTTP status code 301 or 302.
|
||||
Redirection from HTTPS to HTTP is not allowed. It is meant for
|
||||
transfers with a single round trip, so does not support persistent connections.
|
||||
If I<bio> is non-NULL, any host and port components in the I<url> are not used
|
||||
for connecting but the hostname is used, as usual, for the C<Host> header.
|
||||
|
||||
@@ -50,7 +50,7 @@ ignored.
|
||||
|
||||
RAND_set1_random_provider() specifies a provider, I<prov>, which will be used
|
||||
by the library context I<ctx> for all of the generate calls above instead
|
||||
of the built-in in DRBGs and entropy source. Pass NULL for the provider
|
||||
of the built-in DRBGs and entropy source. Pass NULL for the provider
|
||||
to disable the random provider functionality. In this case, the built-in DRBGs
|
||||
and entropy source will be used. This call should not be considered thread safe.
|
||||
|
||||
@@ -115,7 +115,7 @@ The RAND_set1_random_provider() function was added in OpenSSL 3.5
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
Copyright 2000-2025 The OpenSSL Project Authors. All Rights Reserved.
|
||||
Copyright 2000-2026 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
|
||||
|
||||
@@ -15,18 +15,22 @@ SSL_CTX_set_security_level, SSL_set_security_level, SSL_CTX_get_security_level,
|
||||
int SSL_get_security_level(const SSL *s);
|
||||
|
||||
void SSL_CTX_set_security_callback(SSL_CTX *ctx,
|
||||
int (*cb)(SSL *s, SSL_CTX *ctx, int op,
|
||||
int bits, int nid,
|
||||
int (*cb)(const SSL *s, const SSL_CTX *ctx,
|
||||
int op, int bits, int nid,
|
||||
void *other, void *ex));
|
||||
|
||||
void SSL_set_security_callback(SSL *s, int (*cb)(SSL *s, SSL_CTX *ctx, int op,
|
||||
int bits, int nid,
|
||||
void *other, void *ex));
|
||||
void SSL_set_security_callback(SSL *s,
|
||||
int (*cb)(const SSL *s, const SSL_CTX *ctx,
|
||||
int op, int bits, int nid,
|
||||
void *other, void *ex));
|
||||
|
||||
int (*SSL_CTX_get_security_callback(const SSL_CTX *ctx))(SSL *s, SSL_CTX *ctx, int op,
|
||||
int bits, int nid, void *other,
|
||||
int (*SSL_CTX_get_security_callback(const SSL_CTX *ctx))(const SSL *s,
|
||||
const SSL_CTX *ctx,
|
||||
int op, int bits,
|
||||
int nid, void *other,
|
||||
void *ex);
|
||||
int (*SSL_get_security_callback(const SSL *s))(SSL *s, SSL_CTX *ctx, int op,
|
||||
int (*SSL_get_security_callback(const SSL *s))(const SSL *s,
|
||||
const SSL_CTX *ctx, int op,
|
||||
int bits, int nid, void *other,
|
||||
void *ex);
|
||||
|
||||
@@ -110,7 +114,96 @@ shorter than 15360 bits and ECC keys shorter than 512 bits are prohibited.
|
||||
|
||||
=head1 APPLICATION DEFINED SECURITY CALLBACKS
|
||||
|
||||
I<Documentation to be provided.>
|
||||
An application defined security callback is installed with
|
||||
SSL_CTX_set_security_callback() or SSL_set_security_callback() and replaces the
|
||||
default callback. It is consulted whenever the library needs to decide whether
|
||||
an algorithm, key, parameter or protocol version meets the configured security
|
||||
level. It should return 1 to permit the operation and 0 to reject it. A
|
||||
rejected parameter is not advertised or used, as appropriate.
|
||||
|
||||
The callback arguments are:
|
||||
|
||||
=over 4
|
||||
|
||||
=item B<s>, B<ctx>
|
||||
|
||||
The B<SSL> or B<SSL_CTX> the check applies to. One of the two is NULL: checks
|
||||
originating from a connection pass B<s> (with B<ctx> NULL), and checks
|
||||
originating from a context pass B<ctx> (with B<s> NULL).
|
||||
|
||||
=item B<op>
|
||||
|
||||
The operation being checked, one of the B<SSL_SECOP_*> values below.
|
||||
|
||||
=item B<bits>
|
||||
|
||||
The number of bits of security the parameter provides, or 0 when not
|
||||
meaningful for B<op>.
|
||||
|
||||
=item B<nid>
|
||||
|
||||
An identifier whose meaning depends on B<op>, or B<NID_undef> when not
|
||||
applicable.
|
||||
|
||||
=item B<other>
|
||||
|
||||
A pointer to the object being checked, whose type depends on B<op> as listed
|
||||
below. It is NULL when no object is associated with the operation.
|
||||
|
||||
=item B<ex>
|
||||
|
||||
The extra data pointer previously set with SSL_CTX_set0_security_ex_data() or
|
||||
SSL_set0_security_ex_data(), or NULL.
|
||||
|
||||
=back
|
||||
|
||||
Several operations have B<_SUPPORTED>, B<_SHARED> and B<_CHECK> variants.
|
||||
The I<supported> variant checks a parameter before advertising support for it.
|
||||
The I<shared> variant checks a parameter when selecting from the options
|
||||
offered by both peers. The I<check> variant checks a parameter the peer has
|
||||
selected before accepting it.
|
||||
|
||||
The defined operations, and the corresponding type of B<other>, are:
|
||||
|
||||
=over 4
|
||||
|
||||
=item B<SSL_SECOP_CIPHER_SUPPORTED>, B<SSL_SECOP_CIPHER_SHARED>, B<SSL_SECOP_CIPHER_CHECK>
|
||||
|
||||
Advertise/select/accept a TLS cipher suite. B<other> is the B<SSL_CIPHER>.
|
||||
|
||||
=item B<SSL_SECOP_CURVE_SUPPORTED>, B<SSL_SECOP_CURVE_SHARED>, B<SSL_SECOP_CURVE_CHECK>
|
||||
|
||||
Advertise/select/accept a named group used for key exchange, either an elliptic
|
||||
curve or a finite-field DH group. B<nid> is the group and B<other> points to
|
||||
its two byte TLS codepoint.
|
||||
|
||||
=item B<SSL_SECOP_SIGALG_SUPPORTED>, B<SSL_SECOP_SIGALG_SHARED>, B<SSL_SECOP_SIGALG_CHECK>, B<SSL_SECOP_SIGALG_MASK>
|
||||
|
||||
Advertise/select/accept a signature algorithm used in the handshake;
|
||||
B<SSL_SECOP_SIGALG_MASK> is used when building the mask of permitted signature
|
||||
algorithms. B<nid> is its hash and B<other> points to its two byte TLS
|
||||
codepoint.
|
||||
|
||||
=item B<SSL_SECOP_VERSION>
|
||||
|
||||
Negotiate a protocol version. B<nid> is the version, for example
|
||||
B<TLS1_2_VERSION>, and B<other> is NULL.
|
||||
|
||||
=item B<SSL_SECOP_TMP_DH>
|
||||
|
||||
Use an ephemeral DH key. B<other> is the B<EVP_PKEY>.
|
||||
|
||||
=item B<SSL_SECOP_EE_KEY>, B<SSL_SECOP_CA_KEY>
|
||||
|
||||
Accept an end entity or CA certificate public key. B<other> is the B<X509>
|
||||
certificate.
|
||||
|
||||
=item B<SSL_SECOP_TICKET>, B<SSL_SECOP_COMPRESSION>
|
||||
|
||||
Issue or accept a session ticket, or enable record compression. B<other>
|
||||
is NULL.
|
||||
|
||||
=back
|
||||
|
||||
=head1 NOTES
|
||||
|
||||
@@ -179,7 +272,7 @@ These functions were added in OpenSSL 1.1.0.
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
Copyright 2014-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||
Copyright 2014-2026 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
|
||||
|
||||
@@ -66,7 +66,7 @@ it off. The default setting is off.
|
||||
|
||||
If "auto" DH parameters are switched on then the parameters will be selected to
|
||||
be consistent with the size of the key associated with the server's certificate.
|
||||
If there is no certificate (e.g. for PSK ciphersuites), then it it will be
|
||||
If there is no certificate (e.g. for PSK ciphersuites), then it will be
|
||||
consistent with the size of the negotiated symmetric cipher key.
|
||||
|
||||
Applications may supply their own DH parameters instead of using the built-in
|
||||
@@ -114,7 +114,7 @@ L<openssl-ciphers(1)>, L<openssl-dhparam(1)>
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
Copyright 2001-2025 The OpenSSL Project Authors. All Rights Reserved.
|
||||
Copyright 2001-2026 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
|
||||
|
||||
@@ -71,7 +71,7 @@ format. These are:
|
||||
|
||||
=item TLS_ST_BEFORE
|
||||
|
||||
No handshake messages have yet been been sent or received.
|
||||
No handshake messages have yet been sent or received.
|
||||
|
||||
=item TLS_ST_OK
|
||||
|
||||
@@ -102,7 +102,7 @@ L<SSL_read_early_data(3)>
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
Copyright 2017-2018 The OpenSSL Project Authors. All Rights Reserved.
|
||||
Copyright 2017-2026 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
|
||||
|
||||
@@ -86,7 +86,7 @@ least one of the given resources is ready.
|
||||
A call to SSL_poll() specifies an array of B<SSL_POLL_ITEM> structures, each of
|
||||
which designates a resource which is being polled for readiness, and a set of
|
||||
event flags which indicate the specific readiness events which the caller is
|
||||
interested in in relation to the specified resource.
|
||||
interested in relation to the specified resource.
|
||||
|
||||
The fields of B<SSL_POLL_ITEM> are as follows:
|
||||
|
||||
@@ -412,7 +412,7 @@ guaranteed to be at least one) reflect the cause of the failure of the first
|
||||
item in I<items> with B<SSL_POLL_EVENT_F> raised. Note that there may be events
|
||||
other than I<SSL_POLL_EVENT_F> output for items which come before the first
|
||||
item with B<SSL_POLL_EVENT_F> raised, and additional B<SSL_POLL_EVENT_F>
|
||||
events may or may not have been output, both of which which will be reflected in
|
||||
events may or may not have been output, both of which will be reflected in
|
||||
I<result_count>.
|
||||
|
||||
=back
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
=pod
|
||||
|
||||
=head1 NAME
|
||||
|
||||
X509V3_EXT_nconf, X509V3_EXT_nconf_nid - functions to
|
||||
create X.509 certificate extensions based on OpenSSL configuration
|
||||
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
#include <openssl/x509v3.h>
|
||||
|
||||
X509_EXTENSION *X509V3_EXT_nconf_nid(CONF *conf, X509V3_CTX *ctx, int ext_nid,
|
||||
const char *value);
|
||||
X509_EXTENSION *X509V3_EXT_nconf(CONF *conf, X509V3_CTX *ctx, const char *name,
|
||||
const char *value);
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
X509V3_EXT_nconf_nid() and X509V3_EXT_nconf() create a requested X.509
|
||||
extension identified either by I<name> or I<ext_nid> correspondingly using
|
||||
I<value> contains the string to encode.
|
||||
|
||||
I<conf> the configuration information where additional data
|
||||
will be read from. I<conf> will typically come from a config
|
||||
file.
|
||||
|
||||
In case when I<ctx> value is null, the default one is used.
|
||||
|
||||
=head1 NOTES
|
||||
|
||||
Normally these functions should not be called directly. For many extensions
|
||||
they will not produce the expected results without a suitably configured
|
||||
context (I<conf> and I<ctx> arguments) that specifies the target object, issuer
|
||||
data etc.
|
||||
|
||||
=head1 RETURN VALUES
|
||||
|
||||
X509V3_EXT_nconf() and X509V3_EXT_nconf_nid() return an B<X509_EXTENSION>
|
||||
object on success and NULL on failure.
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
Copyright 2026 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
|
||||
L<https://www.openssl.org/source/license.html>.
|
||||
|
||||
=cut
|
||||
@@ -31,10 +31,10 @@ X509_NAME_ENTRY_create_by_OBJ - X509_NAME_ENTRY utility functions
|
||||
=head1 DESCRIPTION
|
||||
|
||||
X509_NAME_ENTRY_get_object() retrieves the field name of B<ne> in
|
||||
and B<ASN1_OBJECT> structure.
|
||||
an B<ASN1_OBJECT> structure.
|
||||
|
||||
X509_NAME_ENTRY_get_data() retrieves the field value of B<ne> in
|
||||
and B<ASN1_STRING> structure.
|
||||
an B<ASN1_STRING> structure.
|
||||
|
||||
X509_NAME_ENTRY_set_object() sets the field name of B<ne> to B<obj>.
|
||||
|
||||
@@ -66,11 +66,11 @@ set first so the relevant field information can be looked up internally.
|
||||
|
||||
=head1 RETURN VALUES
|
||||
|
||||
X509_NAME_ENTRY_get_object() returns a valid B<ASN1_OBJECT> structure if it is
|
||||
set or NULL if an error occurred.
|
||||
X509_NAME_ENTRY_get_object() returns an internal pointer to a valid
|
||||
B<ASN1_OBJECT> structure if it is set, or NULL if an error occurred.
|
||||
|
||||
X509_NAME_ENTRY_get_data() returns a valid B<ASN1_STRING> structure if it is set
|
||||
or NULL if an error occurred.
|
||||
X509_NAME_ENTRY_get_data() returns an internal pointer to a valid
|
||||
B<ASN1_STRING> structure if it is set, or NULL if an error occurred.
|
||||
|
||||
X509_NAME_ENTRY_set_object() and X509_NAME_ENTRY_set_data() return 1 on success
|
||||
or 0 on error.
|
||||
@@ -86,7 +86,7 @@ L<OBJ_nid2obj(3)>
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
Copyright 2002-2018 The OpenSSL Project Authors. All Rights Reserved.
|
||||
Copyright 2002-2026 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
|
||||
|
||||
@@ -61,7 +61,16 @@ FIPS provider:
|
||||
=head2 Parameters
|
||||
|
||||
This implementation supports the parameters described in
|
||||
L<EVP_EncryptInit(3)/PARAMETERS>.
|
||||
L<EVP_EncryptInit(3)/PARAMETERS>. For implementations in the OpenSSL FIPS
|
||||
provider, these include the gettable "fips-indicator"
|
||||
(B<OSSL_CIPHER_PARAM_FIPS_APPROVED_INDICATOR>), which returns 1 if the
|
||||
operation is FIPS approved, or 0 otherwise. See
|
||||
L<fips_module(7)/FIPS indicators> for more information.
|
||||
For AES-GCM encryption, an externally supplied IV makes the operation
|
||||
non-approved, so this indicator returns 0. See
|
||||
L<EVP_EncryptInit(3)/PARAMETERS> for the related "iv-generated" parameter.
|
||||
AES-GCM tag lengths are approved only when they are 4, 8, or 12 through 16
|
||||
bytes.
|
||||
|
||||
=head1 NOTES
|
||||
|
||||
|
||||
@@ -28,6 +28,12 @@ section 7.2
|
||||
|
||||
This parameter is only settable.
|
||||
|
||||
=item "fips-indicator" (B<OSSL_KEM_PARAM_FIPS_APPROVED_INDICATOR>) <integer>
|
||||
|
||||
The OpenSSL FIPS provider returns 1 if the operation is FIPS approved, or 0
|
||||
otherwise. See L<fips_module(7)/FIPS indicators> for more information.
|
||||
Supplying the test-only "ikme" parameter causes this indicator to return 0.
|
||||
|
||||
=back
|
||||
|
||||
This can be set when using EVP_PKEY_encapsulate_init().
|
||||
@@ -54,7 +60,7 @@ This functionality was added in OpenSSL 3.5.
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
Copyright 2024-2025 The OpenSSL Project Authors. All Rights Reserved.
|
||||
Copyright 2024-2026 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
|
||||
|
||||
@@ -77,7 +77,7 @@ The length of the "size" parameter is equal to that of an B<unsigned int>.
|
||||
Gets the MAC block size. The "block-size" parameter can also be retrieved with
|
||||
EVP_MAC_CTX_get_block_size().
|
||||
|
||||
=item "fips-indicator" (B<OSSL_CIPHER_PARAM_FIPS_APPROVED_INDICATOR>) <integer>
|
||||
=item "fips-indicator" (B<OSSL_MAC_PARAM_FIPS_APPROVED_INDICATOR>) <integer>
|
||||
|
||||
This option is used by the OpenSSL FIPS provider.
|
||||
|
||||
@@ -94,7 +94,7 @@ L<EVP_MAC(3)/PARAMETERS>, L<OSSL_PARAM(3)>
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
Copyright 2018-2024 The OpenSSL Project Authors. All Rights Reserved.
|
||||
Copyright 2018-2026 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
|
||||
|
||||
@@ -61,6 +61,11 @@ EVP_MAC_CTX_get_params():
|
||||
|
||||
Gets the MAC size.
|
||||
|
||||
=item "fips-indicator" (B<OSSL_MAC_PARAM_FIPS_APPROVED_INDICATOR>) <integer>
|
||||
|
||||
The OpenSSL FIPS provider returns 1 if the operation is FIPS approved, or 0
|
||||
otherwise. See L<fips_module(7)/FIPS indicators> for more information.
|
||||
|
||||
=back
|
||||
|
||||
The "size" parameter can also be retrieved with EVP_MAC_CTX_get_mac_size().
|
||||
@@ -73,7 +78,7 @@ L<EVP_MAC(3)/PARAMETERS>, L<OSSL_PARAM(3)>
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
Copyright 2018-2021 The OpenSSL Project Authors. All Rights Reserved.
|
||||
Copyright 2018-2026 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
|
||||
|
||||
@@ -85,7 +85,7 @@ The length of the "size" parameter is equal to that of an B<unsigned int>.
|
||||
Gets the MAC block size. The "block-size" parameter can also be retrieved with
|
||||
EVP_MAC_CTX_get_block_size().
|
||||
|
||||
=item "fips-indicator" (B<OSSL_KDF_PARAM_FIPS_APPROVED_INDICATOR>) <integer>
|
||||
=item "fips-indicator" (B<OSSL_MAC_PARAM_FIPS_APPROVED_INDICATOR>) <integer>
|
||||
|
||||
See L<provider-mac(7)/Mac Parameters>.
|
||||
|
||||
@@ -98,7 +98,7 @@ L<EVP_MAC(3)/PARAMETERS>, L<OSSL_PARAM(3)>, L<HMAC(3)>
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
Copyright 2018-2024 The OpenSSL Project Authors. All Rights Reserved.
|
||||
Copyright 2018-2026 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
|
||||
|
||||
@@ -46,7 +46,7 @@ Gets the MAC size.
|
||||
|
||||
=back
|
||||
|
||||
The "size" parameter can also be retrieved with with EVP_MAC_CTX_get_mac_size().
|
||||
The "size" parameter can also be retrieved with EVP_MAC_CTX_get_mac_size().
|
||||
The length of the "size" parameter should not exceed that of an B<unsigned int>.
|
||||
|
||||
=head1 NOTES
|
||||
@@ -63,7 +63,7 @@ L<EVP_MAC(3)/PARAMETERS>, L<OSSL_PARAM(3)>
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
Copyright 2018-2021 The OpenSSL Project Authors. All Rights Reserved.
|
||||
Copyright 2018-2026 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
|
||||
|
||||
@@ -46,13 +46,27 @@ This value can also be retrieved with L<EVP_MD_get_flags(3)>.
|
||||
|
||||
=back
|
||||
|
||||
=head2 FIPS indicator
|
||||
|
||||
Digest implementations in the OpenSSL FIPS provider make the following
|
||||
parameter available with L<EVP_MD_CTX_get_params(3)>:
|
||||
|
||||
=over 4
|
||||
|
||||
=item "fips-indicator" (B<OSSL_DIGEST_PARAM_FIPS_APPROVED_INDICATOR>) <integer>
|
||||
|
||||
Returns 1 if the operation is FIPS approved, or 0 otherwise.
|
||||
See L<fips_module(7)/FIPS indicators> for more information.
|
||||
|
||||
=back
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<EVP_DigestInit(3)/PARAMETERS>, L<EVP_MD_get_params(3)>, L<provider-digest(7)>
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
Copyright 2020-2024 The OpenSSL Project Authors. All Rights Reserved.
|
||||
Copyright 2020-2026 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
|
||||
|
||||
@@ -130,6 +130,20 @@ Where s is the security strength of the key which has values of
|
||||
|
||||
=back
|
||||
|
||||
=head2 DH and DHX key generation FIPS indicator
|
||||
|
||||
The following key generation parameter can be retrieved with
|
||||
L<EVP_PKEY_CTX_get_params(3)> from the OpenSSL FIPS provider:
|
||||
|
||||
=over 4
|
||||
|
||||
=item "fips-indicator" (B<OSSL_PKEY_PARAM_FIPS_APPROVED_INDICATOR>) <integer>
|
||||
|
||||
Returns 1 if the operation is FIPS approved, or 0 otherwise.
|
||||
See L<fips_module(7)/FIPS indicators> for more information.
|
||||
|
||||
=back
|
||||
|
||||
=head2 DH and DHX key validation
|
||||
|
||||
For keys that are not a named group the FIPS186-4 standard specifies that the
|
||||
@@ -329,7 +343,7 @@ L<OSSL_PROVIDER-FIPS(7)>
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
Copyright 2020-2024 The OpenSSL Project Authors. All Rights Reserved.
|
||||
Copyright 2020-2026 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
|
||||
|
||||
@@ -79,13 +79,27 @@ The name of a cipher to be used when generating the MAC.
|
||||
|
||||
=back
|
||||
|
||||
=head2 MAC key generation FIPS indicator
|
||||
|
||||
The following key generation parameter can be retrieved with
|
||||
L<EVP_PKEY_CTX_get_params(3)> for HMAC and CMAC in the OpenSSL FIPS provider:
|
||||
|
||||
=over 4
|
||||
|
||||
=item "fips-indicator" (B<OSSL_PKEY_PARAM_FIPS_APPROVED_INDICATOR>) <integer>
|
||||
|
||||
Returns 1 if the operation is FIPS approved, or 0 otherwise.
|
||||
See L<fips_module(7)/FIPS indicators> for more information.
|
||||
|
||||
=back
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<EVP_KEYMGMT(3)>, L<EVP_PKEY(3)>, L<provider-keymgmt(7)>
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
Copyright 2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||
Copyright 2020-2026 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
|
||||
|
||||
@@ -53,6 +53,18 @@ ML-DSA hashing operations.
|
||||
|
||||
Use L<EVP_PKEY_CTX_set_params(3)> after calling L<EVP_PKEY_keygen_init(3)>.
|
||||
|
||||
The following key generation parameter can be retrieved with
|
||||
L<EVP_PKEY_CTX_get_params(3)> from the OpenSSL FIPS provider:
|
||||
|
||||
=over 4
|
||||
|
||||
=item "fips-indicator" (B<OSSL_PKEY_PARAM_FIPS_APPROVED_INDICATOR>) <integer>
|
||||
|
||||
Returns 1 if the operation is FIPS approved, or 0 otherwise.
|
||||
See L<fips_module(7)/FIPS indicators> for more information.
|
||||
|
||||
=back
|
||||
|
||||
=head2 Common ML-DSA parameters
|
||||
|
||||
In addition to the common parameters that all keytypes should support (see
|
||||
@@ -295,7 +307,7 @@ This functionality was added in OpenSSL 3.5.
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
|
||||
Copyright 2025-2026 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
|
||||
|
||||
@@ -53,6 +53,18 @@ Use L<EVP_PKEY_CTX_set_params(3)> after calling L<EVP_PKEY_keygen_init(3)>.
|
||||
|
||||
=back
|
||||
|
||||
The following key generation parameter can be retrieved with
|
||||
L<EVP_PKEY_CTX_get_params(3)> from the OpenSSL FIPS provider:
|
||||
|
||||
=over 4
|
||||
|
||||
=item "fips-indicator" (B<OSSL_PKEY_PARAM_FIPS_APPROVED_INDICATOR>) <integer>
|
||||
|
||||
Returns 1 if the operation is FIPS approved, or 0 otherwise.
|
||||
See L<fips_module(7)/FIPS indicators> for more information.
|
||||
|
||||
=back
|
||||
|
||||
=head2 Common parameters
|
||||
|
||||
In addition to the common parameters that all keytypes should support (see
|
||||
@@ -315,7 +327,7 @@ This functionality was added in OpenSSL 3.5.
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
Copyright 2024-2025 The OpenSSL Project Authors. All Rights Reserved.
|
||||
Copyright 2024-2026 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
|
||||
|
||||
@@ -143,6 +143,22 @@ OSSL_KEYMGMT_SELECT_PRIVATE_KEY is not set in the selection parameter.
|
||||
|
||||
=back
|
||||
|
||||
=head2 RSA key generation FIPS indicator
|
||||
|
||||
The following key generation parameter can be retrieved with
|
||||
L<EVP_PKEY_CTX_get_params(3)> from the OpenSSL FIPS provider:
|
||||
|
||||
=over 4
|
||||
|
||||
=item "fips-indicator" (B<OSSL_PKEY_PARAM_FIPS_APPROVED_INDICATOR>) <integer>
|
||||
|
||||
Returns 1 if the operation is FIPS approved, or 0 otherwise.
|
||||
See L<fips_module(7)/FIPS indicators> for more information.
|
||||
Using any of the FIPS module testing parameters described below causes this
|
||||
indicator to return 0.
|
||||
|
||||
=back
|
||||
|
||||
=head2 RSA key generation parameters for FIPS module testing
|
||||
|
||||
When generating RSA keys, the following additional key generation parameters may
|
||||
@@ -273,7 +289,7 @@ L<EVP_RSA_gen(3)>, L<EVP_KEYMGMT(3)>, L<EVP_PKEY(3)>, L<provider-keymgmt(7)>
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
Copyright 2020-2024 The OpenSSL Project Authors. All Rights Reserved.
|
||||
Copyright 2020-2026 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
|
||||
|
||||
@@ -75,6 +75,18 @@ SLH-DSA hashing operations.
|
||||
|
||||
Use EVP_PKEY_CTX_set_params() after calling EVP_PKEY_keygen_init().
|
||||
|
||||
The following key generation parameter can be retrieved with
|
||||
L<EVP_PKEY_CTX_get_params(3)> from the OpenSSL FIPS provider:
|
||||
|
||||
=over 4
|
||||
|
||||
=item "fips-indicator" (B<OSSL_PKEY_PARAM_FIPS_APPROVED_INDICATOR>) <integer>
|
||||
|
||||
Returns 1 if the operation is FIPS approved, or 0 otherwise.
|
||||
See L<fips_module(7)/FIPS indicators> for more information.
|
||||
|
||||
=back
|
||||
|
||||
=head2 Common SLH-DSA parameters
|
||||
|
||||
In addition to the common parameters that all keytypes should support (see
|
||||
@@ -146,7 +158,7 @@ This functionality was added in OpenSSL 3.5.
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
Copyright 2024-2025 The OpenSSL Project Authors. All Rights Reserved.
|
||||
Copyright 2024-2026 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
|
||||
|
||||
@@ -36,7 +36,7 @@ are supported:
|
||||
|
||||
These parameters work as described in L<EVP_RAND(3)/PARAMETERS>.
|
||||
|
||||
=item "fips-indicator" (B<OSSL_DRBG_PARAM_FIPS_APPROVED_INDICATOR>) <integer>
|
||||
=item "fips-indicator" (B<OSSL_RAND_PARAM_FIPS_APPROVED_INDICATOR>) <integer>
|
||||
|
||||
This parameter works as described in L<provider-rand(7)/PARAMETERS>.
|
||||
|
||||
@@ -62,7 +62,7 @@ This functionality was added in OpenSSL 3.4.
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
Copyright 2024 The OpenSSL Project Authors. All Rights Reserved.
|
||||
Copyright 2024-2026 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
|
||||
|
||||
@@ -56,6 +56,11 @@ This Boolean indicates if a derivation function should be used or not.
|
||||
A nonzero value (the default) uses the derivation function. A zero value
|
||||
does not.
|
||||
|
||||
=item "fips-indicator" (B<OSSL_DRBG_PARAM_FIPS_APPROVED_INDICATOR>) <integer>
|
||||
|
||||
The OpenSSL FIPS provider returns 1 if the operation is FIPS approved, or 0
|
||||
otherwise. See L<fips_module(7)/FIPS indicators> for more information.
|
||||
|
||||
=back
|
||||
|
||||
=head1 NOTES
|
||||
@@ -103,7 +108,7 @@ L<EVP_RAND(3)/PARAMETERS>
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
Copyright 2020-2025 The OpenSSL Project Authors. All Rights Reserved.
|
||||
Copyright 2020-2026 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
|
||||
|
||||
@@ -33,6 +33,10 @@ The supported parameters are:
|
||||
|
||||
=item "max_request" (B<OSSL_RAND_PARAM_MAX_REQUEST>) <unsigned integer>
|
||||
|
||||
=item "fips-indicator" (B<OSSL_RAND_PARAM_FIPS_APPROVED_INDICATOR>) <integer>
|
||||
|
||||
This parameter is available in the FIPS provider and returns 1.
|
||||
|
||||
These parameters work as described in L<EVP_RAND(3)/PARAMETERS>.
|
||||
|
||||
=back
|
||||
@@ -92,7 +96,7 @@ L<EVP_RAND(3)/PARAMETERS>
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
Copyright 2024 The OpenSSL Project Authors. All Rights Reserved.
|
||||
Copyright 2024-2026 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
|
||||
|
||||
@@ -98,6 +98,11 @@ EVP_PKEY_CTX_get_params().
|
||||
|
||||
=item * "context-string" (B<OSSL_SIGNATURE_PARAM_CONTEXT_STRING>) <octet string>
|
||||
|
||||
=item * "fips-indicator" (B<OSSL_SIGNATURE_PARAM_FIPS_APPROVED_INDICATOR>) <integer>
|
||||
|
||||
The OpenSSL FIPS provider returns 1 if the operation is FIPS approved, or 0
|
||||
otherwise. See L<fips_module(7)/FIPS indicators> for more information.
|
||||
|
||||
=back
|
||||
|
||||
The parameters are described in L<provider-signature(7)>.
|
||||
|
||||
@@ -23,6 +23,18 @@ L<EVP_MAC-CMAC(7)> for details.
|
||||
L<EVP_PKEY-CMAC(7)> for details about parameters that are supported during the
|
||||
creation of an EVP_PKEY.
|
||||
|
||||
For HMAC and CMAC, the OpenSSL FIPS provider also makes the following
|
||||
parameter available with L<EVP_PKEY_CTX_get_params(3)>:
|
||||
|
||||
=over 4
|
||||
|
||||
=item "fips-indicator" (B<OSSL_SIGNATURE_PARAM_FIPS_APPROVED_INDICATOR>) <integer>
|
||||
|
||||
Returns 1 if the operation is FIPS approved, or 0 otherwise.
|
||||
See L<fips_module(7)/FIPS indicators> for more information.
|
||||
|
||||
=back
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<EVP_MAC_init(3)>,
|
||||
|
||||
@@ -85,6 +85,22 @@ Algorithm 3 step 5 are omitted when this setting is 1.
|
||||
|
||||
See L<EVP_PKEY-ML-DSA(7)> for information related to B<ML-DSA> keys.
|
||||
|
||||
=head2 FIPS indicator
|
||||
|
||||
The following parameter can be retrieved using
|
||||
L<EVP_PKEY_CTX_get_params(3)>:
|
||||
|
||||
=over 4
|
||||
|
||||
=item "fips-indicator" (B<OSSL_SIGNATURE_PARAM_FIPS_APPROVED_INDICATOR>) <integer>
|
||||
|
||||
The OpenSSL FIPS provider returns 1 if the operation is FIPS approved, or 0
|
||||
otherwise. See L<fips_module(7)/FIPS indicators> for more information.
|
||||
Supplying "test-entropy", or setting the test-only "message-encoding"
|
||||
parameter to 0, causes this indicator to return 0.
|
||||
|
||||
=back
|
||||
|
||||
=head1 NOTES
|
||||
|
||||
For backwards compatibility reasons EVP_DigestSignInit_ex(), EVP_DigestSign(),
|
||||
|
||||
@@ -81,6 +81,22 @@ instead. This value is ignored if "test-entropy" is set.
|
||||
|
||||
See L<EVP_PKEY-SLH-DSA(7)> for information related to B<SLH-DSA> keys.
|
||||
|
||||
=head2 FIPS indicator
|
||||
|
||||
The following parameter can be retrieved using
|
||||
L<EVP_PKEY_CTX_get_params(3)>:
|
||||
|
||||
=over 4
|
||||
|
||||
=item "fips-indicator" (B<OSSL_SIGNATURE_PARAM_FIPS_APPROVED_INDICATOR>) <integer>
|
||||
|
||||
The OpenSSL FIPS provider returns 1 if the operation is FIPS approved, or 0
|
||||
otherwise. See L<fips_module(7)/FIPS indicators> for more information.
|
||||
Supplying the test-only "test-entropy" parameter causes this indicator to
|
||||
return 0.
|
||||
|
||||
=back
|
||||
|
||||
=head1 NOTES
|
||||
|
||||
For backwards compatibility reasons EVP_DigestSignInit_ex(), EVP_DigestSign(),
|
||||
|
||||
@@ -45,7 +45,10 @@ rather than other FIPS capable providers.
|
||||
|
||||
Algorithms that are fetched using "fips=yes" may still be unapproved if certain
|
||||
conditions are not met. See L<fips_module(7)/FIPS indicators> for additional
|
||||
information.
|
||||
information. Every C<fips=yes> algorithm implementation supplied by this
|
||||
provider exposes a gettable "fips-indicator" context parameter and returns 1
|
||||
when the operation is approved. Applications must not treat a missing
|
||||
indicator as an assertion of FIPS approval.
|
||||
|
||||
=head2 Provider parameters
|
||||
|
||||
@@ -590,7 +593,7 @@ This functionality was added in OpenSSL 3.0.
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
Copyright 2019-2025 The OpenSSL Project Authors. All Rights Reserved.
|
||||
Copyright 2019-2026 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
|
||||
|
||||
@@ -488,8 +488,19 @@ can be queried using an algorithm context getter to retrieve the indicator
|
||||
An example of an algorithm context setter is "key-check"
|
||||
in L<EVP_KDF-HKDF(7)/Supported parameters>.
|
||||
|
||||
The following algorithms use "fips-indicator" to query if the algorithm
|
||||
is approved:
|
||||
Every algorithm implementation advertised with the property C<fips=yes> by
|
||||
the OpenSSL FIPS provider exposes "fips-indicator" as a gettable context
|
||||
parameter. The getter returns 1 when the operation is approved. An absent
|
||||
indicator must not be interpreted as approval.
|
||||
|
||||
Algorithms advertised with C<fips=no> are unapproved. When such an
|
||||
implementation exposes "fips-indicator", its getter returns 0. Providers
|
||||
other than the OpenSSL FIPS provider are not required to expose this parameter;
|
||||
an absent indicator, or an indicator value of 0, does not assert FIPS approval.
|
||||
|
||||
Some algorithms can change from approved to unapproved as a result of their
|
||||
parameters or the operation performed. The following algorithms perform such
|
||||
additional checks:
|
||||
|
||||
=over 4
|
||||
|
||||
@@ -511,6 +522,23 @@ See L<EVP_SIGNATURE-ECDSA(7)/ECDSA Signature Parameters>
|
||||
|
||||
See L<EVP_PKEY-EC(7)/Common EC parameters>
|
||||
|
||||
=item ML-KEM Key Encapsulation
|
||||
|
||||
Supplying the test-only "ikme" parameter makes the operation unapproved.
|
||||
See L<EVP_KEM-ML-KEM(7)/ML-KEM KEM parameters>.
|
||||
|
||||
=item ML-DSA and SLH-DSA Signatures
|
||||
|
||||
Supplying test entropy makes the operation unapproved. ML-DSA operations
|
||||
that disable the standard message encoding are also unapproved.
|
||||
See L<EVP_SIGNATURE-ML-DSA(7)/FIPS indicator> and
|
||||
L<EVP_SIGNATURE-SLH-DSA(7)/FIPS indicator>.
|
||||
|
||||
=item RSA Key Generation
|
||||
|
||||
Supplying the parameters reserved for FIPS module testing makes the operation
|
||||
unapproved. See L<EVP_PKEY-RSA(7)/RSA key generation FIPS indicator>.
|
||||
|
||||
=item RSA Encryption
|
||||
|
||||
"pkcs1" padding is no longer approved.
|
||||
@@ -563,6 +591,11 @@ internally for non security purposes.
|
||||
|
||||
=item X25519 and X448 Key Generation and Key Exchange
|
||||
|
||||
=item X448MLKEM1024 Key Generation and Key Encapsulation
|
||||
|
||||
The other hybrid ML-KEM algorithms supplied by the FIPS provider are approved,
|
||||
including X25519MLKEM768, SecP256r1MLKEM768 and SecP384r1MLKEM1024.
|
||||
|
||||
=back
|
||||
|
||||
The unapproved (non FIPS validated) algorithms have a property query value of
|
||||
@@ -576,11 +609,16 @@ indicator callback.
|
||||
=item AES-GCM ciphers support the indicator "iv-generated"
|
||||
|
||||
See L<EVP_EncryptInit(3)/PARAMETERS> for further information.
|
||||
The AES-GCM "fips-indicator" also accounts for the IV source and returns 0
|
||||
after encryption with an externally supplied IV. It also returns 0 for GCM
|
||||
tag lengths other than 4, 8, or 12 through 16 bytes.
|
||||
|
||||
=item ECDSA and RSA Signatures support the indicator "verify-message".
|
||||
|
||||
See L<EVP_SIGNATURE-ECDSA(7)/ECDSA Signature Parameters> and
|
||||
L<EVP_SIGNATURE-RSA(7)/Signature Parameters> /for further information.
|
||||
L<EVP_SIGNATURE-RSA(7)/Signature Parameters> for further information.
|
||||
The signature "fips-indicator" also accounts for this value and returns 0
|
||||
when verification is performed directly on a caller-supplied digest.
|
||||
|
||||
=back
|
||||
|
||||
|
||||
@@ -439,7 +439,7 @@ are handled in a timely manner. See B<THREAD ASSISTED MODE> for details.
|
||||
Ensure that your usage of L<SSL_want(3)>, L<SSL_want_read(3)> and
|
||||
L<SSL_want_write(3)> reflects the API changes described in B<CHANGES TO EXISTING
|
||||
APIS>. In particular, you should use these APIs to determine the ability of a
|
||||
QUIC stream to receive or provide application data, not to to determine if
|
||||
QUIC stream to receive or provide application data, not to determine if
|
||||
network I/O is required.
|
||||
|
||||
=item
|
||||
|
||||
@@ -247,7 +247,7 @@ Finally we associate the B<SSL> object we created earlier with the B<BIO> using
|
||||
the L<SSL_set_bio(3)> function. Note that this passes ownership of the B<BIO>
|
||||
object to the B<SSL> object. Once ownership is passed the SSL object is
|
||||
responsible for its management and will free it automatically when the B<SSL> is
|
||||
freed. So, once L<SSL_set_bio(3)> has been been called, you should not call
|
||||
freed. So, once L<SSL_set_bio(3)> has been called, you should not call
|
||||
L<BIO_free(3)> on the B<BIO>.
|
||||
|
||||
SSL_set_bio(ssl, bio, bio);
|
||||
@@ -578,7 +578,7 @@ L<ossl-guide-tls-client-non-block(7)>, L<ossl-guide-quic-client-block(7)>
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
Copyright 2023-2024 The OpenSSL Project Authors. All Rights Reserved.
|
||||
Copyright 2023-2026 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
|
||||
|
||||
@@ -165,7 +165,7 @@ provider side digest context I<dctx> to I<params>.
|
||||
Any parameter settings are additional to any that were previously set.
|
||||
Passing NULL for I<params> should return true.
|
||||
|
||||
OSSL_FUNC_digest_get_ctx_params() gets digest operation details details from
|
||||
OSSL_FUNC_digest_get_ctx_params() gets digest operation details from
|
||||
the given provider side digest context I<dctx> and stores them in I<params>.
|
||||
Passing NULL for I<params> should return true.
|
||||
|
||||
@@ -249,6 +249,17 @@ values associated with the give provider side digest context I<dctx>
|
||||
and stores them in I<params>.
|
||||
See L<OSSL_PARAM(3)> for further details on the parameters structure.
|
||||
|
||||
The OpenSSL FIPS provider supports the following gettable context parameter:
|
||||
|
||||
=over 4
|
||||
|
||||
=item "fips-indicator" (B<OSSL_DIGEST_PARAM_FIPS_APPROVED_INDICATOR>) <integer>
|
||||
|
||||
Returns 1 if the operation is FIPS approved, or 0 otherwise.
|
||||
See L<fips_module(7)/FIPS indicators> for more information.
|
||||
|
||||
=back
|
||||
|
||||
=head1 RETURN VALUES
|
||||
|
||||
OSSL_FUNC_digest_newctx() and OSSL_FUNC_digest_dupctx() should return the newly created
|
||||
@@ -285,10 +296,11 @@ L<life_cycle-digest(7)>, L<EVP_DigestInit(3)>
|
||||
|
||||
The provider DIGEST interface was introduced in OpenSSL 3.0.
|
||||
OSSL_FUNC_digest_copyctx() was added in 3.5 version.
|
||||
The "fips-indicator" context parameter was added in OpenSSL 3.5.9.
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
Copyright 2019-2025 The OpenSSL Project Authors. All Rights Reserved.
|
||||
Copyright 2019-2026 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
|
||||
|
||||
@@ -224,7 +224,7 @@ else()
|
||||
set(OPENSSL_CRYPTO_LIBRARIES ${OPENSSL_CRYPTO_LIBRARY})
|
||||
set(OPENSSL_SSL_LIBRARY ${OPENSSL_LIBSSL_SHARED})
|
||||
set(OPENSSL_SSL_LIBRARIES ${OPENSSL_SSL_LIBRARY})
|
||||
set(OPENSSL_LIBRARIES ${OPENSSL_SSL_LIBRARIES})
|
||||
set(OPENSSL_LIBRARIES ${OPENSSL_SSL_LIBRARIES} ${OPENSSL_CRYPTO_LIBRARIES})
|
||||
{- output_on() if $lib_info{libcrypto}->{shared_import}; "" -}
|
||||
{- output_on() if $no_shared; "" -}
|
||||
endif()
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014-2025 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 2014-2026 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
|
||||
@@ -18,6 +18,7 @@ BIGNUM *bn_wexpand(BIGNUM *a, int words);
|
||||
BIGNUM *bn_expand2(BIGNUM *a, int words);
|
||||
|
||||
void bn_correct_top(BIGNUM *a);
|
||||
int bn_set_top_fixed(BIGNUM *a, int words);
|
||||
|
||||
/*
|
||||
* Determine the modified width-(w+1) Non-Adjacent Form (wNAF) of 'scalar'.
|
||||
|
||||
@@ -20,52 +20,52 @@ extern "C" {
|
||||
|
||||
#define SPARSE_ARRAY_OF(type) struct sparse_array_st_##type
|
||||
|
||||
#define DEFINE_SPARSE_ARRAY_OF_INTERNAL(type, ctype) \
|
||||
SPARSE_ARRAY_OF(type); \
|
||||
static ossl_unused ossl_inline SPARSE_ARRAY_OF(type) * ossl_sa_##type##_new(void) \
|
||||
{ \
|
||||
return (SPARSE_ARRAY_OF(type) *)ossl_sa_new(); \
|
||||
} \
|
||||
static ossl_unused ossl_inline void \
|
||||
ossl_sa_##type##_free(SPARSE_ARRAY_OF(type) * sa) \
|
||||
{ \
|
||||
ossl_sa_free((OPENSSL_SA *)sa); \
|
||||
} \
|
||||
static ossl_unused ossl_inline void \
|
||||
ossl_sa_##type##_free_leaves(SPARSE_ARRAY_OF(type) * sa) \
|
||||
{ \
|
||||
ossl_sa_free_leaves((OPENSSL_SA *)sa); \
|
||||
} \
|
||||
static ossl_unused ossl_inline size_t \
|
||||
ossl_sa_##type##_num(const SPARSE_ARRAY_OF(type) * sa) \
|
||||
{ \
|
||||
return ossl_sa_num((OPENSSL_SA *)sa); \
|
||||
} \
|
||||
static ossl_unused ossl_inline void \
|
||||
ossl_sa_##type##_doall(const SPARSE_ARRAY_OF(type) * sa, \
|
||||
void (*leaf)(ossl_uintmax_t, type *)) \
|
||||
{ \
|
||||
ossl_sa_doall((OPENSSL_SA *)sa, \
|
||||
(void (*)(ossl_uintmax_t, void *))leaf); \
|
||||
} \
|
||||
static ossl_unused ossl_inline void \
|
||||
ossl_sa_##type##_doall_arg(const SPARSE_ARRAY_OF(type) * sa, \
|
||||
void (*leaf)(ossl_uintmax_t, type *, void *), \
|
||||
void *arg) \
|
||||
{ \
|
||||
ossl_sa_doall_arg((OPENSSL_SA *)sa, \
|
||||
(void (*)(ossl_uintmax_t, void *, void *))leaf, arg); \
|
||||
} \
|
||||
static ossl_unused ossl_inline ctype *ossl_sa_##type##_get(const SPARSE_ARRAY_OF(type) * sa, ossl_uintmax_t n) \
|
||||
{ \
|
||||
return (type *)ossl_sa_get((OPENSSL_SA *)sa, n); \
|
||||
} \
|
||||
static ossl_unused ossl_inline int \
|
||||
ossl_sa_##type##_set(SPARSE_ARRAY_OF(type) * sa, \
|
||||
ossl_uintmax_t n, ctype *val) \
|
||||
{ \
|
||||
return ossl_sa_set((OPENSSL_SA *)sa, n, (void *)val); \
|
||||
} \
|
||||
#define DEFINE_SPARSE_ARRAY_OF_INTERNAL(type, ctype) \
|
||||
SPARSE_ARRAY_OF(type); \
|
||||
static ossl_unused ossl_inline SPARSE_ARRAY_OF(type) *ossl_sa_##type##_new(void) \
|
||||
{ \
|
||||
return (SPARSE_ARRAY_OF(type) *)ossl_sa_new(); \
|
||||
} \
|
||||
static ossl_unused ossl_inline void \
|
||||
ossl_sa_##type##_free(SPARSE_ARRAY_OF(type) *sa) \
|
||||
{ \
|
||||
ossl_sa_free((OPENSSL_SA *)sa); \
|
||||
} \
|
||||
static ossl_unused ossl_inline void \
|
||||
ossl_sa_##type##_free_leaves(SPARSE_ARRAY_OF(type) *sa) \
|
||||
{ \
|
||||
ossl_sa_free_leaves((OPENSSL_SA *)sa); \
|
||||
} \
|
||||
static ossl_unused ossl_inline size_t \
|
||||
ossl_sa_##type##_num(const SPARSE_ARRAY_OF(type) *sa) \
|
||||
{ \
|
||||
return ossl_sa_num((OPENSSL_SA *)sa); \
|
||||
} \
|
||||
static ossl_unused ossl_inline void \
|
||||
ossl_sa_##type##_doall(const SPARSE_ARRAY_OF(type) *sa, \
|
||||
void (*leaf)(ossl_uintmax_t, type *)) \
|
||||
{ \
|
||||
ossl_sa_doall((OPENSSL_SA *)sa, \
|
||||
(void (*)(ossl_uintmax_t, void *))leaf); \
|
||||
} \
|
||||
static ossl_unused ossl_inline void \
|
||||
ossl_sa_##type##_doall_arg(const SPARSE_ARRAY_OF(type) *sa, \
|
||||
void (*leaf)(ossl_uintmax_t, type *, void *), \
|
||||
void *arg) \
|
||||
{ \
|
||||
ossl_sa_doall_arg((OPENSSL_SA *)sa, \
|
||||
(void (*)(ossl_uintmax_t, void *, void *))leaf, arg); \
|
||||
} \
|
||||
static ossl_unused ossl_inline ctype *ossl_sa_##type##_get(const SPARSE_ARRAY_OF(type) *sa, ossl_uintmax_t n) \
|
||||
{ \
|
||||
return (type *)ossl_sa_get((OPENSSL_SA *)sa, n); \
|
||||
} \
|
||||
static ossl_unused ossl_inline int \
|
||||
ossl_sa_##type##_set(SPARSE_ARRAY_OF(type) *sa, \
|
||||
ossl_uintmax_t n, ctype *val) \
|
||||
{ \
|
||||
return ossl_sa_set((OPENSSL_SA *)sa, n, (void *)val); \
|
||||
} \
|
||||
SPARSE_ARRAY_OF(type)
|
||||
|
||||
#define DEFINE_SPARSE_ARRAY_OF(type) \
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2015-2025 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 2015-2026 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
|
||||
@@ -14,6 +14,7 @@
|
||||
#include "internal/refcount.h"
|
||||
#include <openssl/asn1.h>
|
||||
#include <openssl/x509.h>
|
||||
#include <openssl/x509v3.h>
|
||||
#include <openssl/conf.h>
|
||||
#include "crypto/types.h"
|
||||
|
||||
@@ -313,6 +314,8 @@ int ossl_a2i_ipadd(unsigned char *ipout, const char *ipasc);
|
||||
int ossl_x509_set1_time(int *modified, ASN1_TIME **ptm, const ASN1_TIME *tm);
|
||||
int ossl_x509_print_ex_brief(BIO *bio, X509 *cert, unsigned long neg_cflags);
|
||||
int ossl_x509v3_cache_extensions(X509 *x);
|
||||
X509_NAME *ossl_dist_point_name_full(const struct DIST_POINT_NAME_st *dpn,
|
||||
const X509_NAME *iname);
|
||||
int ossl_x509_init_sig_info(X509 *x);
|
||||
|
||||
int ossl_x509_set0_libctx(X509 *x, OSSL_LIB_CTX *libctx, const char *propq);
|
||||
|
||||
@@ -25,28 +25,28 @@
|
||||
(p) != NULL; \
|
||||
(p) = ossl_list_##name##_next(p))
|
||||
#define OSSL_LIST_FOREACH(p, name, l) \
|
||||
OSSL_LIST_FOREACH_FROM(p, name, ossl_list_##name##_head(l))
|
||||
OSSL_LIST_FOREACH_FROM (p, name, ossl_list_##name##_head(l))
|
||||
|
||||
#define OSSL_LIST_FOREACH_REV_FROM(p, name, init) \
|
||||
for ((p) = (init); \
|
||||
(p) != NULL; \
|
||||
(p) = ossl_list_##name##_prev(p))
|
||||
#define OSSL_LIST_FOREACH_REV(p, name, l) \
|
||||
OSSL_LIST_FOREACH_FROM(p, name, ossl_list_##name##_tail(l))
|
||||
OSSL_LIST_FOREACH_FROM (p, name, ossl_list_##name##_tail(l))
|
||||
|
||||
#define OSSL_LIST_FOREACH_DELSAFE_FROM(p, pn, name, init) \
|
||||
for ((p) = (init); \
|
||||
(p) != NULL && (((pn) = ossl_list_##name##_next(p)), 1); \
|
||||
(p) = (pn))
|
||||
#define OSSL_LIST_FOREACH_DELSAFE(p, pn, name, l) \
|
||||
OSSL_LIST_FOREACH_DELSAFE_FROM(p, pn, name, ossl_list_##name##_head(l))
|
||||
OSSL_LIST_FOREACH_DELSAFE_FROM (p, pn, name, ossl_list_##name##_head(l))
|
||||
|
||||
#define OSSL_LIST_FOREACH_REV_DELSAFE_FROM(p, pn, name, init) \
|
||||
for ((p) = (init); \
|
||||
(p) != NULL && (((pn) = ossl_list_##name##_prev(p)), 1); \
|
||||
(p) = (pn))
|
||||
#define OSSL_LIST_FOREACH_REV_DELSAFE(p, pn, name, l) \
|
||||
OSSL_LIST_FOREACH_REV_DELSAFE_FROM(p, pn, name, ossl_list_##name##_tail(l))
|
||||
OSSL_LIST_FOREACH_REV_DELSAFE_FROM (p, pn, name, ossl_list_##name##_tail(l))
|
||||
|
||||
/* Define a list structure */
|
||||
#define OSSL_LIST(name) OSSL_LIST_##name
|
||||
@@ -67,7 +67,7 @@
|
||||
|
||||
#define DEFINE_LIST_OF_IMPL(name, type) \
|
||||
static ossl_unused ossl_inline void \
|
||||
ossl_list_##name##_init(OSSL_LIST(name) * list) \
|
||||
ossl_list_##name##_init(OSSL_LIST(name) *list) \
|
||||
{ \
|
||||
memset(list, 0, sizeof(*list)); \
|
||||
} \
|
||||
@@ -78,24 +78,24 @@
|
||||
sizeof(elem->ossl_list_##name)); \
|
||||
} \
|
||||
static ossl_unused ossl_inline int \
|
||||
ossl_list_##name##_is_empty(const OSSL_LIST(name) * list) \
|
||||
ossl_list_##name##_is_empty(const OSSL_LIST(name) *list) \
|
||||
{ \
|
||||
return list->num_elems == 0; \
|
||||
} \
|
||||
static ossl_unused ossl_inline size_t \
|
||||
ossl_list_##name##_num(const OSSL_LIST(name) * list) \
|
||||
ossl_list_##name##_num(const OSSL_LIST(name) *list) \
|
||||
{ \
|
||||
return list->num_elems; \
|
||||
} \
|
||||
static ossl_unused ossl_inline type * \
|
||||
ossl_list_##name##_head(const OSSL_LIST(name) * list) \
|
||||
ossl_list_##name##_head(const OSSL_LIST(name) *list) \
|
||||
{ \
|
||||
assert(list->alpha == NULL \
|
||||
|| list->alpha->ossl_list_##name.list == list); \
|
||||
return list->alpha; \
|
||||
} \
|
||||
static ossl_unused ossl_inline type * \
|
||||
ossl_list_##name##_tail(const OSSL_LIST(name) * list) \
|
||||
ossl_list_##name##_tail(const OSSL_LIST(name) *list) \
|
||||
{ \
|
||||
assert(list->omega == NULL \
|
||||
|| list->omega->ossl_list_##name.list == list); \
|
||||
@@ -120,7 +120,7 @@
|
||||
return elem->ossl_list_##name.prev; \
|
||||
} \
|
||||
static ossl_unused ossl_inline void \
|
||||
ossl_list_##name##_remove(OSSL_LIST(name) * list, type * elem) \
|
||||
ossl_list_##name##_remove(OSSL_LIST(name) *list, type *elem) \
|
||||
{ \
|
||||
assert(elem->ossl_list_##name.list == list); \
|
||||
OSSL_LIST_DBG(elem->ossl_list_##name.list = NULL) \
|
||||
@@ -137,7 +137,7 @@
|
||||
sizeof(elem->ossl_list_##name)); \
|
||||
} \
|
||||
static ossl_unused ossl_inline void \
|
||||
ossl_list_##name##_insert_head(OSSL_LIST(name) * list, type * elem) \
|
||||
ossl_list_##name##_insert_head(OSSL_LIST(name) *list, type *elem) \
|
||||
{ \
|
||||
assert(elem->ossl_list_##name.list == NULL); \
|
||||
OSSL_LIST_DBG(elem->ossl_list_##name.list = list) \
|
||||
@@ -151,7 +151,7 @@
|
||||
list->num_elems++; \
|
||||
} \
|
||||
static ossl_unused ossl_inline void \
|
||||
ossl_list_##name##_insert_tail(OSSL_LIST(name) * list, type * elem) \
|
||||
ossl_list_##name##_insert_tail(OSSL_LIST(name) *list, type *elem) \
|
||||
{ \
|
||||
assert(elem->ossl_list_##name.list == NULL); \
|
||||
OSSL_LIST_DBG(elem->ossl_list_##name.list = list) \
|
||||
@@ -165,8 +165,8 @@
|
||||
list->num_elems++; \
|
||||
} \
|
||||
static ossl_unused ossl_inline void \
|
||||
ossl_list_##name##_insert_before(OSSL_LIST(name) * list, type * e, \
|
||||
type * elem) \
|
||||
ossl_list_##name##_insert_before(OSSL_LIST(name) *list, type *e, \
|
||||
type *elem) \
|
||||
{ \
|
||||
assert(elem->ossl_list_##name.list == NULL); \
|
||||
OSSL_LIST_DBG(elem->ossl_list_##name.list = list) \
|
||||
@@ -180,8 +180,8 @@
|
||||
list->num_elems++; \
|
||||
} \
|
||||
static ossl_unused ossl_inline void \
|
||||
ossl_list_##name##_insert_after(OSSL_LIST(name) * list, type * e, \
|
||||
type * elem) \
|
||||
ossl_list_##name##_insert_after(OSSL_LIST(name) *list, type *e, \
|
||||
type *elem) \
|
||||
{ \
|
||||
assert(elem->ossl_list_##name.list == NULL); \
|
||||
OSSL_LIST_DBG(elem->ossl_list_##name.list = list) \
|
||||
@@ -195,7 +195,7 @@
|
||||
list->num_elems++; \
|
||||
} \
|
||||
static ossl_unused ossl_inline void \
|
||||
ossl_list_##name##_join(OSSL_LIST(name) * lh, OSSL_LIST(name) * lt) \
|
||||
ossl_list_##name##_join(OSSL_LIST(name) *lh, OSSL_LIST(name) *lt) \
|
||||
{ \
|
||||
OSSL_LIST_DBG(type * _p); /* local variable '_p' when debug */ \
|
||||
if (lt == NULL || lh == NULL || lt->num_elems == 0 || lh == lt) \
|
||||
|
||||
@@ -0,0 +1,265 @@
|
||||
/*
|
||||
* Copyright 2026 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright (c) 2016 David Gwynne <david@gwynne.id.au>
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
/*
|
||||
* The code here comes from David Gwynne <david@gwynne.id.au>. The original
|
||||
* version can be found:
|
||||
* https://github.com/dgwynne/data-structures/
|
||||
* file bst.h. The same code is also part of OpenBSD OS where it is shipped
|
||||
* under BSD license.
|
||||
*
|
||||
* David Gwynne agrees to include modified version to OpenSSL and ship it
|
||||
* under OpenSSL Apache 2.0 license.
|
||||
*/
|
||||
#ifndef _OSSL_INTERNAL_RBTREE_H_
|
||||
#define _OSSL_INTERNAL_RBTREE_H_
|
||||
|
||||
#include "internal/e_os.h"
|
||||
|
||||
/*
|
||||
* List of changes against upstream version:
|
||||
* augmentation mechanism is removed in OpenSSL as there is no demand for it
|
||||
*
|
||||
* prefix changed from rb/rbt to ossl_rbt
|
||||
*
|
||||
* debug version of OSSL_RBT_REMOVE() sets parent, left, right members
|
||||
* to NULL
|
||||
*
|
||||
* cstyle is changed to match OpenSSL.
|
||||
*/
|
||||
struct ossl_rbt_type {
|
||||
int (*t_compare)(const void *, const void *);
|
||||
uintptr_t t_offset; /* offset of ossl_rbt_entry in type */
|
||||
};
|
||||
|
||||
struct ossl_rbt_tree {
|
||||
struct ossl_rbt_entry *rb_root;
|
||||
};
|
||||
|
||||
struct ossl_rbt_entry {
|
||||
struct ossl_rbt_entry *rb_parent;
|
||||
struct ossl_rbt_entry *rb_left;
|
||||
struct ossl_rbt_entry *rb_right;
|
||||
unsigned int rb_color;
|
||||
};
|
||||
|
||||
#define OSSL_RBT_HEAD(_name, _type) \
|
||||
struct _name { \
|
||||
struct ossl_rbt_tree rbh_root; \
|
||||
}
|
||||
|
||||
#define OSSL_RBT_ENTRY(_type) struct ossl_rbt_entry
|
||||
|
||||
static ossl_inline void
|
||||
ossl_rbt_init(struct ossl_rbt_tree *rb)
|
||||
{
|
||||
rb->rb_root = NULL;
|
||||
}
|
||||
|
||||
static ossl_inline int
|
||||
ossl_rbt_empty(struct ossl_rbt_tree *rb)
|
||||
{
|
||||
return rb->rb_root == NULL;
|
||||
}
|
||||
|
||||
void *ossl_rbt_insert(const struct ossl_rbt_type *, struct ossl_rbt_tree *, void *);
|
||||
void *ossl_rbt_remove(const struct ossl_rbt_type *, struct ossl_rbt_tree *, void *);
|
||||
void *ossl_rbt_find(const struct ossl_rbt_type *, struct ossl_rbt_tree *, const void *);
|
||||
void *ossl_rbt_nfind(const struct ossl_rbt_type *, struct ossl_rbt_tree *, const void *);
|
||||
void *ossl_rbt_root(const struct ossl_rbt_type *, struct ossl_rbt_tree *);
|
||||
void *ossl_rbt_min(const struct ossl_rbt_type *, struct ossl_rbt_tree *);
|
||||
void *ossl_rbt_max(const struct ossl_rbt_type *, struct ossl_rbt_tree *);
|
||||
void *ossl_rbt_next(const struct ossl_rbt_type *, void *);
|
||||
void *ossl_rbt_prev(const struct ossl_rbt_type *, void *);
|
||||
void *ossl_rbt_left(const struct ossl_rbt_type *, void *);
|
||||
void *ossl_rbt_right(const struct ossl_rbt_type *, void *);
|
||||
void *ossl_rbt_parent(const struct ossl_rbt_type *, void *);
|
||||
void ossl_rbt_set_left(const struct ossl_rbt_type *, void *, void *);
|
||||
void ossl_rbt_set_right(const struct ossl_rbt_type *, void *, void *);
|
||||
void ossl_rbt_set_parent(const struct ossl_rbt_type *, void *, void *);
|
||||
void ossl_rbt_init_rbe(const struct ossl_rbt_type *, void *);
|
||||
|
||||
#define OSSL_RBT_INITIALIZER(_head) \
|
||||
{ \
|
||||
{ \
|
||||
NULL \
|
||||
} \
|
||||
}
|
||||
|
||||
#define OSSL_RBT_PROTOTYPE(_name, _type, _field, _cmp) \
|
||||
extern const struct ossl_rbt_type *const _name##_OSSL_RBT_TYPE; \
|
||||
\
|
||||
ossl_unused static ossl_inline void \
|
||||
_name##_OSSL_RBT_INIT(struct _name *head) \
|
||||
{ \
|
||||
ossl_rbt_init(&head->rbh_root); \
|
||||
} \
|
||||
\
|
||||
ossl_unused static ossl_inline struct _type * \
|
||||
_name##_OSSL_RBT_INSERT(struct _name *head, struct _type *elm) \
|
||||
{ \
|
||||
return ossl_rbt_insert(_name##_OSSL_RBT_TYPE, &head->rbh_root, elm); \
|
||||
} \
|
||||
\
|
||||
ossl_unused static ossl_inline struct _type * \
|
||||
_name##_OSSL_RBT_REMOVE(struct _name *head, struct _type *elm) \
|
||||
{ \
|
||||
return ossl_rbt_remove(_name##_OSSL_RBT_TYPE, &head->rbh_root, elm); \
|
||||
} \
|
||||
\
|
||||
ossl_unused static ossl_inline struct _type * \
|
||||
_name##_OSSL_RBT_FIND(struct _name *head, const struct _type *key) \
|
||||
{ \
|
||||
return ossl_rbt_find(_name##_OSSL_RBT_TYPE, &head->rbh_root, key); \
|
||||
} \
|
||||
\
|
||||
ossl_unused static ossl_inline struct _type * \
|
||||
_name##_OSSL_RBT_NFIND(struct _name *head, const struct _type *key) \
|
||||
{ \
|
||||
return ossl_rbt_nfind(_name##_OSSL_RBT_TYPE, &head->rbh_root, key); \
|
||||
} \
|
||||
\
|
||||
ossl_unused static ossl_inline struct _type * \
|
||||
_name##_OSSL_RBT_ROOT(struct _name *head) \
|
||||
{ \
|
||||
return ossl_rbt_root(_name##_OSSL_RBT_TYPE, &head->rbh_root); \
|
||||
} \
|
||||
\
|
||||
ossl_unused static ossl_inline int \
|
||||
_name##_OSSL_RBT_EMPTY(struct _name *head) \
|
||||
{ \
|
||||
return ossl_rbt_empty(&head->rbh_root); \
|
||||
} \
|
||||
\
|
||||
ossl_unused static ossl_inline struct _type * \
|
||||
_name##_OSSL_RBT_MIN(struct _name *head) \
|
||||
{ \
|
||||
return ossl_rbt_min(_name##_OSSL_RBT_TYPE, &head->rbh_root); \
|
||||
} \
|
||||
\
|
||||
ossl_unused static ossl_inline struct _type * \
|
||||
_name##_OSSL_RBT_MAX(struct _name *head) \
|
||||
{ \
|
||||
return ossl_rbt_max(_name##_OSSL_RBT_TYPE, &head->rbh_root); \
|
||||
} \
|
||||
\
|
||||
ossl_unused static ossl_inline struct _type * \
|
||||
_name##_OSSL_RBT_NEXT(struct _type *elm) \
|
||||
{ \
|
||||
return ossl_rbt_next(_name##_OSSL_RBT_TYPE, elm); \
|
||||
} \
|
||||
\
|
||||
ossl_unused static ossl_inline struct _type * \
|
||||
_name##_OSSL_RBT_PREV(struct _type *elm) \
|
||||
{ \
|
||||
return ossl_rbt_prev(_name##_OSSL_RBT_TYPE, elm); \
|
||||
} \
|
||||
\
|
||||
ossl_unused static ossl_inline struct _type * \
|
||||
_name##_OSSL_RBT_LEFT(struct _type *elm) \
|
||||
{ \
|
||||
return ossl_rbt_left(_name##_OSSL_RBT_TYPE, elm); \
|
||||
} \
|
||||
\
|
||||
ossl_unused static ossl_inline struct _type * \
|
||||
_name##_OSSL_RBT_RIGHT(struct _type *elm) \
|
||||
{ \
|
||||
return ossl_rbt_right(_name##_OSSL_RBT_TYPE, elm); \
|
||||
} \
|
||||
\
|
||||
ossl_unused static ossl_inline struct _type * \
|
||||
_name##_OSSL_RBT_PARENT(struct _type *elm) \
|
||||
{ \
|
||||
return ossl_rbt_parent(_name##_OSSL_RBT_TYPE, elm); \
|
||||
} \
|
||||
\
|
||||
ossl_unused static ossl_inline void \
|
||||
_name##_OSSL_RBT_SET_LEFT(struct _type *elm, struct _type *left) \
|
||||
{ \
|
||||
ossl_rbt_set_left(_name##_OSSL_RBT_TYPE, elm, left); \
|
||||
} \
|
||||
\
|
||||
ossl_unused static ossl_inline void \
|
||||
_name##_OSSL_RBT_SET_RIGHT(struct _type *elm, struct _type *right) \
|
||||
{ \
|
||||
ossl_rbt_set_right(_name##_OSSL_RBT_TYPE, elm, right); \
|
||||
} \
|
||||
\
|
||||
ossl_unused static ossl_inline void \
|
||||
_name##_OSSL_RBT_SET_PARENT(struct _type *elm, struct _type *parent) \
|
||||
{ \
|
||||
ossl_rbt_set_parent(_name##_OSSL_RBT_TYPE, elm, parent); \
|
||||
} \
|
||||
ossl_unused static ossl_inline void \
|
||||
_name##_OSSL_RBT_INIT_RBE(struct _type *elm) \
|
||||
{ \
|
||||
ossl_rbt_init_rbe(_name##_OSSL_RBT_TYPE, elm); \
|
||||
}
|
||||
|
||||
#define OSSL_RBT_GENERATE_INTERNAL(_name, _type, _field, _cmp) \
|
||||
static int \
|
||||
_name##_OSSL_RBT_COMPARE(const void *lptr, const void *rptr) \
|
||||
{ \
|
||||
const struct _type *l = lptr, *r = rptr; \
|
||||
return _cmp(l, r); \
|
||||
} \
|
||||
static const struct ossl_rbt_type _name##_OSSL_RBT_INFO = { \
|
||||
_name##_OSSL_RBT_COMPARE, \
|
||||
offsetof(struct _type, _field), \
|
||||
}; \
|
||||
const struct ossl_rbt_type *const _name##_OSSL_RBT_TYPE = &_name##_OSSL_RBT_INFO
|
||||
|
||||
#define OSSL_RBT_GENERATE(_name, _type, _field, _cmp) \
|
||||
OSSL_RBT_GENERATE_INTERNAL(_name, _type, _field, _cmp)
|
||||
|
||||
#define OSSL_RBT_INIT(_name, _head) _name##_OSSL_RBT_INIT(_head)
|
||||
#define OSSL_RBT_INSERT(_name, _head, _elm) _name##_OSSL_RBT_INSERT(_head, _elm)
|
||||
#define OSSL_RBT_REMOVE(_name, _head, _elm) _name##_OSSL_RBT_REMOVE(_head, _elm)
|
||||
#define OSSL_RBT_FIND(_name, _head, _key) _name##_OSSL_RBT_FIND(_head, _key)
|
||||
#define OSSL_RBT_NFIND(_name, _head, _key) _name##_OSSL_RBT_NFIND(_head, _key)
|
||||
#define OSSL_RBT_ROOT(_name, _head) _name##_OSSL_RBT_ROOT(_head)
|
||||
#define OSSL_RBT_EMPTY(_name, _head) _name##_OSSL_RBT_EMPTY(_head)
|
||||
#define OSSL_RBT_MIN(_name, _head) _name##_OSSL_RBT_MIN(_head)
|
||||
#define OSSL_RBT_MAX(_name, _head) _name##_OSSL_RBT_MAX(_head)
|
||||
#define OSSL_RBT_NEXT(_name, _elm) _name##_OSSL_RBT_NEXT(_elm)
|
||||
#define OSSL_RBT_PREV(_name, _elm) _name##_OSSL_RBT_PREV(_elm)
|
||||
#define OSSL_RBT_LEFT(_name, _elm) _name##_OSSL_RBT_LEFT(_elm)
|
||||
#define OSSL_RBT_RIGHT(_name, _elm) _name##_OSSL_RBT_RIGHT(_elm)
|
||||
#define OSSL_RBT_PARENT(_name, _elm) _name##_OSSL_RBT_PARENT(_elm)
|
||||
#define OSSL_RBT_SET_LEFT(_name, _elm, _l) _name##_OSSL_RBT_SET_LEFT(_elm, _l)
|
||||
#define OSSL_RBT_SET_RIGHT(_name, _elm, _r) _name##_OSSL_RBT_SET_RIGHT(_elm, _r)
|
||||
#define OSSL_RBT_SET_PARENT(_name, _elm, _p) _name##_OSSL_RBT_SET_PARENT(_elm, _p)
|
||||
#ifndef NDEBUG
|
||||
#define OSSL_RBT_INIT_RBE(_name, _elm) _name##_OSSL_RBT_INIT_RBE(_elm)
|
||||
#else
|
||||
#define OSSL_RBT_INIT_RBE(_name, _elm) (void)(0)
|
||||
#endif
|
||||
|
||||
#define OSSL_RBT_FOREACH(_e, _name, _head) \
|
||||
for ((_e) = OSSL_RBT_MIN(_name, (_head)); \
|
||||
(_e) != NULL; \
|
||||
(_e) = OSSL_RBT_NEXT(_name, (_e)))
|
||||
|
||||
#define OSSL_RBT_FOREACH_SAFE(_e, _name, _head, _n) \
|
||||
for ((_e) = OSSL_RBT_MIN(_name, (_head)); \
|
||||
(_e) != NULL && ((_n) = OSSL_RBT_NEXT(_name, (_e)), 1); \
|
||||
(_e) = (_n))
|
||||
|
||||
#define OSSL_RBT_FOREACH_REVERSE(_e, _name, _head) \
|
||||
for ((_e) = OSSL_RBT_MAX(_name, (_head)); \
|
||||
(_e) != NULL; \
|
||||
(_e) = OSSL_RBT_PREV(_name, (_e)))
|
||||
|
||||
#define OSSL_RBT_FOREACH_REVERSE_SAFE(_e, _name, _head, _n) \
|
||||
for ((_e) = OSSL_RBT_MAX(_name, (_head)); \
|
||||
(_e) != NULL && ((_n) = OSSL_RBT_PREV(_name, (_e)), 1); \
|
||||
(_e) = (_n))
|
||||
|
||||
#endif /* _OSSL_INTERNAL_RBTREE_H_ */
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2022 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 2022-2026 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
|
||||
@@ -16,56 +16,56 @@
|
||||
|
||||
#define PRIORITY_QUEUE_OF(type) OSSL_PRIORITY_QUEUE_##type
|
||||
|
||||
#define DEFINE_PRIORITY_QUEUE_OF_INTERNAL(type, ctype) \
|
||||
typedef struct ossl_priority_queue_st_##type PRIORITY_QUEUE_OF(type); \
|
||||
static ossl_unused ossl_inline PRIORITY_QUEUE_OF(type) * ossl_pqueue_##type##_new(int (*compare)(const ctype *, const ctype *)) \
|
||||
{ \
|
||||
return (PRIORITY_QUEUE_OF(type) *)ossl_pqueue_new( \
|
||||
(int (*)(const void *, const void *))compare); \
|
||||
} \
|
||||
static ossl_unused ossl_inline void \
|
||||
ossl_pqueue_##type##_free(PRIORITY_QUEUE_OF(type) * pq) \
|
||||
{ \
|
||||
ossl_pqueue_free((OSSL_PQUEUE *)pq); \
|
||||
} \
|
||||
static ossl_unused ossl_inline void \
|
||||
ossl_pqueue_##type##_pop_free(PRIORITY_QUEUE_OF(type) * pq, \
|
||||
void (*freefunc)(ctype *)) \
|
||||
{ \
|
||||
ossl_pqueue_pop_free((OSSL_PQUEUE *)pq, (void (*)(void *))freefunc); \
|
||||
} \
|
||||
static ossl_unused ossl_inline int \
|
||||
ossl_pqueue_##type##_reserve(PRIORITY_QUEUE_OF(type) * pq, size_t n) \
|
||||
{ \
|
||||
return ossl_pqueue_reserve((OSSL_PQUEUE *)pq, n); \
|
||||
} \
|
||||
static ossl_unused ossl_inline size_t \
|
||||
ossl_pqueue_##type##_num(const PRIORITY_QUEUE_OF(type) * pq) \
|
||||
{ \
|
||||
return ossl_pqueue_num((OSSL_PQUEUE *)pq); \
|
||||
} \
|
||||
static ossl_unused ossl_inline int \
|
||||
ossl_pqueue_##type##_push(PRIORITY_QUEUE_OF(type) * pq, \
|
||||
ctype * data, size_t *elem) \
|
||||
{ \
|
||||
return ossl_pqueue_push((OSSL_PQUEUE *)pq, (void *)data, elem); \
|
||||
} \
|
||||
static ossl_unused ossl_inline ctype * \
|
||||
ossl_pqueue_##type##_peek(const PRIORITY_QUEUE_OF(type) * pq) \
|
||||
{ \
|
||||
return (type *)ossl_pqueue_peek((OSSL_PQUEUE *)pq); \
|
||||
} \
|
||||
static ossl_unused ossl_inline ctype * \
|
||||
ossl_pqueue_##type##_pop(PRIORITY_QUEUE_OF(type) * pq) \
|
||||
{ \
|
||||
return (type *)ossl_pqueue_pop((OSSL_PQUEUE *)pq); \
|
||||
} \
|
||||
static ossl_unused ossl_inline ctype * \
|
||||
ossl_pqueue_##type##_remove(PRIORITY_QUEUE_OF(type) * pq, \
|
||||
size_t elem) \
|
||||
{ \
|
||||
return (type *)ossl_pqueue_remove((OSSL_PQUEUE *)pq, elem); \
|
||||
} \
|
||||
#define DEFINE_PRIORITY_QUEUE_OF_INTERNAL(type, ctype) \
|
||||
typedef struct ossl_priority_queue_st_##type PRIORITY_QUEUE_OF(type); \
|
||||
static ossl_unused ossl_inline PRIORITY_QUEUE_OF(type) *ossl_pqueue_##type##_new(int (*compare)(const ctype *, const ctype *)) \
|
||||
{ \
|
||||
return (PRIORITY_QUEUE_OF(type) *)ossl_pqueue_new( \
|
||||
(int (*)(const void *, const void *))compare); \
|
||||
} \
|
||||
static ossl_unused ossl_inline void \
|
||||
ossl_pqueue_##type##_free(PRIORITY_QUEUE_OF(type) *pq) \
|
||||
{ \
|
||||
ossl_pqueue_free((OSSL_PQUEUE *)pq); \
|
||||
} \
|
||||
static ossl_unused ossl_inline void \
|
||||
ossl_pqueue_##type##_pop_free(PRIORITY_QUEUE_OF(type) *pq, \
|
||||
void (*freefunc)(ctype *)) \
|
||||
{ \
|
||||
ossl_pqueue_pop_free((OSSL_PQUEUE *)pq, (void (*)(void *))freefunc); \
|
||||
} \
|
||||
static ossl_unused ossl_inline int \
|
||||
ossl_pqueue_##type##_reserve(PRIORITY_QUEUE_OF(type) *pq, size_t n) \
|
||||
{ \
|
||||
return ossl_pqueue_reserve((OSSL_PQUEUE *)pq, n); \
|
||||
} \
|
||||
static ossl_unused ossl_inline size_t \
|
||||
ossl_pqueue_##type##_num(const PRIORITY_QUEUE_OF(type) *pq) \
|
||||
{ \
|
||||
return ossl_pqueue_num((OSSL_PQUEUE *)pq); \
|
||||
} \
|
||||
static ossl_unused ossl_inline int \
|
||||
ossl_pqueue_##type##_push(PRIORITY_QUEUE_OF(type) *pq, \
|
||||
ctype *data, size_t *elem) \
|
||||
{ \
|
||||
return ossl_pqueue_push((OSSL_PQUEUE *)pq, (void *)data, elem); \
|
||||
} \
|
||||
static ossl_unused ossl_inline ctype * \
|
||||
ossl_pqueue_##type##_peek(const PRIORITY_QUEUE_OF(type) *pq) \
|
||||
{ \
|
||||
return (type *)ossl_pqueue_peek((OSSL_PQUEUE *)pq); \
|
||||
} \
|
||||
static ossl_unused ossl_inline ctype * \
|
||||
ossl_pqueue_##type##_pop(PRIORITY_QUEUE_OF(type) *pq) \
|
||||
{ \
|
||||
return (type *)ossl_pqueue_pop((OSSL_PQUEUE *)pq); \
|
||||
} \
|
||||
static ossl_unused ossl_inline ctype * \
|
||||
ossl_pqueue_##type##_remove(PRIORITY_QUEUE_OF(type) *pq, \
|
||||
size_t elem) \
|
||||
{ \
|
||||
return (type *)ossl_pqueue_remove((OSSL_PQUEUE *)pq, elem); \
|
||||
} \
|
||||
struct ossl_priority_queue_st_##type
|
||||
|
||||
#define DEFINE_PRIORITY_QUEUE_OF(type) \
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2023-2025 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 2023-2026 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
|
||||
@@ -44,6 +44,7 @@ typedef struct quic_conn_st QUIC_CONNECTION;
|
||||
typedef struct quic_xso_st QUIC_XSO;
|
||||
typedef struct quic_listener_st QUIC_LISTENER;
|
||||
typedef struct quic_domain_st QUIC_DOMAIN;
|
||||
typedef struct quic_rstream_qparm_st QUIC_RSTREAM_QPARM;
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1,151 +0,0 @@
|
||||
/*
|
||||
* Copyright 2022-2023 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
|
||||
*/
|
||||
|
||||
#ifndef OSSL_QUIC_SF_LIST_H
|
||||
#define OSSL_QUIC_SF_LIST_H
|
||||
|
||||
#include "internal/common.h"
|
||||
#include "internal/uint_set.h"
|
||||
#include "internal/quic_record_rx.h"
|
||||
|
||||
/*
|
||||
* Stream frame list
|
||||
* =================
|
||||
*
|
||||
* This data structure supports similar operations as uint64 set but
|
||||
* it has slightly different invariants and also carries data associated with
|
||||
* the ranges in the list.
|
||||
*
|
||||
* Operations:
|
||||
* Insert frame (optimized insertion at the beginning and at the end).
|
||||
* Iterated peek into the frame(s) from the beginning.
|
||||
* Dropping frames from the beginning up to an offset (exclusive).
|
||||
*
|
||||
* Invariant: The frames in the list are sorted by the start and end bounds.
|
||||
* Invariant: There are no fully overlapping frames or frames that would
|
||||
* be fully encompassed by another frame in the list.
|
||||
* Invariant: No frame has start > end.
|
||||
* Invariant: The range start is inclusive the end is exclusive to be
|
||||
* able to mark an empty frame.
|
||||
* Invariant: The offset never points further than into the first frame.
|
||||
*/
|
||||
#ifndef OPENSSL_NO_QUIC
|
||||
|
||||
typedef struct stream_frame_st STREAM_FRAME;
|
||||
|
||||
typedef struct sframe_list_st {
|
||||
STREAM_FRAME *head, *tail;
|
||||
/* Is the tail frame final. */
|
||||
unsigned int fin;
|
||||
/* Number of stream frames in the list. */
|
||||
size_t num_frames;
|
||||
/* Offset of data not yet dropped */
|
||||
uint64_t offset;
|
||||
/* Is head locked ? */
|
||||
int head_locked;
|
||||
/* Cleanse data on release? */
|
||||
int cleanse;
|
||||
} SFRAME_LIST;
|
||||
|
||||
/*
|
||||
* Initializes the stream frame list fl.
|
||||
*/
|
||||
void ossl_sframe_list_init(SFRAME_LIST *fl);
|
||||
|
||||
/*
|
||||
* Destroys the stream frame list fl releasing any data
|
||||
* still present inside it.
|
||||
*/
|
||||
void ossl_sframe_list_destroy(SFRAME_LIST *fl);
|
||||
|
||||
/*
|
||||
* Insert a stream frame data into the list.
|
||||
* The data covers an offset range (range.start is inclusive,
|
||||
* range.end is exclusive).
|
||||
* fin should be set if this is the final frame of the stream.
|
||||
* Returns an error if a frame cannot be inserted - due to
|
||||
* STREAM_FRAME allocation error, or in case of erroneous
|
||||
* fin flag (this is an ossl_assert() check so a caller must
|
||||
* check it on its own too).
|
||||
*/
|
||||
int ossl_sframe_list_insert(SFRAME_LIST *fl, UINT_RANGE *range,
|
||||
OSSL_QRX_PKT *pkt,
|
||||
const unsigned char *data, int fin);
|
||||
|
||||
/*
|
||||
* Iterator to peek at the contiguous frames at the beginning
|
||||
* of the frame list fl.
|
||||
* The *data covers an offset range (range.start is inclusive,
|
||||
* range.end is exclusive).
|
||||
* *fin is set if this is the final frame of the stream.
|
||||
* Opaque iterator *iter can be used to peek at the subsequent
|
||||
* frame if there is any without any gap before it.
|
||||
* Returns 1 on success.
|
||||
* Returns 0 if there is no further contiguous frame. In that
|
||||
* case *fin is set, if the end of the stream is reached.
|
||||
*/
|
||||
int ossl_sframe_list_peek(const SFRAME_LIST *fl, void **iter,
|
||||
UINT_RANGE *range, const unsigned char **data,
|
||||
int *fin);
|
||||
|
||||
/*
|
||||
* Drop all frames up to the offset limit.
|
||||
* Also unlocks the head frame if locked.
|
||||
* Returns 1 on success.
|
||||
* Returns 0 when trying to drop frames at offsets that were not
|
||||
* received yet. (ossl_assert() is used to check, so this is an invalid call.)
|
||||
*/
|
||||
int ossl_sframe_list_drop_frames(SFRAME_LIST *fl, uint64_t limit);
|
||||
|
||||
/*
|
||||
* Locks and returns the head frame of fl if it is readable - read offset is
|
||||
* at the beginning or middle of the frame.
|
||||
* range is set to encompass the not yet read part of the head frame,
|
||||
* data pointer is set to appropriate offset within the frame if the read
|
||||
* offset points in the middle of the frame,
|
||||
* fin is set to 1 if the head frame is also the tail frame.
|
||||
* Returns 1 on success, 0 if there is no readable data or the head
|
||||
* frame is already locked.
|
||||
*/
|
||||
int ossl_sframe_list_lock_head(SFRAME_LIST *fl, UINT_RANGE *range,
|
||||
const unsigned char **data,
|
||||
int *fin);
|
||||
|
||||
/*
|
||||
* Just returns whether the head frame is locked by previous
|
||||
* ossl_sframe_list_lock_head() call.
|
||||
*/
|
||||
int ossl_sframe_list_is_head_locked(SFRAME_LIST *fl);
|
||||
|
||||
/*
|
||||
* Callback function type to write stream frame data to some
|
||||
* side storage before the packet containing the frame data
|
||||
* is released.
|
||||
* It should return 1 on success or 0 if there is not enough
|
||||
* space available in the side storage.
|
||||
*/
|
||||
typedef int(sframe_list_write_at_cb)(uint64_t logical_offset,
|
||||
const unsigned char *buf,
|
||||
size_t buf_len,
|
||||
void *cb_arg);
|
||||
|
||||
/*
|
||||
* Move the frame data in all the stream frames in the list fl
|
||||
* from the packets to the side storage using the write_at_cb
|
||||
* callback.
|
||||
* Returns 1 if all the calls to the callback return 1.
|
||||
* If the callback returns 0, the function stops processing further
|
||||
* frames and returns 0.
|
||||
*/
|
||||
int ossl_sframe_list_move_data(SFRAME_LIST *fl,
|
||||
sframe_list_write_at_cb *write_at_cb,
|
||||
void *cb_arg);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2022-2023 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 2022-2026 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
|
||||
@@ -318,11 +318,9 @@ void ossl_quic_sstream_set_cleanse(QUIC_SSTREAM *qss, int cleanse);
|
||||
* controller and statistics module. They can be NULL for unit testing.
|
||||
* If they are non-NULL, the `rxfc` is called when receive stream data
|
||||
* is read by application. `statm` is queried for current rtt.
|
||||
* `rbuf_size` is the initial size of the ring buffer to be used
|
||||
* when ossl_quic_rstream_move_to_rbuf() is called.
|
||||
*/
|
||||
QUIC_RSTREAM *ossl_quic_rstream_new(QUIC_RXFC *rxfc,
|
||||
OSSL_STATM *statm, size_t rbuf_size);
|
||||
OSSL_STATM *statm, QUIC_RSTREAM_QPARM *rsqp);
|
||||
|
||||
/*
|
||||
* Frees a QUIC_RSTREAM and any associated storage.
|
||||
@@ -330,10 +328,10 @@ QUIC_RSTREAM *ossl_quic_rstream_new(QUIC_RXFC *rxfc,
|
||||
void ossl_quic_rstream_free(QUIC_RSTREAM *qrs);
|
||||
|
||||
/*
|
||||
* Adds received stream frame data to `qrs`. The `pkt_wrap` refcount is
|
||||
* incremented if the `data` is queued directly without copying.
|
||||
* It can be NULL for unit-testing purposes, i.e. if `data` is static or
|
||||
* never released before calling ossl_quic_rstream_free().
|
||||
* Adds received stream frame data to `qrs`. `pkt` must be the packet
|
||||
* carrying `data`; its refcount is incremented if the data is kept
|
||||
* referenced on the packet rather than copied. `pkt` and `data` can
|
||||
* be NULL only for an empty frame indicating `fin`.
|
||||
* The `offset` is the absolute offset of the data in the stream.
|
||||
* `data_len` can be 0 - can be useful for indicating `fin` for empty stream.
|
||||
* Or to indicate `fin` without any further data added to the stream.
|
||||
@@ -378,8 +376,6 @@ int ossl_quic_rstream_available(QUIC_RSTREAM *qrs, size_t *avail, int *fin);
|
||||
* Returns 1 on success (including calls if no record is available, or
|
||||
* after end of the stream - in that case *fin will be set to 1 and
|
||||
* *rec_len to 0), 0 on error.
|
||||
* It is an error to call ossl_quic_rstream_get_record() multiple times
|
||||
* without calling ossl_quic_rstream_release_record() in between.
|
||||
*/
|
||||
int ossl_quic_rstream_get_record(QUIC_RSTREAM *qrs,
|
||||
const unsigned char **record, size_t *rec_len,
|
||||
@@ -394,35 +390,26 @@ int ossl_quic_rstream_get_record(QUIC_RSTREAM *qrs,
|
||||
* call to ossl_quic_rstream_get_record() is needed to obtain further
|
||||
* stream data.
|
||||
* Returns 1 on success, 0 on error.
|
||||
* It is an error to call ossl_quic_rstream_release_record() multiple
|
||||
* times without calling ossl_quic_rstream_get_record() in between.
|
||||
*/
|
||||
int ossl_quic_rstream_release_record(QUIC_RSTREAM *qrs, size_t read_len);
|
||||
|
||||
/*
|
||||
* Moves received frame data from decrypted packets to ring buffer.
|
||||
* This should be called when there are too many decrypted packets allocated.
|
||||
* Returns 1 on success, 0 when it was not possible to release all
|
||||
* referenced packets due to an insufficient size of the ring buffer.
|
||||
* Exception is the packet from the record returned previously by
|
||||
* ossl_quic_rstream_get_record() - that one will be always skipped.
|
||||
*/
|
||||
int ossl_quic_rstream_move_to_rbuf(QUIC_RSTREAM *qrs);
|
||||
|
||||
/*
|
||||
* Resizes the internal ring buffer to a new `rbuf_size` size.
|
||||
* Returns 1 on success, 0 on error.
|
||||
* Possible error conditions are an allocation failure, trying to resize
|
||||
* the ring buffer when ossl_quic_rstream_get_record() was called and
|
||||
* not yet released, or trying to resize the ring buffer to a smaller size
|
||||
* than currently occupied.
|
||||
*/
|
||||
int ossl_quic_rstream_resize_rbuf(QUIC_RSTREAM *qrs, size_t rbuf_size);
|
||||
|
||||
/*
|
||||
* Sets flag to cleanse the buffered data when user reads it.
|
||||
*/
|
||||
void ossl_quic_rstream_set_cleanse(QUIC_RSTREAM *qrs, int cleanse);
|
||||
|
||||
/*
|
||||
* returns the number of stream chunks kept in rstream
|
||||
*/
|
||||
size_t ossl_quic_rstream_get_chunk_count(QUIC_RSTREAM *qrs);
|
||||
|
||||
/*
|
||||
* returns the number of stream ranges kept in rstream
|
||||
*/
|
||||
size_t ossl_quic_rstream_get_range_count(QUIC_RSTREAM *qrs);
|
||||
|
||||
QUIC_RSTREAM_QPARM *ossl_quic_rstream_qparm_new(QUIC_CHANNEL *ch);
|
||||
void ossl_quic_rstream_qparm_destroy(QUIC_RSTREAM_QPARM *rsqp);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -832,6 +832,15 @@ void ossl_quic_stream_map_push_accept_queue(QUIC_STREAM_MAP *qsm,
|
||||
*/
|
||||
QUIC_STREAM *ossl_quic_stream_map_peek_accept_queue(QUIC_STREAM_MAP *qsm);
|
||||
|
||||
/*
|
||||
* Retires an incoming stream for the purposes of MAX_STREAMS RXFC, so that the
|
||||
* peer is granted credit for another stream. rtt is the estimated connection
|
||||
* RTT. Must be called at most once for a given stream.
|
||||
*/
|
||||
void ossl_quic_stream_map_retire_stream_credit(QUIC_STREAM_MAP *qsm,
|
||||
QUIC_STREAM *s,
|
||||
OSSL_TIME rtt);
|
||||
|
||||
/*
|
||||
* Removes a stream from the accept queue. rtt is the estimated connection RTT.
|
||||
* The stream is retired for the purposes of MAX_STREAMS RXFC.
|
||||
|
||||
@@ -0,0 +1,90 @@
|
||||
/*
|
||||
* Copyright 2022-2026 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
|
||||
*/
|
||||
|
||||
#ifndef OSSL_QUIC_STRM_REAS_H
|
||||
#define OSSL_QUIC_STRM_REAS_H
|
||||
|
||||
#include "internal/common.h"
|
||||
#include "internal/uint_set.h"
|
||||
#include "internal/quic_record_rx.h"
|
||||
|
||||
#ifndef OPENSSL_NO_QUIC
|
||||
#include "internal/ossl_rbtree.h"
|
||||
|
||||
typedef struct sframe_set_t {
|
||||
OSSL_RBT_HEAD(srange, sframe_set_t)
|
||||
ranges;
|
||||
/* Is the tail frame final. */
|
||||
unsigned int fin;
|
||||
uint64_t fin_off;
|
||||
/* Number of stream frames in the list. */
|
||||
size_t stream_ranges;
|
||||
size_t stream_chunks;
|
||||
/* Offset of data not yet dropped */
|
||||
uint64_t offset;
|
||||
/* Cleanse data on release? */
|
||||
int cleanse;
|
||||
int move_buffers;
|
||||
QUIC_RSTREAM_QPARM *rsqp;
|
||||
} SFRAME_SET;
|
||||
|
||||
/*
|
||||
* Initializes the stream frame list fs.
|
||||
*/
|
||||
void ossl_sframe_set_init(SFRAME_SET *fs, QUIC_RSTREAM_QPARM *rsqp);
|
||||
|
||||
/*
|
||||
* Destroys the stream frame list fs releasing any data
|
||||
* still present inside it.
|
||||
*/
|
||||
void ossl_sframe_set_destroy_ranges(SFRAME_SET *fs);
|
||||
|
||||
/*
|
||||
* Insert a stream frame data into the list.
|
||||
* The data covers an offset range (range.start is inclusive,
|
||||
* range.end is exclusive).
|
||||
* fin should be set if this is the final frame of the stream.
|
||||
* Returns an error if a frame cannot be inserted - due to
|
||||
* STREAM_FRAME allocation error, or in case of erroneous
|
||||
* fin flag.
|
||||
*/
|
||||
int ossl_sframe_set_insert(SFRAME_SET *fs, UINT_RANGE *range,
|
||||
OSSL_QRX_PKT *pkt,
|
||||
const unsigned char *data, int fin);
|
||||
|
||||
/*
|
||||
* Iterator to peek at the contiguous frames at the beginning
|
||||
* of the frame set (the first stream range).
|
||||
* The *data covers an offset range (range.start is inclusive,
|
||||
* range.end is exclusive).
|
||||
* *fin is set if this is the final frame of the stream.
|
||||
* Opaque iterator *iter can be used to peek at the subsequent
|
||||
* frame if there is any without any gap before it.
|
||||
* Returns 1 on success.
|
||||
* Returns 0 if there is no further contiguous frame. In that
|
||||
* case *fin is set, if the end of the stream is reached.
|
||||
*/
|
||||
int ossl_sframe_set_peek(SFRAME_SET *fs, void **iter,
|
||||
UINT_RANGE *range, const unsigned char **data,
|
||||
int *fin);
|
||||
|
||||
/*
|
||||
* moves reading offset to new position, discarding all consumed
|
||||
* chunks (which end offset is less than offset).
|
||||
*/
|
||||
int ossl_sframe_set_move_offset(SFRAME_SET *fs, uint64_t offset);
|
||||
|
||||
/*
|
||||
* returns how many bytes is available to read from stream.
|
||||
*/
|
||||
int ossl_sframe_set_avail(SFRAME_SET *fs, uint64_t *avail, int *fin);
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2024 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 2016-2026 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
|
||||
@@ -103,27 +103,28 @@ static __inline__ int CRYPTO_GET_REF(CRYPTO_REF_COUNT *refcnt, int *ret)
|
||||
}
|
||||
|
||||
#elif defined(__ICL) && defined(_WIN32)
|
||||
#include <intrin.h>
|
||||
#define HAVE_ATOMICS 1
|
||||
|
||||
typedef struct {
|
||||
volatile int val;
|
||||
volatile long val;
|
||||
} CRYPTO_REF_COUNT;
|
||||
|
||||
static __inline int CRYPTO_UP_REF(CRYPTO_REF_COUNT *refcnt, int *ret)
|
||||
{
|
||||
*ret = _InterlockedExchangeAdd((void *)&refcnt->val, 1) + 1;
|
||||
*ret = _InterlockedExchangeAdd(&refcnt->val, 1) + 1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
static __inline int CRYPTO_DOWN_REF(CRYPTO_REF_COUNT *refcnt, int *ret)
|
||||
{
|
||||
*ret = _InterlockedExchangeAdd((void *)&refcnt->val, -1) - 1;
|
||||
*ret = _InterlockedExchangeAdd(&refcnt->val, -1) - 1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
static __inline int CRYPTO_GET_REF(CRYPTO_REF_COUNT *refcnt, int *ret)
|
||||
{
|
||||
*ret = _InterlockedExchangeAdd((void *)&refcnt->val, 0);
|
||||
*ret = _InterlockedExchangeAdd(&refcnt->val, 0);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -132,7 +133,7 @@ static __inline int CRYPTO_GET_REF(CRYPTO_REF_COUNT *refcnt, int *ret)
|
||||
#define HAVE_ATOMICS 1
|
||||
|
||||
typedef struct {
|
||||
volatile int val;
|
||||
volatile long val;
|
||||
} CRYPTO_REF_COUNT;
|
||||
|
||||
#if (defined(_M_ARM) && _M_ARM >= 7 && !defined(_WIN32_WCE)) || defined(_M_ARM64)
|
||||
@@ -155,7 +156,7 @@ static __inline int CRYPTO_DOWN_REF(CRYPTO_REF_COUNT *refcnt, int *ret)
|
||||
|
||||
static __inline int CRYPTO_GET_REF(CRYPTO_REF_COUNT *refcnt, int *ret)
|
||||
{
|
||||
*ret = _InterlockedExchangeAdd_acq((void *)&refcnt->val, 0);
|
||||
*ret = _InterlockedExchangeAdd_acq(&refcnt->val, 0);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2019-2025 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 2019-2026 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
|
||||
@@ -32,7 +32,7 @@ typedef struct tls_group_constants_st {
|
||||
int maxtls; /* Maximum TLS version (or 0 for undefined) */
|
||||
int mindtls; /* Minimum DTLS version, -1 unsupported */
|
||||
int maxdtls; /* Maximum DTLS version (or 0 for undefined) */
|
||||
int is_kem; /* Indicates utility as KEM */
|
||||
unsigned int is_kem; /* Indicates utility as KEM */
|
||||
} TLS_GROUP_CONSTANTS;
|
||||
|
||||
/*
|
||||
@@ -109,14 +109,14 @@ static const TLS_GROUP_CONSTANTS group_list[] = {
|
||||
OSSL_PARAM_uint(OSSL_CAPABILITY_TLS_GROUP_SECURITY_BITS, \
|
||||
(unsigned int *)&group_list[idx].secbits), \
|
||||
OSSL_PARAM_int(OSSL_CAPABILITY_TLS_GROUP_MIN_TLS, \
|
||||
(unsigned int *)&group_list[idx].mintls), \
|
||||
(int *)&group_list[idx].mintls), \
|
||||
OSSL_PARAM_int(OSSL_CAPABILITY_TLS_GROUP_MAX_TLS, \
|
||||
(unsigned int *)&group_list[idx].maxtls), \
|
||||
(int *)&group_list[idx].maxtls), \
|
||||
OSSL_PARAM_int(OSSL_CAPABILITY_TLS_GROUP_MIN_DTLS, \
|
||||
(unsigned int *)&group_list[idx].mindtls), \
|
||||
(int *)&group_list[idx].mindtls), \
|
||||
OSSL_PARAM_int(OSSL_CAPABILITY_TLS_GROUP_MAX_DTLS, \
|
||||
(unsigned int *)&group_list[idx].maxdtls), \
|
||||
OSSL_PARAM_int(OSSL_CAPABILITY_TLS_GROUP_IS_KEM, \
|
||||
(int *)&group_list[idx].maxdtls), \
|
||||
OSSL_PARAM_uint(OSSL_CAPABILITY_TLS_GROUP_IS_KEM, \
|
||||
(unsigned int *)&group_list[idx].is_kem), \
|
||||
OSSL_PARAM_END \
|
||||
}
|
||||
@@ -302,13 +302,13 @@ static const TLS_SIGALG_CONSTANTS sigalg_constants_list[3] = {
|
||||
OSSL_PARAM_uint(OSSL_CAPABILITY_TLS_SIGALG_SECURITY_BITS, \
|
||||
(unsigned int *)&sigalg_constants_list[idx].sec_bits), \
|
||||
OSSL_PARAM_int(OSSL_CAPABILITY_TLS_SIGALG_MIN_TLS, \
|
||||
(unsigned int *)&sigalg_constants_list[idx].min_tls), \
|
||||
(int *)&sigalg_constants_list[idx].min_tls), \
|
||||
OSSL_PARAM_int(OSSL_CAPABILITY_TLS_SIGALG_MAX_TLS, \
|
||||
(unsigned int *)&sigalg_constants_list[idx].max_tls), \
|
||||
(int *)&sigalg_constants_list[idx].max_tls), \
|
||||
OSSL_PARAM_int(OSSL_CAPABILITY_TLS_SIGALG_MIN_DTLS, \
|
||||
(unsigned int *)&sigalg_constants_list[idx].min_dtls), \
|
||||
(int *)&sigalg_constants_list[idx].min_dtls), \
|
||||
OSSL_PARAM_int(OSSL_CAPABILITY_TLS_SIGALG_MAX_DTLS, \
|
||||
(unsigned int *)&sigalg_constants_list[idx].max_dtls), \
|
||||
(int *)&sigalg_constants_list[idx].max_dtls), \
|
||||
OSSL_PARAM_END \
|
||||
}
|
||||
|
||||
|
||||
@@ -95,7 +95,7 @@ f1e98f178356791a3d54f586c19d1639d8e89b2cf6e6a4de783327ceada296a2 crypto/bn/bn_e
|
||||
ce5219203bf869561297978d6d416357a441864cd801865503dfd455c481960c crypto/bn/bn_exp2.c
|
||||
18ac3f6fe64225f72243689199839ea2ce2aa61d80b084bc4cd9efe1c7cc9d89 crypto/bn/bn_gcd.c
|
||||
b643fdcd91ad7dfcfa97a0bb235221b024b8a77faa7890f0bcb9681ea2c64c49 crypto/bn/bn_gf2m.c
|
||||
73ee247467879d4ec984c9900dfe7761233c5b889b8762be37c7e8fdd6d1d210 crypto/bn/bn_intern.c
|
||||
b736a80e3b66f414a803a36ab0c4b9333cf70fda21d873c4584450dfaac52902 crypto/bn/bn_intern.c
|
||||
ff147e5e032cc7c772b73a91fc6e24d8d9516e642d29354445d1f82d64b1d924 crypto/bn/bn_kron.c
|
||||
c4bae573e4e7132106b1151e8983cb63200dd9e49dc464e805f0fc50d55374d0 crypto/bn/bn_lib.c
|
||||
cd7bade0f2e223fe34f6e2f8cc87098ac8f0af96ec62ada5e67f6a2344d48ef0 crypto/bn/bn_local.h
|
||||
@@ -189,7 +189,7 @@ b94eb087740dde2bf697cfbc5e8a17efd80e84c5072c9c72f8ed2f9155976d37 crypto/ec/ec_k
|
||||
35515133fb3c33c5736a9f744e835b9fc0775193357ab2492f11d0f63503c65e crypto/ec/ec_kmeth.c
|
||||
652a1544120bf0fecde46a8e18cc28fffcb7cd864be2e2b84c99d571ba320e64 crypto/ec/ec_lib.c
|
||||
0d113ac5dbdb420ba3d1c060f4fa3300fc0a81b571a919c2b176022fdca89878 crypto/ec/ec_local.h
|
||||
b545e4539ef2483982f35ee05866060478722e329cfbc4990293b46ccfe5c93c crypto/ec/ec_mult.c
|
||||
714bb2e01c5f814dd3d63296b93111a9a94b50a441ba85291a9cf9ee5748f42e crypto/ec/ec_mult.c
|
||||
c2a81f5f56d304038183ba6b02fdcba8767833f61773ec483e73b330b67ae59b crypto/ec/ec_oct.c
|
||||
c7fba2f2c33f67dafa23caef8c3abd12f5336274a9a07d412b83be0366969ee6 crypto/ec/ecdh_kdf.c
|
||||
b86a943ae62145438a7214539ceb3e0de5a30e17a6e59742c6e30991db730ab6 crypto/ec/ecdh_ossl.c
|
||||
@@ -304,12 +304,12 @@ ed6956c34da5127fbf8f1a067654b617c261039743a12fd1d296a1dd01b05c26 crypto/params_
|
||||
1a81e7483e250ef96f7024f75be884b8830801b47cbdb2d4159637666681b350 crypto/ppccap.c
|
||||
46fa4994a6234a98a2845d9337475913f6bc229f1928abc82224de7edf2784b8 crypto/ppccpuid.pl
|
||||
42eff8da564cd8004f2d17fb01686d24977d931c37c7e6de693e7d414c2d7914 crypto/property/defn_cache.c
|
||||
3b8088da0a7df3aa44bd703e56c9674d9ff8b75af754a89cf8e57152f0ead48c crypto/property/property.c
|
||||
f6c43fb6fee4b40dfcafbc388d6081b72a8030aac0557ae1e3a501f4011acf00 crypto/property/property.c
|
||||
7f936270992015923e5f6e81b1afad0148b9034693d3cf4665465f839a28c81f crypto/property/property_local.h
|
||||
71ccd54b74799afe44ec12e1ec8b6b7ece60bc25a00b9b49044ade025a2c39f8 crypto/property/property_parse.c
|
||||
237079e82943c40d4df9cb6214cf9bc9a84905e4f799eee19a5e0ee4c2d4be4c crypto/property/property_query.c
|
||||
5b35510efa119157e9e217996870778d1ab5f69612cc1bcc8a6df372a625e875 crypto/property/property_string.c
|
||||
fcafd9ac56254e921f43dda47aa6d19ff42b3461ff3a72e0bff1840793f96701 crypto/provider_core.c
|
||||
979017d686a02761b6ccd5188bd938a0ca1092e6d70dd24de13dbb806448a2b4 crypto/provider_core.c
|
||||
aa58d7800d3ccf2989b0de3c2e2710dfac36c88dc51659129897b0dfd2162527 crypto/provider_local.h
|
||||
5ba2e1c74ddcd0453d02e32612299d1eef18eff8493a7606c15d0dc3738ad1d9 crypto/provider_predefined.c
|
||||
1e919f7f3c860eb21bf2f6f868dae076c64c53f1ad794c6764f69329724c3fc2 crypto/rand/rand_lib.c
|
||||
@@ -424,7 +424,7 @@ a4692ad34bd148e06344672e08a3ba928719ca5af4d11ba54d97926759dcda0b crypto/threads
|
||||
6486afb23846d3c11c3a655e7e6cae24f8cdaf5dd4d6a887b5a04c53f52895b0 include/crypto/aes_platform.h
|
||||
8b68c7b69b8da6e729789dbd99d45c341458786e2bc0e2c6c6a341e6792d6b10 include/crypto/asn1.h
|
||||
9acd69adc80fbf9fa88fed4bcc7b3c0ba87e2add98d7ba311d8b092a2d5a0d2c include/crypto/asn1_dsa.h
|
||||
21084935a7f88a5926a087832afe8bc6705b1a7813fe226eb4c0df12c753d3a4 include/crypto/bn.h
|
||||
6bde5251ab151b60da8d420536a17c214b38bd19f2bc37f0d924b3af4b8dfc22 include/crypto/bn.h
|
||||
ef5ff8ad445370d0c8ef519bb791265bc09eead2ed0a086e1ec06bb7ed846b38 include/crypto/bn_conf.h.in
|
||||
7a43a4898fcc8446065e6c99249bcc14e475716e8c1d40d50408c0ab179520e6 include/crypto/bn_dh.h
|
||||
f63ce4d5b80d0927cddd2e0e2d791b96ffa3cc9ef00a4f3ab921ff50ca6bcf50 include/crypto/cmac.h
|
||||
@@ -449,7 +449,7 @@ fd4a274688b694aaf010235e6ffd3fd1afd87bc5cee9cae1e4e8be69bf96a5cf include/crypto
|
||||
3f28391ed526d791a578e76a40961592e15ae2bf62b81d5924525e1f21684659 include/crypto/security_bits.h
|
||||
70b36014254ca6cbe4126573ea6a71069cc278a6ceaa36412343f19b204c4c13 include/crypto/sha.h
|
||||
127ede705ecfa8ec504e57cdee1210c5d7a9044121ff05d1dcf72955958346ed include/crypto/slh_dsa.h
|
||||
df915f569207111cdb011e85ee0f40bcd169ac0a413cc858ccee0b5001cefbb5 include/crypto/sparse_array.h
|
||||
688facd89683d1df2428ba08b22128a4fcbf93c844570518a4764146af87a231 include/crypto/sparse_array.h
|
||||
eb1f4f50bafdd357aa15b54f60f5ecde10876253038f00bf518fbf60840addc1 include/crypto/types.h
|
||||
fd5e610fe38804f5de05931706b8efc717663a892f74aa6aee30301ff5e31a25 include/internal/bio.h
|
||||
d32565e2b426131dc2415e60a97c94570ca982d29ddd97d2e23d6b9f73b1d81c include/internal/common.h
|
||||
@@ -480,7 +480,7 @@ ee75ecd35b3ae90c51ace957ab7ce06de3c7d5064b97a878241ff65cc943a6db include/intern
|
||||
7aeac9a78efb9ea5147f639cd474e6c2538acc1b9d255ba19dc661fe22bcd94d include/internal/propertyerr.h
|
||||
5b108c19f064ec47fffe1b3fe310d4693b6db3920b8cc2e5dc05595751ab0f3b include/internal/provider.h
|
||||
097ff0f3c25c99df484ec9defca0834fcbdab81ee7e4f40ddc64b95e845dc794 include/internal/rcu.h
|
||||
b6e33da6011b2b74d27e39f27cf98e6f123fe47826562b6479d0dbd5c758c4c2 include/internal/refcount.h
|
||||
524dc86da257175bc489d80d3ff9b57ea2e74cd0548f6575e2543a1344c9639e include/internal/refcount.h
|
||||
f77c0844cc44bd92965647cd8cb6addb210f0300a8d1090da8c26e4382e87c2c include/internal/safe_math.h
|
||||
7d5f4c3db807f108096590f28dd1ae92c05b2af25f827309157e727abb783e7a include/internal/sha3.h
|
||||
8e672cc0620606b044f63b8446125f5233d64e3eea59df54c1fcca6bc90ba537 include/internal/sizes.h
|
||||
@@ -498,6 +498,8 @@ a8fa7ddc1e54ca296bda9ee05a7a39bb7e803eb0567cc75a9b949b80cada7552 include/intern
|
||||
17136e1636365f445ffad27a1fa41aa5e148429d38538ee273034b38a72cc8ba include/openssl/asn1.h.in
|
||||
0e28b492fc1f2da095ea42267480c9961a4f8cde3314e409f90395af8c65357e include/openssl/asn1err.h
|
||||
77a9f9595cee6448c6217a8388127593a34a0d0a585197a5f8100fcb792f76ec include/openssl/asn1t.h.in
|
||||
aebe1d2efd1f7667f3fe5552ec8d5e9bd3d5659fca7d201d47c58b41d1070be1 include/openssl/async.h
|
||||
92c66c0660117eef03d49e586625e47b3b35a35189c66ed2ec57aa71f14c4da1 include/openssl/asyncerr.h
|
||||
1af8a6c86dedb83887e9baae99ea7dba6576eeb6a991f62865b10d5efdd9d6fa include/openssl/bio.h.in
|
||||
40491414172d977a4667589fa2f269d7deaae675555b8348d96f315d1a6253bb include/openssl/bioerr.h
|
||||
bbf263e1e83951f12893f063fc7dd1e2c03773f109ee2262111b61b0a05fd696 include/openssl/bn.h
|
||||
@@ -506,6 +508,8 @@ c70499c9109b083beb69d1b17807266b041d0ff28694d5bc1ab7cf2a59331c39 include/openss
|
||||
5bce6559638266f060eaa16b3b90738bbd5292d62230b6b3b1e22b88836a5030 include/openssl/buffererr.h
|
||||
2a83e38101abb3c2da0e07f9bf7012d8167a3c1588df65c36652c4f72aeafc27 include/openssl/byteorder.h
|
||||
3c38e3f1d500263b971b851b1c92b69a29252b44991e8afaaf3c36ceda1dd700 include/openssl/cmac.h
|
||||
a11471a2d9f47686ba4cc005f305000913a7a1af3efb324fa114b541cae012bb include/openssl/comp.h.in
|
||||
759d8087b2861f806f510d22e0cb40e760170ed07176ec0568807e35cbd0de10 include/openssl/comperr.h
|
||||
1cd9648cc536f25cff10656096ebb1d9353adf3ad855d1c25a22b142ec1705e0 include/openssl/conf.h.in
|
||||
3517c480b3211d384d4b36fa48d8dce8923fcccd99fefae68635b3f82eb0acb6 include/openssl/conferr.h
|
||||
4e195b6f7a734756e21c4269cc245b292e1a563aaec5644402929d0eac423c41 include/openssl/configuration.h.in
|
||||
@@ -516,6 +520,8 @@ b47e5195bcf209e120858a2c671eaf0589fbd1baf1c5f69237ab94651772808a include/openss
|
||||
e623d4e8d36d7e0f0825fe5cb48e1176be19c0bedc5053fce488aa48602f351c include/openssl/crypto.h.in
|
||||
128ef415305b704d51461ab98c688c69fde868acb5f5f74c92b2d0517823e71a include/openssl/cryptoerr.h
|
||||
9a636172a3453f4e23b48198effdd92dee425c9359996b498e388a3d21d16dc5 include/openssl/cryptoerr_legacy.h
|
||||
b0e905aec1814217d0a67e3fefbea1dd309fda7c06f554277e0f2ab38ad0254d include/openssl/ct.h.in
|
||||
3b37f5f3481829692b206d24791ba34ef0c54e19c54806beb1e8a0d3e0b877cd include/openssl/cterr.h
|
||||
a147bf48583b902b3db0d30dd2a9565f1c9f3ec94dd57652e31be4c67b7d2593 include/openssl/decoder.h
|
||||
8d8a2f1286cf40264a80e090d377edaabfa4b040dc0e5314ac41406e0dcb0fdc include/openssl/decodererr.h
|
||||
402c76d3a33378f6dad64778503581e4f80e2ec46ac24c84646234a06acac5dc include/openssl/des.h
|
||||
@@ -523,7 +529,9 @@ f5c9ba84d4395938de063bcf9946ab73b41432f6e60e7c1a47f369b5d07041f8 include/openss
|
||||
5658c7f5cd57d74c7644c63c6328e80469fab9d3e29dd734f1433cf3019dd4ab include/openssl/dherr.h
|
||||
5eff0626259806221a6dff0e6b50de3298444e3e82a2464cfe2ffce32f1c2f3d include/openssl/dsa.h
|
||||
d526f8def9e4bb31ff85dbc9494e6b3fe1ab15f424a8e53b3b8fff9dcc40c803 include/openssl/dsaerr.h
|
||||
68eef9eb4bafb28fa290eda68dfe2c318d48dc10da3151a424027edd7a454203 include/openssl/dtls1.h
|
||||
b18230928e536447af72346cf8d98da599c99f8fef74bd5f7bdd7a8dbb012f33 include/openssl/e_os2.h
|
||||
11ec3d0149e69d8ed089a8bdf6aee0c6d61dc1a304f3b566fc1987559f5cc723 include/openssl/e_ostime.h
|
||||
fcb8e2174725eef1279ba8ed046e56c99805796a13eb789ff78aadf7a73e6c76 include/openssl/ebcdic.h
|
||||
b1b7e6f9a0d0e5fc3d37ef73f0eac099cb6164c2cd4dfc750c3607f6e0736598 include/openssl/ec.h
|
||||
9c56b594bfde630c9b8df2fe0c691c74cf79fffb1c1b5e2034ade844e6e3c7d3 include/openssl/ecerr.h
|
||||
@@ -549,11 +557,14 @@ a4127bd23a35828e90addb54b6a1cdfa6a1864038690fcc63053604629fb6f3f include/openss
|
||||
76386f806a801eba4c0172c52dc0e04e2deb192aa867f9d3e9d98a4d5a932d4a include/openssl/opensslv.h.in
|
||||
4c4640740b5de9debbc82bcb5b3e02282c145e440e40dea478a804b8c3498065 include/openssl/param_build.h
|
||||
a9d03ecff3e67ba62eeb03663843148607c0b15c1a91ba3e28d4f7c5335c31bc include/openssl/params.h
|
||||
ba1c36e0244a980f619eb956f05c16402d395ce88ed80963a7e3513ef55db70d include/openssl/pem.h
|
||||
53d727f596ec45e747a4d79de98d62b1e36c7900d6e0b4269774d118d6c341f2 include/openssl/pemerr.h
|
||||
2fa9d02862a00a33fd3841640654fc705ae3d88cb91c1978fa09e87bf2976504 include/openssl/pkcs7.h.in
|
||||
2b25ec134dace5f5e1b0d52650d72c61c2243720358c0b3e645ad956b27d897b include/openssl/pkcs7err.h
|
||||
a15b0b69bc1e31d0091ad32f04021d4fba9750cf9e3c9c0d2509358543cac380 include/openssl/prov_ssl.h
|
||||
21a6860d346cfed56d6ba85424a9725bcfc30105697d942b51fe11a4cf7f52d2 include/openssl/proverr.h
|
||||
d0fffeeaf8a20f6c86e8a6bfaeb1eab7c00188b1844c109ead4232c8dfb3705b include/openssl/provider.h
|
||||
0adc54a200e16d7decdba93d7df19dffb99317bce2edd6cfeff6bd6444cf12dc include/openssl/quic.h
|
||||
c467dcada2506c820e2dcb002dff9d797aaf9527c8778871d79d79a93bc673e7 include/openssl/rand.h
|
||||
23d76dfea708747bdc2ffac41e25b156a22d2d0cb744323a3b9859c54bfbb98a include/openssl/randerr.h
|
||||
06dd86ec673693fc7c47a8b8489a72b648a56a667469064fbbfc91bcf20ad650 include/openssl/rsa.h
|
||||
@@ -561,16 +572,23 @@ c467dcada2506c820e2dcb002dff9d797aaf9527c8778871d79d79a93bc673e7 include/openss
|
||||
546e4277a9897ed5c01b9ab30168e82f4acf9a6a20da430ebf7dd698d5f888fc include/openssl/safestack.h.in
|
||||
695683de2485c3b83d9116877f5d5ca3eb84a3bbb599f6bb02c9e595e7102b41 include/openssl/self_test.h
|
||||
4ab7b74e5d3810eac254c05b74a26a33af9ed526a06530feca758276593d3b2f include/openssl/sha.h
|
||||
7a885aefe6213df0e0ba5136ba504e862cdfd8f05e1248b69dba03b8d4049f40 include/openssl/srtp.h
|
||||
b1b74cafc5ec9a5ec91df8c88e33d759e30476c3a2b2cd0dc23c20a22503963a include/openssl/ssl.h.in
|
||||
bd952356cadf11d266630f4800a340d15f86d01a129ed20891d6357b4cb55a34 include/openssl/ssl2.h
|
||||
5915184833e25d2ec0e745583ba190a492100b797c30197f163af1a89183ca93 include/openssl/ssl3.h
|
||||
6c7312595fe8b200f06c9ddef7eacc358381f4fa712775850d8c6fb0858b9ab4 include/openssl/sslerr.h
|
||||
149f6038fb11f9090b5ab141d46c2da66ef244d06f5c5ba4a8ccf4063b31ab78 include/openssl/sslerr_legacy.h
|
||||
07f25b18b5acfb8733db85a258c6f3aac0c8f436f0a3095c8d885a741f6287f4 include/openssl/stack.h
|
||||
d381d0b4113f0fa18b3e421eae303fc84daf84eacb1236cb6e9976409a2d33a9 include/openssl/symhacks.h
|
||||
fc527427bafa6862d9e3847c961dd6cbbcccc39d25762c65ad3b99fae9599e2e include/openssl/thread.h
|
||||
cdd1dab6344a7d700e8146191882d82766e158e9b789f994c3f9984ccff1c656 include/openssl/tls1.h
|
||||
a481e8762c694b3dac0e74aac8626fe60fa94962a14914f1f6969ea1214c40b1 include/openssl/trace.h
|
||||
9e04a3e9ca5352adffbdd75a5ea5237e8ff96a8c0a842368cc3a29de006b2ee7 include/openssl/types.h
|
||||
62e0cddeedfc217ac02bf37f3669ccea8d0822a88a74a8ec82b844a85b2700aa include/openssl/x509.h.in
|
||||
869959c3d557d2ace84f38b7a8d0f23b3b0854de7f952f46310e828af04554dd include/openssl/x509_vfy.h.in
|
||||
53a45ca5d00026ef0a256f7ff27f5708d5af0a44177a0fc4b209ec054d44e18c include/openssl/x509err.h
|
||||
c0a9551efccf43f3dd748d4fd8ec897ddaabbc629c00ec1ad76ce983e1195a13 providers/common/bio_prov.c
|
||||
6d25e1b61731cc558c2f801350d0cd874d3c19a3b0a03f52394c11fcaf2d51a5 providers/common/capabilities.c
|
||||
b45ed8347714ba15d91fb52e80c75b5670bcf27a9f36a75430c7953eafd8097f providers/common/capabilities.c
|
||||
f94b7435d4ec888ec30df1c611afa8b9eedbb59e905a2c7cb17cfc8c4b9b85b8 providers/common/der/der_digests_gen.c.in
|
||||
424d7b2ece984a0904b80c73e541400c6e2d50a285c397dd323b440a4f2a8d8e providers/common/der/der_dsa_gen.c.in
|
||||
27ff361a5fbfc97cd41690ab26639708961d0507b60912f55f5919649842c6ae providers/common/der/der_dsa_key.c
|
||||
@@ -610,9 +628,9 @@ ca5a852a6aa77140bd3cea619bd48f8e807a6be4ba5cd760b1790189fc16dc19 providers/comm
|
||||
b10730f4d302344579c09f43d5f9c5538bb6b4acd60de7430c24269fc522d5a5 providers/common/securitycheck.c
|
||||
e2f8f00519d81aa16f1c30e8cbf9a0d8e898a1cb5c8b38bb01dd9ab513e34c9e providers/common/securitycheck_fips.c
|
||||
abd5997bc33b681a4ab275978b92aebca0806a4a3f0c2f41dacf11b3b6f4e101 providers/fips/fips_entry.c
|
||||
d8cb05784ae8533a7d9569d4fbaaea4175b63a7c9f4fb0f254215224069dea6b providers/fips/fipsindicator.c
|
||||
76030d77364e05fb61253e7c6a33bee9881046d141fb087a58bb88aa5b413629 providers/fips/fipsindicator.c
|
||||
f0f1486219ddb5817b5105c36f384cb9ef095ddceec50966fe178f4b4177028c providers/fips/fipsprov.c
|
||||
8f52eead96febbce9e7f2bf5aaea557efe8f94ce078044959e80e5ae78432539 providers/fips/include/fips/fipsindicator.h
|
||||
a348a9ff9480f20fff582093c7cb16bbf9e341648a32f54328f023c4e748314f providers/fips/include/fips/fipsindicator.h
|
||||
ef204adc49776214dbb299265bc4f2c40b48848cbea4c25b8029f2b46a5c9797 providers/fips/include/fips_indicator_params.inc
|
||||
f2581d7b4e105f2bb6d30908f3c2d9959313be08cec6dbeb49030c125a7676d3 providers/fips/include/fips_selftest_params.inc
|
||||
7b80823bb5613e17e8576789ec77712d89c81e7beb6ce50b58037e925e465abd providers/fips/include/fipscommon.h
|
||||
@@ -623,7 +641,7 @@ aab0bbdaa8e70f6cf9c3871d62b1efc6029cbe386c5d6318d7bc730da0fa8f19 providers/fips
|
||||
d942921caa433ae9e62959b0ad1caad277b50d005ffc439c6d0e7b0886dba882 providers/implementations/asymciphers/rsa_enc.c
|
||||
c2f1b12c64fc369dfc3b9bc9e76a76de7280e6429adaee55d332eb1971ad1879 providers/implementations/ciphers/cipher_aes.c
|
||||
6ba7d817081cf0d87ba7bfb38cd9d70e41505480bb8bc796ef896f68d4514ea6 providers/implementations/ciphers/cipher_aes.h
|
||||
693a3a667bf13d3703601dc4d1daca9d890ca4f193ba26b8d77571f79507de16 providers/implementations/ciphers/cipher_aes_cbc_hmac_sha.c
|
||||
92b66f5bb84cfd8424fe56ce07bc3d639dc01c2a9d6c4359acd820e8b8b252ef providers/implementations/ciphers/cipher_aes_cbc_hmac_sha.c
|
||||
1b4f19be0c2bbea99e5fce0f93189c687a03cac634f0e37a51466ee7e3510735 providers/implementations/ciphers/cipher_aes_cbc_hmac_sha.h
|
||||
a579a933e7756b502510a42679e06dca2737bda9e53edda578e28eae56b98577 providers/implementations/ciphers/cipher_aes_cbc_hmac_sha1_hw.c
|
||||
4e5e5c6478cf72f6840aa5d9edc50fe27aaa3ea39a428f602056172b0f00d541 providers/implementations/ciphers/cipher_aes_cbc_hmac_sha256_hw.c
|
||||
@@ -653,26 +671,26 @@ dc4626becaabc3990549483d9ef5f05c7dd9a9c2cf9be96ade3ba6a6e203f7f5 providers/impl
|
||||
9cfdcc860a03b6e7ced8cc21bcbbc1c070c89aefab04b07f213c7a3db1895553 providers/implementations/ciphers/cipher_tdes.h
|
||||
00b931090e26ce9a62ee4ea125586f439a9906db5d7b914ffc67d293a57c7c00 providers/implementations/ciphers/cipher_tdes_common.c
|
||||
cca34f1c7baf3a98964f7ce19a59e06d1eaf2ada121a0d4a438f4078a072b325 providers/implementations/ciphers/cipher_tdes_hw.c
|
||||
d2f418806c7ed45f118683bc13329573804592684e522efced0fd0921f4548fd providers/implementations/ciphers/ciphercommon.c
|
||||
b3d0f1a614a8a15bd9cff60dcfa0371c3bcc26d597c58c07fe9dc1c290aee84a providers/implementations/ciphers/ciphercommon.c
|
||||
ab9a2edb23aa61cf31da6addd8674a6028f93399eceeeee35a56ee770338fd6c providers/implementations/ciphers/ciphercommon_block.c
|
||||
fafb07c3fd77a89cff1d2efbb6edc0767132fc30c57f9e282080da04e6762499 providers/implementations/ciphers/ciphercommon_ccm.c
|
||||
de3a998c57842a6de643ec8fd9e4fd6763c7092afb3cb5e83be87016c5d4cc01 providers/implementations/ciphers/ciphercommon_ccm.c
|
||||
6632a555d5bcd5af67d0355ce46c2906bb3a0dcdf1651595b29189c40a5ca675 providers/implementations/ciphers/ciphercommon_ccm_hw.c
|
||||
ab51261da6aea5a3cca74a7561e4b89e6ce83f2ac497a5c766ecd3c3bff95152 providers/implementations/ciphers/ciphercommon_gcm.c
|
||||
bc12afbe8844ea598837427b0addec6b608cfda26abc07c96767d38b6b4147f9 providers/implementations/ciphers/ciphercommon_gcm.c
|
||||
bb67eaa7a98494ca938726f9218213870fc97dd87b56bda950626cc794baf20b providers/implementations/ciphers/ciphercommon_gcm_hw.c
|
||||
8bf2b4bef8167740ae3fffc9f0cf73327a1b4ee361e63da22c257cca0e1e2971 providers/implementations/ciphers/ciphercommon_hw.c
|
||||
c4b1cb143de15acc396ce2e03fdd165defd25ebc831de9cdfacf408ea883c666 providers/implementations/ciphers/ciphercommon_local.h
|
||||
39b47b6ef9d71852964c26e07ef0e9b23f04c7493b1b16ba7c3dba7074b6b70d providers/implementations/digests/digestcommon.c
|
||||
8968fa98952f8f265661c70f2f7e723fca0f80b62ab3faa911025bc41e544a02 providers/implementations/digests/digestcommon.c
|
||||
ae449102b3434800656536ed7ede4a2786ec97350c01df8c45d0431c12e9e700 providers/implementations/digests/sha2_prov.c
|
||||
20ae19c3d85d2e02780948c52ff5c2fd8e2593a001897ca47a47d23280dd579d providers/implementations/digests/sha3_prov.c
|
||||
0ec4b36a2c3401df5f3c814371867c9bda1055843c88107a319ffd05288d586a providers/implementations/digests/sha3_prov.c
|
||||
5b2e4b63e416cc9cd81c27f7acd547df1c580838ac2051d6db56fa9d5569cc8f providers/implementations/exchange/dh_exch.c
|
||||
e1b33fcc05c60254849b9a01e416885ce93ea9e315b9877ac7ab420003b2ec3c providers/implementations/exchange/ecdh_exch.c
|
||||
d44c5a6d3156392757415f34afc1ab164fb0e9cd1e97977386d7cd13f3555df5 providers/implementations/exchange/ecx_exch.c
|
||||
b1115636f53bf70f417b183cafeb6d38e230d11d8de731e6896ba60cc850d931 providers/implementations/exchange/kdf_exch.c
|
||||
1644609260b996c1a46610d02474f991e1ee4bdff5d8175e759c49a92f2b5107 providers/implementations/include/prov/ciphercommon.h
|
||||
6ec1132020ff0ea45eb2f3e43cf1e5f29f0d2ce1d3adde27431befa626eb3f62 providers/implementations/include/prov/ciphercommon.h
|
||||
f1dd49b30604d9b8e948c135329a270a4d3e04857f7f9159a3e84f46a024d59d providers/implementations/include/prov/ciphercommon_aead.h
|
||||
af38be5b3d16c3ced0028bc9b3fbe957a6a817e23967bacc7df65566ba107edb providers/implementations/include/prov/ciphercommon_ccm.h
|
||||
35d1c063e840c9cd5114c5e57b007a19868982a82d8e40a99b2935c9f1f5e05e providers/implementations/include/prov/ciphercommon_gcm.h
|
||||
35596c97faf324823d19a01e1b5674c7a15f1a6e7ff1ef1c7d46400c2a68f63b providers/implementations/include/prov/digestcommon.h
|
||||
624f0f709ba1ad87579cda6f2dd76ca0b17c332969a76baba9acecd05a749713 providers/implementations/include/prov/digestcommon.h
|
||||
1baf1c06b20a0eb8ec271452544922d67c1cc168dbe9853b259191de4bd99918 providers/implementations/include/prov/ecx.h
|
||||
b0d1f6fc3c9220fe6d4656e487bad8df16b6f840054018b95b2752ea9aef822d providers/implementations/include/prov/hmac_drbg.h
|
||||
3542340567e409ab68be299aac67cdb1045ab8e8987023d4fc3c209c9779a0ba providers/implementations/include/prov/implementations.h
|
||||
@@ -691,24 +709,24 @@ abe2b0f3711eaa34846e155cffc9242e4051c45de896f747afd5ac9d87f637dc providers/impl
|
||||
005016cd3d2b9f9d7288d5b7cc71eff3f603199117f6758464dc9778e1ddfc18 providers/implementations/kdfs/sshkdf.c
|
||||
a9a5a3ba575b1a372f5a09135667ac1b0e303f8b19b0707804390aba9e266eca providers/implementations/kdfs/sskdf.c
|
||||
f01cbd7c5351d4aa9ae667627503b2cfef6fc0695e7a42296b7bf015c9a418b3 providers/implementations/kdfs/tls1_prf.c
|
||||
39207243a84beb670cb0e64b6d0fe7bfc6a3dd84000617b647a3ecf52a1da3c2 providers/implementations/kdfs/x942kdf.c
|
||||
b1431361b8a3448b73f4a46c48b3a4f9fd378c2abba67563f4407b1c7f007fca providers/implementations/kem/ml_kem_kem.c
|
||||
926e08e60171cc867220e0f106533ed155132a034690bddea1e7793a879ebf73 providers/implementations/kem/mlx_kem.c
|
||||
79122582eb010bd151e9e682f4bed44cb434a378781d33e95700f5b1365b1847 providers/implementations/kdfs/x942kdf.c
|
||||
e8d1737df0d274d2d7b00ecf3fc3de7a4482b993bd40ef4fcd2c0f3fab3bc3ea providers/implementations/kem/ml_kem_kem.c
|
||||
23ff6d6f0f716c7f79ea7b60433530455843b2c7f387217aec639b67cd2139e7 providers/implementations/kem/mlx_kem.c
|
||||
ff22e920552b82db3dab51b09f9dd2fd038ef0d57fb76cea5578e703653d28c9 providers/implementations/kem/rsa_kem.c
|
||||
6599ad60eef3554741e049c3ff1bd9cc6064d4f3d1835e1ea5dec3a0c14c80bb providers/implementations/keymgmt/dh_kmgmt.c
|
||||
728b75a11d47584e2b4d1035609dbd79be98814b706c06445ae678485e266cb7 providers/implementations/keymgmt/dh_kmgmt.c
|
||||
c0446d1b2101ddd977063516b87d23f424cdca33473f293db4c3974b674169b0 providers/implementations/keymgmt/dsa_kmgmt.c
|
||||
45480796e6ea50cbe9529c17f9fa04228a9126dc7e7e32971519eeb6d6ac267c providers/implementations/keymgmt/ec_kmgmt.c
|
||||
258ae17bb2dd87ed1511a8eb3fe99eed9b77f5c2f757215ff6b3d0e8791fc251 providers/implementations/keymgmt/ec_kmgmt_imexport.inc
|
||||
c559f1f265388e7b1c8195188fcc71ac8af09b3398530ec8ed7a9afd7b41281e providers/implementations/keymgmt/ecx_kmgmt.c
|
||||
c505dadc65ef749c18655df5594b77926a61a015764cf78ced39ee348a4909aa providers/implementations/keymgmt/ecx_kmgmt.c
|
||||
daf35a7ab961ef70aefca981d80407935904c5da39dca6692432d6e6bc98759d providers/implementations/keymgmt/kdf_legacy_kmgmt.c
|
||||
69b509e9c7fe9692622d1059917c3adb991c0047e11bc116f0a393a3a0539445 providers/implementations/keymgmt/mac_legacy_kmgmt.c
|
||||
7d197679dc4ae59f0e697749c56cb76399fc5eed88e94585dfd5ebdb23466e53 providers/implementations/keymgmt/ml_dsa_kmgmt.c
|
||||
2df9ca1a68a9b6e1d1b108148b54ccf5454da3afa34e510beb2f4516e473e4c6 providers/implementations/keymgmt/ml_kem_kmgmt.c
|
||||
4cec24edda3df01c08bef98a0a177ccdd1f8ba84e37c399dc568e010d7c0b29f providers/implementations/keymgmt/mlx_kmgmt.c
|
||||
cd4b8129eaccbd77f9b6c725d3cb57b71109c4649115ec786b6495100afaddf2 providers/implementations/keymgmt/rsa_kmgmt.c
|
||||
92621573e975489b821884151d2de751e462fcf91efa83cb3bf8f4fd40cd241b providers/implementations/keymgmt/slh_dsa_kmgmt.c
|
||||
b89dfb851375a78f255183a2777bdba41c85d4ba85786a4bf0678851d23b6720 providers/implementations/keymgmt/mac_legacy_kmgmt.c
|
||||
4caf110da5fbe9c2cc2bbf765ccc53ef15e69f8bd47f7158f691d4b97b846670 providers/implementations/keymgmt/ml_dsa_kmgmt.c
|
||||
966aba7035631c53c0cd84f831784353f1d9871dadd0623cb1bcdeef34010796 providers/implementations/keymgmt/ml_kem_kmgmt.c
|
||||
a649bf60a638a42521f6e5b8b3010b5524fb7e2478e7f03f8c82bbfdd83c2f73 providers/implementations/keymgmt/mlx_kmgmt.c
|
||||
0c66b24fa26849c1bd09bf8086d24c4a34bcefc3aa876c6186017b9b5f0bedfa providers/implementations/keymgmt/rsa_kmgmt.c
|
||||
1aa554eee1a5aad4add58f72497e0c25c37f52b42b6c6eec6d16e6d70c92fcdf providers/implementations/keymgmt/slh_dsa_kmgmt.c
|
||||
2a66bc54579cb1fcd72674a1e60a7a1f798c13ab964a45e5603bed699268354f providers/implementations/macs/cmac_prov.c
|
||||
a3bb4d7914f45cf82f86cd92135e20a712274ca153d9ed5ad24db7f33710726c providers/implementations/macs/gmac_prov.c
|
||||
78d1c62a30c458357d3c70adf4b66a7fa9a391135da9328560341a70b3b52934 providers/implementations/macs/gmac_prov.c
|
||||
2d6b8c42c67e3e43d8d0035463cbff590dabb7da815f9e437a3a72d4b6596319 providers/implementations/macs/hmac_prov.c
|
||||
40686337be4261685f176bb10042d903d46ab10c90e10ac42d3842e9b5ddd960 providers/implementations/macs/kmac_prov.c
|
||||
0ebc5a48655a697231918644397308e64914c32421e9b8ee7afd7779b6a2fdb8 providers/implementations/rands/drbg.c
|
||||
@@ -719,12 +737,12 @@ e624059b1c9f878655d6a21a4c295c43d147ea913f638a2d007a1a68379180f8 providers/impl
|
||||
355bd437dde9ecd1da89f42691147f2b5cf9a012ff5f55062bf83b6bead1e181 providers/implementations/rands/fips_crng_test.c
|
||||
90ea602ec88f7c0a78f3e7c801cdd3574a221f04497121a9ea7dcb05b7ee6765 providers/implementations/rands/test_rng.c
|
||||
c6c709dfd8b1be036e2a5232d3b21dc25f0150f2aae24cc7db6b09cd790a04ee providers/implementations/signature/dsa_sig.c
|
||||
d10d611713a6d9aa5cdbe636f1ba90404043431fd1df01fc1a1ce8499bf96ad0 providers/implementations/signature/ecdsa_sig.c
|
||||
a837f69cb1aa5d0327372e26a63a8492b6ffb1156325f66e880c202011d07cbe providers/implementations/signature/eddsa_sig.c
|
||||
e0e67e402ff19b0d2eb5228d7ebd70b9477c12595ac34d6f201373d7c8a516f4 providers/implementations/signature/mac_legacy_sig.c
|
||||
51251a1ca4c0b6faea059de5d5268167fe47565163317177d09db39978134f78 providers/implementations/signature/ml_dsa_sig.c
|
||||
6b293ca81102cd2f234d60f52f839e5bd7a746a42df3fe8a4489e6c214108f50 providers/implementations/signature/rsa_sig.c
|
||||
ec630d49078bdd901132e7651eaf3478ff3b04e5558c435ffd7c77dcb62e46b3 providers/implementations/signature/slh_dsa_sig.c
|
||||
cda60439dd7eaa7e90e599f789cb3092967b57bee36c7b58dce2477793b5f487 providers/implementations/signature/ecdsa_sig.c
|
||||
218bcd28611b02027314f8f7b7d6b5b5164574873b5188efc2a9e6a907aeeb33 providers/implementations/signature/eddsa_sig.c
|
||||
31f588fe2e38fe1c6c5a3cb9cdffedf5a4b3994357c57fae2ff900702d75ff23 providers/implementations/signature/mac_legacy_sig.c
|
||||
3f4449310fa024ee485121e6aaa4b11fca2c0b9c9a9484990f9cea5723de7e4c providers/implementations/signature/ml_dsa_sig.c
|
||||
5712b5a289cc279a9136238d979b86febe83c9af15120f78a48fd0c1dd107e5a providers/implementations/signature/rsa_sig.c
|
||||
abf792c38bbb727ea7c4e574453150f40d096a8f8e188e6bae95d1a37057b10f providers/implementations/signature/slh_dsa_sig.c
|
||||
21f537f9083f0341d9d1b0ace090a8d8f0b2b9e9cf76771c359b6ea00667a469 providers/implementations/skeymgmt/aes_skmgmt.c
|
||||
2dbf9b8e738fad556c3248fb554ff4cc269ade3c86fa3d2786ba9b6d6016bf22 providers/implementations/skeymgmt/generic.c
|
||||
9ba8db9b0e18847ef79ecb77fbc383d8762694be29dfb7d269df6f02dc977222 providers/implementations/skeymgmt/skeymgmt_lcl.h
|
||||
|
||||
@@ -1 +1 @@
|
||||
ee77588030ee4df89ad9ff70a12118a9b89ebc4fde306fd25e9c01ef719d0b26 providers/fips-sources.checksums
|
||||
ee49eb47504f27ba763309e94f373e49f3d2fd1f6f750fce28329184bfdb1f01 providers/fips-sources.checksums
|
||||
@@ -498,6 +498,8 @@ include/openssl/aes.h
|
||||
include/openssl/asn1.h.in
|
||||
include/openssl/asn1err.h
|
||||
include/openssl/asn1t.h.in
|
||||
include/openssl/async.h
|
||||
include/openssl/asyncerr.h
|
||||
include/openssl/bio.h.in
|
||||
include/openssl/bioerr.h
|
||||
include/openssl/bn.h
|
||||
@@ -506,6 +508,8 @@ include/openssl/buffer.h
|
||||
include/openssl/buffererr.h
|
||||
include/openssl/byteorder.h
|
||||
include/openssl/cmac.h
|
||||
include/openssl/comp.h.in
|
||||
include/openssl/comperr.h
|
||||
include/openssl/conf.h.in
|
||||
include/openssl/conferr.h
|
||||
include/openssl/configuration.h.in
|
||||
@@ -516,6 +520,8 @@ include/openssl/core_names.h.in
|
||||
include/openssl/crypto.h.in
|
||||
include/openssl/cryptoerr.h
|
||||
include/openssl/cryptoerr_legacy.h
|
||||
include/openssl/ct.h.in
|
||||
include/openssl/cterr.h
|
||||
include/openssl/decoder.h
|
||||
include/openssl/decodererr.h
|
||||
include/openssl/des.h
|
||||
@@ -523,7 +529,9 @@ include/openssl/dh.h
|
||||
include/openssl/dherr.h
|
||||
include/openssl/dsa.h
|
||||
include/openssl/dsaerr.h
|
||||
include/openssl/dtls1.h
|
||||
include/openssl/e_os2.h
|
||||
include/openssl/e_ostime.h
|
||||
include/openssl/ebcdic.h
|
||||
include/openssl/ec.h
|
||||
include/openssl/ecerr.h
|
||||
@@ -549,11 +557,14 @@ include/openssl/opensslconf.h
|
||||
include/openssl/opensslv.h.in
|
||||
include/openssl/param_build.h
|
||||
include/openssl/params.h
|
||||
include/openssl/pem.h
|
||||
include/openssl/pemerr.h
|
||||
include/openssl/pkcs7.h.in
|
||||
include/openssl/pkcs7err.h
|
||||
include/openssl/prov_ssl.h
|
||||
include/openssl/proverr.h
|
||||
include/openssl/provider.h
|
||||
include/openssl/quic.h
|
||||
include/openssl/rand.h
|
||||
include/openssl/randerr.h
|
||||
include/openssl/rsa.h
|
||||
@@ -561,9 +572,16 @@ include/openssl/rsaerr.h
|
||||
include/openssl/safestack.h.in
|
||||
include/openssl/self_test.h
|
||||
include/openssl/sha.h
|
||||
include/openssl/srtp.h
|
||||
include/openssl/ssl.h.in
|
||||
include/openssl/ssl2.h
|
||||
include/openssl/ssl3.h
|
||||
include/openssl/sslerr.h
|
||||
include/openssl/sslerr_legacy.h
|
||||
include/openssl/stack.h
|
||||
include/openssl/symhacks.h
|
||||
include/openssl/thread.h
|
||||
include/openssl/tls1.h
|
||||
include/openssl/trace.h
|
||||
include/openssl/types.h
|
||||
include/openssl/x509.h.in
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2024 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 2024-2026 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
|
||||
@@ -98,6 +98,35 @@ int ossl_FIPS_IND_get_ctx_param(const OSSL_FIPS_IND *ind, OSSL_PARAM params[])
|
||||
return p == NULL || OSSL_PARAM_set_int(p, ind->approved);
|
||||
}
|
||||
|
||||
int ossl_FIPS_IND_get_ctx_param_conditional(const OSSL_FIPS_IND *ind,
|
||||
OSSL_PARAM params[], int condition)
|
||||
{
|
||||
OSSL_PARAM *p = OSSL_PARAM_locate(params,
|
||||
OSSL_ALG_PARAM_FIPS_APPROVED_INDICATOR);
|
||||
|
||||
return p == NULL || OSSL_PARAM_set_int(p, condition && (ind == NULL || ind->approved));
|
||||
}
|
||||
|
||||
const OSSL_PARAM *ossl_FIPS_IND_gettable_ctx_params(ossl_unused void *ctx,
|
||||
ossl_unused void *provctx)
|
||||
{
|
||||
static const OSSL_PARAM gettable_ctx_params[] = {
|
||||
OSSL_PARAM_int(OSSL_ALG_PARAM_FIPS_APPROVED_INDICATOR, NULL),
|
||||
OSSL_PARAM_END
|
||||
};
|
||||
|
||||
return gettable_ctx_params;
|
||||
}
|
||||
|
||||
int ossl_FIPS_IND_get_ctx_param_approved(ossl_unused void *ctx,
|
||||
OSSL_PARAM params[])
|
||||
{
|
||||
OSSL_PARAM *p = OSSL_PARAM_locate(params,
|
||||
OSSL_ALG_PARAM_FIPS_APPROVED_INDICATOR);
|
||||
|
||||
return p == NULL || OSSL_PARAM_set_int(p, 1);
|
||||
}
|
||||
|
||||
/*
|
||||
* Can be used during application testing to log that an indicator was
|
||||
* triggered. The callback will return 1 if the application wants an error
|
||||
|
||||
Loaded 100 of 1254 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user