Commit Graph

35755 Commits

Author SHA1 Message Date
Norbert Pocs 80c8cad360 Check return code of BIO_ADDR_rawaddress
Fixes coverity issue: https://scan5.scan.coverity.com/#/project-view/64471/10222?selectedIssue=1666584
Thank you for the report!

Signed-off-by: Norbert Pocs <norbertp@openssl.org>

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
(Merged from https://github.com/openssl/openssl/pull/28751)

(cherry picked from commit 7fb9163586)
2025-10-07 12:36:00 -04:00
DONGGEUN YOO 49efe65615 ts_conf: fix memory leak in TS_CONF_set_policies
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28686)

(cherry picked from commit 1f3a6602a1)
2025-10-01 17:55:12 +02:00
Ryan Hooper 2cad001d77 Fix Memory leak in CMS_EncryptedData_set1_key
When CMS_EncryptedData_set1_key is called repeatedly it will
leak data on the second call. This was because
cms->d.encryptedData was already set and needed to be cleared
before the call to M_ASN1_new_of.

Fixes: #28606

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

(cherry picked from commit 7de825efa2)
2025-10-01 17:49:33 +02:00
openssl-machine ccddfe03c6 Prepare for 3.3.6
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Release: yes
2025-09-30 12:57:31 +00:00
openssl-machine f10934c46f Prepare for release of 3.3.5
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Release: yes
2025-09-30 12:57:24 +00:00
openssl-machine 3534f6587d make update
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Release: yes
2025-09-30 12:57:23 +00:00
openssl-machine b08f255364 Copyright year updates
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Release: yes
2025-09-30 12:55:37 +00:00
Eugene Syromiatnikov 8e91919bcf CHANGES.md: update for 3.3.5
3.3.5 CHANGES.md includes the following:
 * https://github.com/openssl/openssl/pull/28198
 * https://github.com/openssl/openssl/pull/28398
 * https://github.com/openssl/openssl/pull/28411
 * https://github.com/openssl/openssl/pull/28449

Release: Yes
Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
2025-09-30 13:49:08 +02:00
Tomas Mraz 85af41a763 Add CHANGES.md and NEWS.md updates
Including a few corrections of the previous entries.

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
2025-09-29 14:42:23 +02:00
Tomas Mraz bbf38c034c use_proxy(): Add missing terminating NUL byte
Fixes CVE-2025-9232

There is a missing terminating NUL byte after strncpy() call.
Issue and a proposed fix reported by Stanislav Fort (Aisle Research).

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(cherry picked from commit 6bca15039e)
2025-09-29 12:04:32 +02:00
Tomas Mraz ca3539ef3c ecp_sm2p256.c: Remove unused code
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(cherry picked from commit 56c89cd2de)
2025-09-29 12:02:38 +02:00
Tomas Mraz 567f64386e SM2: Use constant time modular inversion
Fixes CVE-2025-9231

Issue and a proposed fix reported by Stanislav Fort (Aisle Research).

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(cherry picked from commit dff94dba75)
2025-09-29 12:02:37 +02:00
Viktor Dukhovni 5965ea5dd6 kek_unwrap_key(): Fix incorrect check of unwrapped key size
Fixes CVE-2025-9230

The check is off by 8 bytes so it is possible to overread by
up to 8 bytes and overwrite up to 4 bytes.

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(cherry picked from commit 9c462be2ce)
2025-09-29 11:59:03 +02:00
Tomas Mraz 74d92a3659 krb5kdf.c.in: Check the key size before applying the key
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/28663)

(cherry picked from commit 3addc8bb3a)
2025-09-26 12:54:50 -04:00
Tomas Mraz b995d16c54 Add test for using KRB5KDF with erroneous key size
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/28663)

