aboutsummaryrefslogtreecommitdiffstats
path: root/apps/lib
Commit message (Collapse)AuthorAgeFilesLines
* apps/lib/cmp_mock_srv.c: Fix NULL dereference of ASN1_INTEGER in refcert_cmp()Daniel Kubec31 hours1-2/+5
| | | | | | | | | | | | | | | | The issuer and the serialNumber are independently OPTIONAL in a CertTemplate. A component absent from the request cannot confirm a match with the reference cert, and ASN1_INTEGER_cmp() does not accept NULL, so require each component the reference cert has to be present in the request and to be equal. Fixes: 66be663b64e0 "cmp_mock_srv.c: Add missing OldCertID check for 'kur' cert update requests" References: b971d4198def "CMP mock server: add -ref_cert option and corresponding ossl_cmp_mock_srv_set1_refCert()" Reviewed-by: Dmitry Belyavskiy <[email protected]> Reviewed-by: Mounir Idrassi <[email protected]> Reviewed-by: Eugene Syromiatnikov <[email protected]> Merge-date: Sat Oct 24 09:44:19 2026 Merged-from: https://github.com/openssl/openssl/pull/33071
* Fix set but unsued variable in lib/opt.cNeil Horman2026-09-121-2/+0
| | | | | | | | | | | | | | https://github.com/openssl/openssl/actions/runs/34494520852/job/102982686286 CI is failing because we have a varaible in opt.c that is set but never used. Just remove it. Reviewed-by: Andrew Dinh <[email protected]> Reviewed-by: Frederik Wedel-Heinen <[email protected]> MergeDate: Sat Sep 12 13:18:16 2026 (Merged from https://github.com/openssl/openssl/pull/32787)
* Copyright year updatesopenssl-machine2026-09-094-4/+4
| | | | | | | Reviewed-by: Daniel Kubec <[email protected]> Reviewed-by: Eugene Syromiatnikov <[email protected]> Merge-date: Wed Sep 9 13:12:46 2026 Release: yes
* Don't treat a CRL distribution point URI as a NUL terminated stringBob Beck2026-08-271-6/+12
| | | | | | | | | | | | | | | | | get_dp_url() returned the internal ASN1_STRING data of a DIST_POINT URI directly. That data has an explicit length and is not necessarily NUL terminated, yet load_crl() and the HTTP client it hands the URI to consume it as a C string, reading past the buffer for a certificate carrying a primitive-form IA5String URI in its CRL distribution points. Return an allocated NUL terminated copy of the URI and free it in load_crl_crldp(). Reviewed-by: Neil Horman <[email protected]> Reviewed-by: Andrew Dinh <[email protected]> Reviewed-by: Nikola Pajkovsky <[email protected]> Merge-date: Thu Aug 27 13:52:39 2026 Merged-from: https://github.com/openssl/openssl/pull/32178
* Replace strlen-then-snprintf preconditions with snprintf-returnBob Beck2026-08-261-73/+69
| | | | | | | | | | | | | | | This restructureis the apps/lib/apps.c file-rotation helpers to use snprintf for truncation detection, since they now can. This also collapses the per-snprintf VMS ifdef into one SUFFIX_SEP macro because the ifdef-per-call shape was making my eyes bleed from all the copypasta'ed snprintf lines with only one character changed in the format string. Reviewed-by: Neil Horman <[email protected]> Reviewed-by: Andrew Dinh <[email protected]> MergeDate: Wed Aug 26 16:20:32 2026 (Merged from https://github.com/openssl/openssl/pull/31640)
* Replace strlen-then-snprintf pattern in save_serial() with a single ↵Bob Beck2026-08-261-13/+13
| | | | | | | | | | | | truncation check. This used to be necessary because BIO_snprintf() could not detect truncation but now this is silly, and this ends up tripping GCC's -Wformat-truncation Reviewed-by: Neil Horman <[email protected]> Reviewed-by: Andrew Dinh <[email protected]> MergeDate: Wed Aug 26 16:20:30 2026 (Merged from https://github.com/openssl/openssl/pull/31640)
* Convert BIO_snprintf() usage in describe_param_type()Bob Beck2026-08-261-9/+11
| | | | | | | | | | This adds the correct truncation check for snprintf() to each block that advances the index. Reviewed-by: Neil Horman <[email protected]> Reviewed-by: Andrew Dinh <[email protected]> MergeDate: Wed Aug 26 16:20:14 2026 (Merged from https://github.com/openssl/openssl/pull/31640)
* Convert BIO_snprintf() callers whose existing checks already workBob Beck2026-08-261-4/+4
| | | | | | | | | | | | under snprintf semantics. These call sites already guarded the result with the C99 truncation idiom, so they can simply use snprintf as a replacement as is. Reviewed-by: Neil Horman <[email protected]> Reviewed-by: Andrew Dinh <[email protected]> MergeDate: Wed Aug 26 16:20:09 2026 (Merged from https://github.com/openssl/openssl/pull/31640)
* Convert BIO_snprintf() callers that ignore the return value to snprintf().Bob Beck2026-08-266-31/+35
| | | | | | | | | | | | Where the return value is discarded, BIO_snprintf() and snprintf() are interchangeable: both write the same bytes and NUL-terminate the buffer. The conversion is mechanical. Reviewed-by: Neil Horman <[email protected]> Reviewed-by: Andrew Dinh <[email protected]> MergeDate: Wed Aug 26 16:20:07 2026 (Merged from https://github.com/openssl/openssl/pull/31640)
* Add a build target for MSVC 2013Bob Beck2026-08-261-0/+4
| | | | | | | | | | | | | | | Apparently it is desired to keep this on life support. So we add a build target for this non-C99 platform, and provide internal versions of snprintf and vsnprintf for use only on this platform that match the C99 semantics. This allows us to use C99 semantics normally elsewhere. Reviewed-by: Neil Horman <[email protected]> Reviewed-by: Andrew Dinh <[email protected]> MergeDate: Wed Aug 26 16:20:04 2026 (Merged from https://github.com/openssl/openssl/pull/31640)
* Adds DTLS 1.3 ACK message functionalityFrederik Wedel-Heinen2026-08-251-1/+11
| | | | | | Reviewed-by: Matt Caswell <[email protected]> Reviewed-by: Tomas Mraz <[email protected]> (Merged from https://github.com/openssl/openssl/pull/25119)
* Integrate dtls1.3 in s_client and s_serverFrederik Wedel-Heinen2026-08-251-1/+2
| | | | | | Reviewed-by: Tomas Mraz <[email protected]> Reviewed-by: Matt Caswell <[email protected]> (Merged from https://github.com/openssl/openssl/pull/22260)
* Fix system resource leak in TerminalSocket()YZL0v3ZZ2026-08-191-0/+2
| | | | | | | | | | | | | | | When establishing a terminal socket on OpenVMS, if the async I/O read operation (sys$qio) fails, the error path returns early without freeing the allocated channel via sys$dassgn. Add sys$dassgn(TerminalDeviceChan) in the sys$qio error path during creation. Also ensure dassgn executes regardless of whether sys$cancel succeeds during deletion to avoid exhausting the I/O channel quota. Reviewed-by: Nikola Pajkovsky <[email protected]> Reviewed-by: Richard Levitte <[email protected]> Merge-date: Wed Aug 19 15:37:03 2026 Merged-from: https://github.com/openssl/openssl/pull/30375
* Rename ASN1_STRING_length_ex() to ASN1_STRING_get_length()Eugene Syromiatnikov2026-08-112-3/+3
| | | | | | | | | | | | | | | | | | | | To make it in line with ASN1_BIT_STRING_get_length() and other (size) getters. The majority of the changes was done by for i in `git grep -l ASN1_STRING_length_ex`; do \ sed -i 's/ASN1_STRING_length_ex/ASN1_STRING_get_length/g' "$i"; \ done with a manual touch-up in util/libcrypto.num. Complements: 28179061bfcd "Prepare a now opaque ASN1_STRING for the size_t rapture." Signed-off-by: Eugene Syromiatnikov <[email protected]> Reviewed-by: Nikola Pajkovsky <[email protected]> Reviewed-by: Bob Beck <[email protected]> Reviewed-by: Simo Sorce <[email protected]> MergeDate: Tue Aug 11 13:56:42 2026 (Merged from https://github.com/openssl/openssl/pull/32015)
* apps: Make s_client -quiet really quietSebastian Andrzej Siewior2026-07-301-5/+7
| | | | | | | | | | | | | | | | Despite the -quiet option s_client still reports the host it connects to and the certificate chain. Since -quiet is documented as "No s_client output", hide all non-error output. Pass the quiet option to init_client() to suppress the host output. Set verify's quiet flag if quiet is passed. Signed-off-by: Sebastian Andrzej Siewior <[email protected]> Reviewed-by: Eugene Syromiatnikov <[email protected]> Reviewed-by: Norbert Pocs <[email protected]> MergeDate: Thu Jul 30 09:09:35 2026 (Merged from https://github.com/openssl/openssl/pull/30519)
* Remove remaining atoi()/atol() callsMounir IDRASSI2026-07-291-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove the remaining direct atoi()/atol() uses across apps, libcrypto, libssl, providers, demos and tests, and route the replacements through checked helpers instead of open-coding the conversion at each call site: - apps use the existing opt_int()/opt_long()/opt_int_arg() parsers; - libcrypto and provider code use the new internal ossl_strtol()/ ossl_strtoint() helpers, a checked (and, for ossl_strtoint(), narrowing) signed counterpart to the public OPENSSL_strtoul(); - libssl, demos and tests use OPENSSL_strtoul(); the test code shares a single test_strtoint() helper rather than repeating the bound check and cast per file; - unsigned values use OPENSSL_strtoul(), with call-site-specific range checks before narrowing where the destination type requires it. Reject conversion failures and narrow through the helpers rather than acting on garbage, and preserve the signed RSA-PSS saltlen sentinels while rejecting invalid numeric strings. Add regression coverage for the invalid RSA-PSS saltlen string path. Fixes #8216 Assisted-by: OpenCode:GLM-5.2 Reviewed-by: Tom Cosgrove <[email protected]> Reviewed-by: Tim Hudson <[email protected]> Reviewed-by: Tomas Mraz <[email protected]> MergeDate: Wed Jul 29 17:02:18 2026 (Merged from https://github.com/openssl/openssl/pull/31731)
* apps: drop invalid trust setting in check_cert_might_be_valid()Jakub Zelenka2026-07-271-1/+0
| | | | | | | | | | | | | | | | | | | | | | check_cert_might_be_valid() called X509_VERIFY_PARAM_set_trust() with X509_TRUST_OK_ANY_EKU, which is a trust_flags bit (1 << 4), not a valid trust id (1..8). The call therefore failed with X509_R_INVALID_TRUST and left that error on the error stack, which was then printed via ERR_print_errors() for every certificate loaded by the x509 app, even on success. The intended liberal behavior is already provided by X509_PURPOSE_ANY and by suppressing X509_V_ERR_CERT_REJECTED, so just remove the bogus call. Add a test checking that printing certificate info emits nothing on stderr. Assisted-by: Claude:claude-opus-4-8 Signed-off-by: Norbert Pocs <[email protected]> Reviewed-by: Matt Caswell <[email protected]> Reviewed-by: Ryan Hooper <[email protected]> MergeDate: Mon Jul 27 11:50:39 2026 (Merged from https://github.com/openssl/openssl/pull/31968)
* apps: decode DTLSv1.2 records in s_client/s_server -msg outputJakub Zelenka2026-07-201-1/+5
| | | | | | | | | | | | | | | | | | | | The msg_cb message callback used by the -msg option only recognised DTLSv1.0 among the DTLS versions, so DTLSv1.2 records were logged as "Not TLS data or unknown version" instead of being decoded. Add DTLS1_2_VERSION to the recognised version check and to the ssl_versions lookup table, and wrap the now-overlong condition. Add a test that runs s_client against s_server over TLSv1.2, TLSv1.3 and DTLSv1.2, logging the protocol messages via -msg, and checks that every record is decoded (no "Not TLS data or unknown version" lines). Assisted-by: Claude:claude-opus-4-8 Reviewed-by: Tim Hudson <[email protected]> Reviewed-by: Paul Dale <[email protected]> Reviewed-by: Frederik Wedel-Heinen <[email protected]> MergeDate: Mon Jul 20 09:09:07 2026 (Merged from https://github.com/openssl/openssl/pull/31994)
* Convert internal use of ASN1_STRING_set and ASN1_STRING_lengthBob Beck2026-07-182-5/+5
| | | | | | | | | | | | | | to use their non-deprecated replacements. For "pretty-printing" applications and test code that use a length and require an int, size_t lengths are simply cast to an int. For writes and protocol level things size_t lengths are checked against INT_MAX and take the error path if the returned value is too large to be used for a funciton that takes an integer length. Reviewed-by: Milan Broz <[email protected]> Reviewed-by: Norbert Pocs <[email protected]> MergeDate: Sat Jul 18 13:01:19 2026 (Merged from https://github.com/openssl/openssl/pull/31194)
* Fix dsaparams decoding from DER filesNeil Horman2026-07-161-10/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The tests addded in commit d8a7e8e uncovered an odd error case. https://github.com/openssl/openssl/actions/runs/29303845665/job/86993085732 Is failing when attempting to read in a der file converting from a corresponding PEM file containing DSA parameters. Interestingly The problem was only occuring when: 1) The input was a DER file and 2) Blake2 was not configured Doing some tracing of the decoder operation showed that this is occuring because the OSSL_STORE lookup used to find the proper decoder uses a "first successful decode wins" approach, after which the loading code checks to see if the decoded type matches the expected key type. When decoding PEM, this isn't a problem, as the PEM armoring gives the decoder a hint as to why type of data the input file is. But with DER, there is no such hint, and we're at the mercy of whichever decoder happens to decode the data correctly first. Normally it works just fine, but when features are disabled or enabled, the order in which the decoders are attempted may change, affecting the outcome. In this particular case, disabling blake2 caused the DHX decoder to be attempted first, which decodes the input der file without issue. That in turn caused the subsequent EVP_PKEY_is_a check to fail (as we were expecting a DSA key), and so the test fails. Fortunately, the code that the dsaparam applet uses to do this decode provides a keytype hint, which we can use to guide the decode process. keep the old store lookup method around in case anyone doesn't pass a uri that is a file path or provide a keytype, but if we do both those things, we can use OSSL_DECODER_CTX_new_for_pkey to specifically tell the decoder that we want to decode the input data as the expected type (in this case a DSA key). Fixes #31944 Reviewed-by: Milan Broz <[email protected]> Reviewed-by: Tomas Mraz <[email protected]> Reviewed-by: Tim Hudson <[email protected]> MergeDate: Thu Jul 16 15:28:32 2026 (Merged from https://github.com/openssl/openssl/pull/31954)
* Remove parentheses around return argumentsDimitri Papadopoulos2026-07-081-1/+1
| | | | | | | | | | | | | | Since return is an operator and not a function, parentheses are not required. Found by running the checkpatch.pl Linux script to enforce coding style. Reviewed-by: Kurt Roeckx <[email protected]> Reviewed-by: Neil Horman <[email protected]> Reviewed-by: Norbert Pocs <[email protected]> Reviewed-by: Eugene Syromiatnikov <[email protected]> MergeDate: Wed Jul 8 10:11:13 2026 (Merged from https://github.com/openssl/openssl/pull/31860)
* apps: adjust stat usage to account for uplinkolszomal2026-07-081-5/+12
| | | | | | | | | | | | | Call stat() instead of fstat() when the FILE pointer provided by BIO_get_fp() is unavailable (as it may be the case in case of UPLINK builds). Signed-off-by: olszomal <[email protected]> Reviewed-by: Dmitry Belyavskiy <[email protected]> Reviewed-by: Eugene Syromiatnikov <[email protected]> MergeDate: Wed Jul 8 09:47:42 2026 (Merged from https://github.com/openssl/openssl/pull/28172)
* SSL_OP_SECOP is dead codeBob Beck2026-06-301-4/+0
| | | | | | | | | | | | Nothing set the "vfy" parameters in any of these functions to anything but 0. Remove the parameter and stage things related to SSL_OP_SECOP to go away in the future. Reviewed-by: Neil Horman <[email protected]> Reviewed-by: Norbert Pocs <[email protected]> MergeDate: Tue Jun 30 10:47:07 2026 (Merged from https://github.com/openssl/openssl/pull/31271)
* Drop Windows CE support.Bob Beck2026-06-252-6/+0
| | | | | | | | | | | | | | | | | | Windows CE has been out of mainstream support since 2018 and will not have a modern toolchain capable of compiling a modern OpenSSL. The vc_wince_info Perl helper, the crypto/LPdir_wince.c directory backend, and a long tail of _WIN32_WCE / OPENSSL_SYS_WINCE guards across the Windows code paths get removed. Spotted by idrassi. Reviewed-by: Nikola Pajkovsky <[email protected]> Reviewed-by: Tomas Mraz <[email protected]> MergeDate: Thu Jun 25 07:27:18 2026 (Merged from https://github.com/openssl/openssl/pull/31601)
* apps/lib/s_cb.c: actualise signature_tls13_scheme_listEugene Syromiatnikov2026-06-231-1/+51
| | | | | | | | | | | | | | | | | | Update signature_tls13_scheme_list array in accordance with the current state of the "TLS SignatureScheme" table at [1]; leave TLS 1.2 GOST definitions be for now. Note: these are used only for debugging output when -security_debug option is provided to s_client/s_server commands. [1] https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#tls-signaturescheme Signed-off-by: Eugene Syromiatnikov <[email protected]> Reviewed-by: Bob Beck <[email protected]> Reviewed-by: Neil Horman <[email protected]> MergeDate: Tue Jun 23 16:30:02 2026 (Merged from https://github.com/openssl/openssl/pull/31248)
* Use %zu for printing size_t valuesAndrew Dinh2026-06-151-2/+2
| | | | | | | | Reviewed-by: Neil Horman <[email protected]> Reviewed-by: Richard Levitte <[email protected]> Reviewed-by: Milan Broz <[email protected]> MergeDate: Mon Jun 15 19:24:43 2026 (Merged from https://github.com/openssl/openssl/pull/31454)
* apps/lib/apps.c: free retdb before return on OPENSSL_strdup() failureXZ-X2026-06-151-1/+7
| | | | | | | | | | Fixes: c7d5ea2670c2 "Prepare to detect index changes in OCSP responder." Reviewed-by: Paul Dale <[email protected]> Reviewed-by: Eugene Syromiatnikov <[email protected]> Reviewed-by: Norbert Pocs <[email protected]> MergeDate: Mon Jun 15 14:29:23 2026 (Merged from https://github.com/openssl/openssl/pull/24981)
* apps/cmp.c: fix use of SSL_set_tlsext_host_name() for SNI and ↵Dr. David von Oheimb2026-06-101-12/+45
| | | | | | | | | X509_VERIFY_PARAM_set1_host() Reviewed-by: Neil Horman <[email protected]> Reviewed-by: Eugene Syromiatnikov <[email protected]> MergeDate: Wed Jun 10 06:27:00 2026 (Merged from https://github.com/openssl/openssl/pull/27357)
* apps: fix printf formats according to param typesHerman Semenoff2026-06-011-1/+1
| | | | | | | | | | | | inttypes.h is also used for more accurate compatibility with all platforms, as it is the more correct choice according to C standard. Signed-off-by: Herman Semenoff <[email protected]> Reviewed-by: Paul Dale <[email protected]> Reviewed-by: Eugene Syromiatnikov <[email protected]> MergeDate: Mon Jun 1 06:58:23 2026 (Merged from https://github.com/openssl/openssl/pull/30969)
* apps/*.c,doc/man1/*.pod.in: fix doc and error output of cert_store vs. ↵Dr. David von Oheimb2026-06-011-6/+18
| | | | | | | | | chain_store/verify_store and PEM format Reviewed-by: Tomas Mraz <[email protected]> Reviewed-by: Eugene Syromiatnikov <[email protected]> MergeDate: Mon Jun 1 04:57:15 2026 (Merged from https://github.com/openssl/openssl/pull/25683)
* fix cmp mock server to not depend on NUL bytes in ASN1_STRINGBob Beck2026-05-201-1/+3
| | | | | | | | | | | | | ASN1_STRING is documented that the behavior of NUL byte addition should not be depended upon. The mock server calls strcmp on the bare data from an ASN1_STRING. This only works if the data is NUL terminated. Reviewed-by: Neil Horman <[email protected]> Reviewed-by: David von Oheimb <[email protected]> MergeDate: Wed May 20 16:01:47 2026 (Merged from https://github.com/openssl/openssl/pull/31202)
* apps/lib/tlssrp_depr.c: fix leak of vb in set_up_srp_verifier_file()huanghuihui09042026-05-131-0/+10
| | | | | | | | | | | | | | | | | | set_up_srp_verifier_file() allocates srp_callback_parm->vb via SRP_VBASE_new(). If SRP_VBASE_init() fails, vb must be freed before returning. Additionally, add SRP_VBASE_free() to the end: cleanup path in s_server.c so that vb is also freed on normal program exit. Solves https://github.com/openssl/openssl/issues/30362 Fixes #30362 Signed-off-by: huanghuihui0904 <[email protected]> Reviewed-by: Eugene Syromiatnikov <[email protected]> Reviewed-by: Matt Caswell <[email protected]> MergeDate: Wed May 13 07:20:48 2026 (Merged from https://github.com/openssl/openssl/pull/30434)
* Deprecate the X509_check_{email,host,ip,ip_asc} family of functionsBob Beck2026-05-111-27/+133
| | | | | | | | | | | | | | | | Our own documentation for quite some time has indicated that you should call X509_verify_cert() instead of using these. Actually deprecate them and make apps not use the now deprecated functions. Resolves: https://github.com/openssl/project/issues/1899 References: https://github.com/openssl/project/issues/1897 Reviewed-by: Neil Horman <[email protected]> Reviewed-by: Eugene Syromiatnikov <[email protected]> Reviewed-by: Norbert Pocs <[email protected]> MergeDate: Mon May 11 00:08:33 2026 (Merged from https://github.com/openssl/openssl/pull/30403)
* Fix missing prototype for win32_utf8argv under MINGW64Milan Broz2026-04-301-0/+1
| | | | | | | | | | | With strict warnings build fails on missing win32_utf8argv() function definition. Reviewed-by: Tomas Mraz <[email protected]> Reviewed-by: Eugene Syromiatnikov <[email protected]> Reviewed-by: Norbert Pocs <[email protected]> MergeDate: Thu Apr 30 11:42:18 2026 (Merged from https://github.com/openssl/openssl/pull/30941)
* pkey(1) missing setup for interactive pass promptViktor Dukhovni2026-04-221-4/+8
| | | | | | | | | | | | | | | The changes in #29324 neglected some setup needed for interactive password prompting, leading to a segfaul when pkey(1) is asked to encrypt, but not given an explicit `-pass` argument. The required plumbing is added. Fixes: #30889 Reviewed-by: Matt Caswell <[email protected]> Reviewed-by: Eugene Syromiatnikov <[email protected]> MergeDate: Wed Apr 22 07:04:47 2026 (Merged from https://github.com/openssl/openssl/pull/30904)
* Fix memory leak in load_key_certs_crls() when add/push failsherbenderbler2026-04-211-4/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | When X509_add_cert() or sk_X509_CRL_push() failed, the cert or CRL from OSSL_STORE was not freed. Free on failure to avoid a leak. Fix 90-test_memfail.t parsing of count output so the memfail suite runs correctly: parse 'skip: N count M' with a regex (handles '# ' prefix), return (0,0) if the count file cannot be opened, and skip with a clear message when total malloc count is 0 instead of planning 0 tests. Apply clang-format to test/load_key_certs_crls_memfail.c. - apps/lib/apps.c: free cert/CRL on add/push failure - test/build.info: add load_key_certs_crls_memfail (allocfail-tests) - test/load_key_certs_crls_memfail.c: regression test for issue #30364 - test/recipes/90-test_memfail.t: fix get_count_info parsing and plan Issue #30364 Fixes: 6d382c74b375 "Use OSSL_STORE for load_{,pub}key() and load_cert() in apps/lib/apps.c" Fixes: d7fcee3b3b5fa "OSSL_HTTP_parse_url(): add optional port number return parameter and strengthen documentation" Reviewed-by: Eugene Syromiatnikov <[email protected]> Reviewed-by: Nikola Pajkovsky <[email protected]> MergeDate: Tue Apr 21 08:50:18 2026 (Merged from https://github.com/openssl/openssl/pull/30428)
* apps: remove atoi() calls.Filipe R. Da Silva2026-04-131-3/+3
| | | | | | | | | | Related to #8216 Reviewed-by: Eugene Syromiatnikov <[email protected]> Reviewed-by: Paul Dale <[email protected]> Reviewed-by: Frederik Wedel-Heinen <[email protected]> MergeDate: Mon Apr 13 09:30:21 2026 (Merged from https://github.com/openssl/openssl/pull/30476)
* Update apps/lib/s_cb.cSashan2026-04-101-1/+1
| | | | | | | | | Co-authored-by: Bob Beck <[email protected]> Reviewed-by: Neil Horman <[email protected]> Reviewed-by: Tomas Mraz <[email protected]> MergeDate: Fri Apr 10 12:22:48 2026 (Merged from https://github.com/openssl/openssl/pull/30596)
* Update apps/lib/s_cb.cSashan2026-04-101-1/+1
| | | | | | | | | Co-authored-by: Bob Beck <[email protected]> Reviewed-by: Neil Horman <[email protected]> Reviewed-by: Tomas Mraz <[email protected]> MergeDate: Fri Apr 10 12:22:46 2026 (Merged from https://github.com/openssl/openssl/pull/30596)
* fix BIO_vsnprintf() with NULL string arg crash on Solaris 10Alexandr Nedvedicky2026-04-101-5/+17
| | | | | | | | | | | Issue was kindly reported and fixes suggested by @rainerjung Fixes #30402 Reviewed-by: Neil Horman <[email protected]> Reviewed-by: Tomas Mraz <[email protected]> MergeDate: Fri Apr 10 12:22:44 2026 (Merged from https://github.com/openssl/openssl/pull/30596)
* apps/lib/apps.c: use fstat on an opened fd in app_mmap_file()Eugene Syromiatnikov2026-04-011-11/+19
| | | | | | | | | | | | | | | | | Coverity has rightfully complained that using stat() before opening file leads to TOCTOU issues, refactor the code to open the file first and then perform stat checks on the opened file descriptor. It is still far from foolproof, as the file is not locked, and stat() is used elsewhere, but at least it seems to be a step in the right direction. Resolves: https://scan5.scan.coverity.com/#/project-view/65248/10222?selectedIssue=1690686 Fixes: 80b7e49c273f "Use mmap for pkeyutl -rawin and dgst one-shot input" Signed-off-by: Eugene Syromiatnikov <[email protected]> Reviewed-by: Neil Horman <[email protected]> Reviewed-by: Paul Dale <[email protected]> MergeDate: Wed Apr 1 12:46:08 2026 (Merged from https://github.com/openssl/openssl/pull/30624)
* Use mmap for pkeyutl -rawin and dgst one-shot inputherbenderbler2026-03-271-0/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When using openssl pkeyutl -rawin or openssl dgst for one-shot sign/verify (e.g. Ed25519, Ed448), file input is now read via mmap() on Unix where supported, avoiding a full buffer allocation and copy. Large files are supported without doubling memory use; on failure of the mmap path we do not fall back to the buffer path. - Add app_mmap_file() in apps/lib/apps.c: stat/open/mmap/close, tri-state return (1 mapped, 0 size zero, -1 error). Parameter err_bio avoids shadowing global bio_err (-Wshadow). - apps/pkeyutl.c and apps/dgst.c: use app_mmap_file(); single exit for mmap path in pkeyutl; dgst includes apps.h first for _FILE_OFFSET_BITS; do_fp_oneshot_sign returns EXIT_SUCCESS/EXIT_FAILURE like do_fp(); no fallback when mmap attempted but fails. - pkeyutl mmap/buffer path: pass filesize to EVP_DigestVerify and EVP_DigestSign (review suggestion, avoids casting buf_len). - Error messages: per-file messages for stat/size (dgst, pkeyutl); CHANGES.md "Unix-like" and "16 MB" (documentation style). - Centralize _FILE_OFFSET_BITS and mmap includes in apps/include/apps.h. - Tests: pkeyutl/dgst oneshot from file, no-fallback regression tests; use srctop_dir for test paths; stderr patterns for mmap errors. - Docs: man pages and CHANGES.md. CI fixes: return failure from dgst one-shot sign when mmap fails; treat non-regular paths as mmap errors in app_mmap_file() and pkeyutl; reject directories before mmap. Addresses review feedback from DDvO, npajkovsky, and vdukhovni (PR #30429). Fixes #11677 Co-authored-by: Viktor Dukhovni <[email protected]> Co-authored-by: David von Oheimb <[email protected]> Reviewed-by: David von Oheimb <[email protected]> Reviewed-by: Viktor Dukhovni <[email protected]> Reviewed-by: Paul Dale <[email protected]> MergeDate: Fri Mar 27 16:25:33 2026 (Merged from https://github.com/openssl/openssl/pull/30429)
* cmp_vfy.c,doc/,test/: when trying to use cached CMP message sender cert, no ↵Dr. David von Oheimb2026-03-251-0/+35
| | | | | | | | more check its revocation and chain Reviewed-by: Neil Horman <[email protected]> Reviewed-by: Paul Dale <[email protected]> (Merged from https://github.com/openssl/openssl/pull/28973)
* apps/cmp_mock_srv: fix resource leak in process_genm()YZL0v3ZZ2026-03-161-0/+1
| | | | | | | | | | | | | | If pushing the generated rsp ITAV object into the out stack fails, the error path frees the stack container but permanently abandons the newly allocated rsp object. Explicitly free the rsp structure if it exists and was not pushed successfully to prevent this memory leak. Reviewed-by: Frederik Wedel-Heinen <[email protected]> Reviewed-by: Eugene Syromiatnikov <[email protected]> MergeDate: Mon Mar 16 11:16:02 2026 (Merged from https://github.com/openssl/openssl/pull/30374)
* Fix memory leak in get_str_from_file()YZL0v3ZZ2026-03-131-0/+1
| | | | | | | | | | | | | | | If BIO_gets encounters an empty file or read error, the function returns NULL without freeing the dynamically allocated heap block (buf). Safely clear and free the allocated buffer before returning NULL on the error path. Since get_str_from_file() may handle cryptographic keys, OPENSSL_clear_free() is used to prevent leaking sensitive data. Reviewed-by: Eugene Syromiatnikov <[email protected]> Reviewed-by: Paul Dale <[email protected]> Reviewed-by: Norbert Pocs <[email protected]> Reviewed-by: Todd Short <[email protected]> (Merged from https://github.com/openssl/openssl/pull/30373)
* Fix resource leak in crls_http_cb()YZL0v3ZZ2026-03-131-1/+1
| | | | | | | | | | | | | | | | | When the function fails to push the second CRL to the stack, it incorrectly uses sk_X509_CRL_free() instead of sk_X509_CRL_pop_free(). This destroys the stack container but orphans previously pushed X509_CRL objects. Replace it with sk_X509_CRL_pop_free passing X509_CRL_free as the cleanup routine to ensure deep deallocation of any pushed items. Reviewed-by: Eugene Syromiatnikov <[email protected]> Reviewed-by: Tomas Mraz <[email protected]> Reviewed-by: Paul Dale <[email protected]> Reviewed-by: Norbert Pocs <[email protected]> Reviewed-by: Todd Short <[email protected]> (Merged from https://github.com/openssl/openssl/pull/30372)
* apps: unload provider on app_provider_load() failureBrittany Morris2026-03-131-0/+1
| | | | | | | | | | CLA: trivial Reviewed-by: Paul Dale <[email protected]> Reviewed-by: Eugene Syromiatnikov <[email protected]> Reviewed-by: Tomas Mraz <[email protected]> MergeDate: Fri Mar 13 08:10:06 2026 (Merged from https://github.com/openssl/openssl/pull/30314)
* fix NULL pointer dereference when pass1 is NULLAlexandr Nedvedicky2026-03-121-2/+4
| | | | | | | | | | | | Resolves: https://scan5.scan.coverity.com/#/project-view/62622/10222?selectedIssue=1684201 Complements: #adc8e4abd96 Fix Memory leak in app_passwd Reviewed-by: Nikola Pajkovsky <[email protected]> Reviewed-by: Tomas Mraz <[email protected]> Reviewed-by: Eugene Syromiatnikov <[email protected]> Reviewed-by: Paul Dale <[email protected]> MergeDate: Thu Mar 12 11:32:05 2026 (Merged from https://github.com/openssl/openssl/pull/30365)
* Fix Memory leak in app_passwdhuanghuihui09042026-03-101-1/+4
| | | | | | | | | | Reviewed-by: Eugene Syromiatnikov <[email protected]> Reviewed-by: Paul Yang <[email protected]> Reviewed-by: Neil Horman <[email protected]> Reviewed-by: Tomas Mraz <[email protected]> Reviewed-by: Paul Dale <[email protected]> MergeDate: Tue Mar 10 17:42:48 2026 (Merged from https://github.com/openssl/openssl/pull/30325)
* Copyright year updatesopenssl-machine2026-03-1012-12/+12
| | | | | | | Reviewed-by: Tomas Mraz <[email protected]> Reviewed-by: Eugene Syromiatnikov <[email protected]> MergeDate: Tue Mar 10 14:37:54 2026 Release: yes