(cherry picked from commit c18b6968cc)
2025-09-26 12:54:49 -04:00
Eugene Syromiatnikov c7071dec4d apps/storeutl.c: avoid signed integer overflow in indent_printf()
As two arbitrarily large printf return values can trigger signed integer
overflow, rewrite the return value handling to avoid it.

Fixes: fb43ddceda "Add a recursive option to 'openssl storeutl'"
Resolves: https://scan5.scan.coverity.com/#/project-view/65248/10222?selectedIssue=1665428
References: https://github.com/openssl/project/issues/1432
Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>

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

(cherry picked from commit 61422fd7e0)
2025-09-25 17:00:27 +02:00
Eugene Syromiatnikov f6cf2e38c3 crypto/evp/ctrl_params_translate.c: fix a typo in the error message
The ERR_raise_data() call on failure to find ctx->p2 in str_value_map
erroneously refers to ctx->p1 instead;  fix that but supplying the
correct field and casting it to the supposed const char * type.

Fixes: 9a1c4e41e8 "EVP: Implement data-driven translation between known ctrl and OSSL_PARAMs"
Resolves: https://scan5.scan.coverity.com/#/project-view/65248/10222?selectedIssue=1665427
References: https://github.com/openssl/project/issues/1432
Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>

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

(cherry picked from commit a53013196c)
2025-09-25 17:00:26 +02:00
Eugene Syromiatnikov b95c906cc0 crypto/bio/bss_file.c: add missing cast in format arg in ERR_raise_data()
"%s" conversion specifier requires a "char *" argument, so ptr needs
to be cast to it there, as Coverity has noted.

Fixes: ff988500c2 "Replace FUNCerr with ERR_raise_data"
Resolves: https://scan5.scan.coverity.com/#/project-view/65248/10222?selectedIssue=1665423
References: https://github.com/openssl/project/issues/1432
Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>

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

(cherry picked from commit d575fa897d)
2025-09-25 17:00:25 +02:00
Eugene Syromiatnikov 6d79dec2eb test/wpackettest.c: remove bogus cleanup() in test_WPACKET_quic_vlint_random()
In the beginning of the iteration, pkt is not initialised yet, so there
is no need to clean it up on RAND_bytes() failure.  Replace
"return cleanup(&pkt)" with plain "return 0".

Fixes: 416d0a638c "QUIC wire format support"
Resolves: https://scan5.scan.coverity.com/#/project-view/65248/10222?selectedIssue=1665422
References: https://github.com/openssl/project/issues/1432
Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>

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

(cherry picked from commit 68f7f1295a)
2025-09-25 17:00:25 +02:00
Eugene Syromiatnikov 1676ac44be crypto/x509/t_x509.c: check i2d_X509_NAME() return value in X509_ocspid_print()
There is little reason for this call to fail, but there is also little
reason for not to check for it, and, since Coverity noticed
that the check is missing, just add it.

Resolves: https://scan5.scan.coverity.com/#/project-view/65248/10222?selectedIssue=1665420
References: https://github.com/openssl/project/issues/1432
Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>

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

(cherry picked from commit 19b3dcbbc2)
2025-09-25 17:00:24 +02:00
Daniel Kubec 9b62226ba3 Fix EVP_PKEY_can_sign() handling of NULL from query_operation_name()
EVP_PKEY_can_sign() assumed query_operation_name(OSSL_OP_SIGNATURE)
always returns a non-NULL string. According to the documentation,
query_operation_name() may return NULL, in which case
EVP_KEYMGMT_get0_name() should be used as a fallback.

Fixes #27790

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

(cherry picked from commit 0c2d67f417)
2025-09-25 15:29:01 +02:00
Tomas Mraz a3323ff873 Fix doublefree after failure in ossl_siv128_init()
The issue was reported by Ronald Crane from Zippenhop LLC.

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/28644)

(cherry picked from commit 3185e27624)
2025-09-25 10:45:47 +02:00
Tomas Mraz 944e73d8cf Update oqs-provider to the latest commit
The oqs-provider testing is fixed so it doesn't fetch OpenSSL
implementations during its testing inadvertently.

Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
(Merged from https://github.com/openssl/openssl/pull/28653)

(cherry picked from commit ca1a1ae821)
2025-09-24 20:12:57 +02:00
Bernd Edlinger 728d5cf9e1 Do not use RW mutexes on RISC-V arch
For unknown reasons using RW mutexes on RISC-V arch
seems to be broken, at least with glibc.

Fixes #28550

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28635)
2025-09-24 10:21:03 -04:00
Neil Horman d8ecbb37dc disable rwlocks on nonstop klt model
It appears nonstops new threading model defines some level of rwlock
pthread api, but its not working properly.  Disable rwlocks for
_KLT_MODEL_ for now

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/28635)
2025-09-24 10:21:03 -04:00
Tomas Mraz 2788ec5017 ossl_quic_conn_stream_conclude(): Fixup the quic_unlock() call name
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28651)

(cherry picked from commit caf629215f)
2025-09-24 15:10:58 +02:00
Bernd Edlinger fbab59ee38 Print PowerPC CPUINFO
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28535)

(cherry picked from commit 03a9584499)
2025-09-24 08:50:43 -04:00
Bob Beck c4bbbc1bad Correct the documentation for OPENSSL_sk_find
Since April of 2023 with commit eb0935f, these functions have not
sorted the stack if it was not sorted. The documentation was noti
changed at the time to reflect this changed behaviour.

This corrects the documentation to reflect the current behaviour
of these functions

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

(cherry picked from commit 07e70f951e)
2025-09-24 12:28:07 +02:00
Neil Horman 04d7282c9b Close small race condition on error raising in QUIC
Github issue #28501 reported an odd condition in which a double free was
occuring when a given thread was popping entries of its error stack.

It was hypothesized that, because a few places in the quic stack save
error state to a shared structure (ch->err_state, port->error_state,
qtls->error_state), that multiple threads may attempt to mutate the
shared structure during error save/restore in parallel.

Investigation showed that all paths which led to such mutations were
done under lock, so that shouldn't occur.

Except for one case, which this PR addresses.

In ossl_quic_conn_stream_conclude, we unlock our protecting mutex, prior
to calling QUIC_RAISE_NON_NORMAL_ERROR.  If that function is called with
an reason code of SHUTDOWN, it attempts to restore the channel error
state.  Given that the lock was released first, this creates a small
race condition in which two threads may manipulate the shared error
state in the channel struct in parallel.

According to the reporter, applying this patch prevents the reported
error from occuring again.

Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28642)

(cherry picked from commit 1e70e8080a)
2025-09-24 12:21:55 +02:00
Nikola Pajkovsky 1f183bd83a x509: fix mem leak on error path
The x509_store_add() creates X509_OBJECT wrapping either X509 or
X509_CRL. However, if you set the type to X509_LU_NONE before
X509_OBJECT_free then it skips the free on the wrapped type and just
calls OPENSSL_free on the object itself. Hence, leaking wrapped
object.

Signed-off-by: Nikola Pajkovsky <nikolap@openssl.org>

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

(cherry picked from commit 8a4ef31f3a)
2025-09-23 16:43:34 +02:00
Tomas Mraz 04307541e2 tls_common.c: Handle inner content type properly on Big Endian
When passing the inner content type to msg_callback,
the lowest byte of rec->type needs to be passed instead
of directly passing the rec->type otherwise the value is
incorrect on Big Endian platforms.

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

(cherry picked from commit 2edf021463)
2025-09-23 16:40:13 +02:00
Luigino Camastra caa3f201f4 bio_ok.c: Integer Overflow in BIO_f_reliable record parser leads to Out-of-Bounds Read
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28504)

(cherry picked from commit 312904b216)
2025-09-23 12:01:54 +02:00
Viktor Dukhovni 408e5177e1 Added test suggested by Shane Lontis
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/28624)

(cherry picked from commit 38e8981004)
2025-09-23 11:57:43 +02:00
Viktor Dukhovni 2ee1f65538 Harden property put_str() helper corner case
The put_str() helper of the internal ossl_property_list_to_string()
function failed to correctly check the remaining buffer length in a
corner case in which a property name or string value needs quoting,
and exactly one byte of unused space remained in the output buffer.

The only potentially affected calling code is conditionally compiled
(disabled by default) provider "QUERY" tracing that is executed only
when also requested at runtime.  An initial fragment of the property
list encoding would need to use up exactly 511 bytes, leaving just 1
byte for the next string which requires quoting.  Bug reported by

    Aniruddhan Murali (@ashamedbit)
    Noble Saji Mathews (@NobleMathews)

both from the University of Waterloo.

Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/28624)

(cherry picked from commit c6e44fa347)
2025-09-23 11:57:42 +02:00
Richard Levitte f1fd3d5235 Fix OPENSSL_VERSION_NUMBER to always have zero status bits
The documentation suggested that they were always zero, while the
implementation in <openssl/opensslv.h> suggested that it could be
0xf in OpenSSL releases...  which (almost) never happened because
of a bug in said implementation.

Therefore, we solidify that the status bits are indeed always zero,
at least in all OpenSSL 3 versions.

Resolves: https://github.com/openssl/project/issues/1621

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

(cherry picked from commit 60c4feacce)
2025-09-20 09:30:04 +02:00
Bernd Edlinger eec456fc7b Fix another memory order issue
this adds another release/acquire link between update_qp and
get_hold_current_qp via the reader_idx because the current
one which is based on the qp users count is only preventing
a race condition, but does not help when the reader acquires
the next qp.

Fixes #27267

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28585)

(cherry picked from commit d296f96533)
2025-09-19 07:05:04 +02:00
Grzesiek11 e800c459ee Fix cipher protocol ID type in docs
The cipher protocol ID, the return type of SSL_CIPHER_get_protocol_id,
is uint16_t and correctly described in docs to be 2 bytes, however the
function signature on the same page incorrectly pointed to it being
uint32_t, which is 4 bytes.

CLA: trivial

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/28523)

(cherry picked from commit 9bdf93776d)
2025-09-18 17:29:33 +02:00
Ritesh Kudkelwar ddc3889acd doc: clarify SSL_SESSION_get0_hostname() DESCRIPTION
Also refine RETURN VALUES.

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28393)

(cherry picked from commit 32ec975213)
2025-09-18 17:21:26 +02:00
Eugene Syromiatnikov 530813516c test/recipes/25-test_verify.t: correct the number of skipped tests on Win/VMS
On 3.5, there is one test fewer to be skipped due to absence of support
of colon in filenames after the commit b3e7dad7ac "Fix
test/recipes/25-test_verify.t [3.5]", provide the correct number
in the skip call.

Fixes: b3e7dad7ac "Fix test/recipes/25-test_verify.t [3.5]"
Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28591)

(cherry picked from commit b18f44902c)
2025-09-18 08:30:20 +02:00
Bernd Edlinger 0fa59896e1 Fix logic errors in torture_rw_high/low test
"old" was never assigned anything and the first
assignment to "*iterations" in the loop was superfluous.

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28574)

(cherry picked from commit a1f6bbf6b0)
2025-09-17 16:24:26 -04:00
Dr. David von Oheimb 37e2d4344f 25-test_verify.t: fix partly case-sensitive matching for Windows OS: s/MsWin32/MSWin32/
Fixes #27984

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28098)

(cherry picked from commit ee16664f6a)
2025-09-17 08:37:21 +02:00
Viktor Dukhovni 6c6a91b143 Test failure of rsa_encrypt when buffer too short
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28539)
2025-09-16 05:39:23 -04:00
Viktor Dukhovni 275404d909 Harden RSA public encrypt
Check the that the indicated output buffer length is large enough.

Fix EVP_SealInit() to initialise the output buffer length to the RSA
modulus length, not the input KEK length.

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28539)
2025-09-16 05:39:23 -04:00
Jakub Jelen 11c4979b86 doc: Add missing commas
CLA: trivial
Signed-off-by: Jakub Jelen <jjelen@redhat.com>

Reviewed-by: Paul Yang <paulyang.inf@gmail.com>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/28493)

(cherry picked from commit 1199882de6)
2025-09-11 16:03:53 +10:00
Bernd Edlinger 196786bead Add one more trace message to the torture_rcu_high test
It is interesting that in the very rare cases, where this
test failure has been observed so far, the rcu torture value
went always backwards to 0.  This could be either due to
ossl_rcu_deref(&writer_ptr) returning NULL, or the initial
value of "new = CRYPTO_zalloc(sizeof(uint64_t), NULL, 0)"
still visible despite ossl_rcu_assign_ptr(&writer_ptr, &new)
immediatley after the "*new = global_ctr++" statement.
Add one additional trace message to find out what exactly
happens here, when it happens again.
Additionally, we do no longer initialize the new value to
zero but something else, so it can also be detected.

Related to #27267

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28487)

(cherry picked from commit 17d5c9297e)
2025-09-10 22:37:16 +02:00
Eugene Syromiatnikov c3ee9d5b38 doc/man3/RAND_load_file.pod: RAND_load_file on non-regular files with bytes=-1
Mention that RAND_load_file attempts to read only RAND_DRBG_STRENGTH
bytes on non-regular files if the number of bytes to be read
is not specified explicitly.

Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>

Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28379)

(cherry picked from commit 0daaf33275)
2025-09-09 20:22:38 +02:00
Eugene Syromiatnikov e9b4071c66 crypto/rand/randfile.c: avoid signed integer overflow in RAND_load_file
If a file supplied to RAND_load_file is too big (more than INT_MAX bytes),
it is possible to trigger a signer integer overflow during ret calculation.
Avoid it by returning early when we are about to hit it on the next
iteration.

Reported-by: Liu-Ermeng <liuermeng2@huawei.com>
Resolves: https://github.com/openssl/openssl/issues/28375
Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>

Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28379)

(cherry picked from commit 35db6a15d4)
2025-09-09 20:22:37 +02:00
Enji Cooper c94331eab0 Make the Unix build process more repeatable
Before this change all manpages would contain the date when pod2man was
run. This resulted in outputs that differed between builds--or
potentially across a single build if the host clock "ticked" to the next
day when the build was being run.

This commit modifies the manpage generation process as follows:
- The date all manpages were generated will be normalized to a single
  date.
- The release date specified in `VERSION.dat` is used instead of the
  date/time when `pod2man` was executed OR--in the event a date isn't
  specified in `VERSION.dat`--the time when the Makefiles were last
  regenerated.

Embedding a consistent date into the generated manpages helps ensure that
the build process as a whole is more repeatable and helps ensure that
release versions of OpenSSL create artifacts consistent with the date
that the official release was cut.

Co-authored-by: Richard Levitte <levitte@openssl.org>
Signed-off-by: Enji Cooper <yaneurabeya@gmail.com>

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

(cherry picked from commit 2c0c9c83b2)
2025-09-09 11:37:51 +02:00
Sergey G. Brester 43d13879bf openssl-enc.pod.in: We actually use PKCS#7 padding
PKCS#5 padding is a subset for 8-bytes block ciphers only.

CLA: trivial

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

(cherry picked from commit 4e0c2d02a9)
2025-09-09 11:31:37 +02:00
Hongren Zheng 6e1a981cef RISC-V: Use address for vlenb CSR
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28422)

(cherry picked from commit 1a278e765a)
2025-09-09 11:19:21 +02:00