aboutsummaryrefslogtreecommitdiffstats
path: root/apps/lib
Commit message (Collapse)AuthorAgeFilesLines
* 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
* Improved handling of AKID/SKID extensions in CSRs and certsViktor Dukhovni2026-02-281-50/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With the advent of the new AKID and SKID value syntax: - subjectKeyIdentifier = none - authorityKeyIdentifier = none the resulting extensions are not directly suppressed, instead they are parsed respectively as an empty OCTET STRING or an empty SEQUENCE. There was new code in "apps/" to then drop the extension when signing certificates, but this did not address applications that sign certificates via the API, nor did it avoid adding these in CSRs. We now drop these specific empty extensions from both certificates and CSRs as part of X509v3_add_ext(), with the parsed extension never added to the extension stack. This means that in the "apps" the default "hash" or "keyid, issuer" values must now be created first, with config settings and command-line options applied after replacing the default as requested (including "none" to suppress the extensions if desired). If somehow an application manages to construct a TBS cert or CSR with a pending empty SKID or AKID extension, an error is raised and the TBS is not signed. When no SKID is present in a self-signed cert, attempts to force an AKID keyid need to fail, rather than produce an AKID that will never match. Similarly, when issuer cert == subject cert (same object in memory), but the issuer key is not the subject key (forced signing key), there is no way to infer the unknown issuer's name or serial number, so, with "issuer:always" we must fail, rather than record the subject's own issuer name and serial. New "keyid:nonss" and "issuer:nonss" syntax is now supported, which allows either part of the AKID to be conditional on the certificate not being self-signed. In the case if "issuer:nonss" this is also conditional on there being no non-empty issuer keyid. To force inclusion of issuer+serial in the AKID use "issuer:always". Reviewed-by: Matt Caswell <[email protected]> Reviewed-by: Neil Horman <[email protected]> MergeDate: Sat Feb 28 15:22:47 2026 (Merged from https://github.com/openssl/openssl/pull/29057)
* Added -expected-rpks s_client/server optionViktor Dukhovni2026-02-281-0/+106
| | | | | | | Reviewed-by: Matt Caswell <[email protected]> Reviewed-by: Tomas Mraz <[email protected]> MergeDate: Sat Feb 28 09:17:23 2026 (Merged from https://github.com/openssl/openssl/pull/30089)
* Improved reporting of shared and peer sigalgsDaniel Kubec2026-02-251-37/+15
| | | | | | | | | | | | | | | | The existing SSL_get_sigalgs() and SSL_get_shared_sigalgs() are not a good fit for TLS 1.3, because signature schemes are no longer generally combinations of separate digest and signing algorithms encoded in the two byte codepoint. The new SSL_get0_sigalg() and SSL_get0_shared_sigalg() functions just report the signature scheme name and codepoint. Reviewed-by: Matt Caswell <[email protected]> Reviewed-by: Tim Hudson <[email protected]> Reviewed-by: Tomas Mraz <[email protected]> MergeDate: Wed Feb 25 11:30:16 2026 (Merged from https://github.com/openssl/openssl/pull/29982)
* Fix const qualifiers from strchr where discardedRudi Heitbaum2026-02-251-3/+3
| | | | | | | | | | | | | | | | | | | | | This patch fixes several const qualifiers byu adding where required. warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers] Since glibc-2.43 and ISO C23, the functions bsearch, memchr, strchr, strpbrk, strrchr, strstr, wcschr, wcspbrk, wcsrchr, wcsstr and wmemchr that return pointers into their input arrays now have definitions as macros that return a pointer to a const-qualified type when the input argument is a pointer to a const-qualified type. Signed-off-by: Rudi Heitbaum <[email protected]> Reviewed-by: Dmitry Belyavskiy <[email protected]> Reviewed-by: Eugene Syromiatnikov <[email protected]> Reviewed-by: Paul Dale <[email protected]> Reviewed-by: Neil Horman <[email protected]> MergeDate: Wed Feb 25 11:04:09 2026 (Merged from https://github.com/openssl/openssl/pull/30136)
* Constify X509_STORE_CTX functions invoving X509 *Bob Beck2026-02-252-2/+2
| | | | | | | | | | | | | | | | | X509_STORE_CTX *ctx, const X509 *x); X509_STORE_CTX_get1_issuer(X509 **issuer, X509_STORE_CTX *ctx, const X509 *x); int X509_STORE_CTX_init(X509_STORE_CTX *ctx, X509_STORE *trust_store, const X509 *target, STACK_OF(X509) *untrusted); const X509 *X509_STORE_CTX_get0_cert(const X509_STORE_CTX *ctx); const X509 *X509_STORE_CTX_get_current_cert(const X509_STORE_CTX *ctx); const X509 *X509_STORE_CTX_get0_current_issuer(const X509_STORE_CTX *ctx); void X509_STORE_CTX_set_cert(X509_STORE_CTX *ctx, const X509 *target); For #30052 Reviewed-by: Neil Horman <[email protected]> Reviewed-by: Paul Dale <[email protected]> MergeDate: Wed Feb 25 10:24:15 2026 (Merged from https://github.com/openssl/openssl/pull/30076)
* Make ASN1_STRING opaqueBob Beck2026-02-251-4/+15
| | | | | | | | | | | | | | | | | This laudable goal, should it land, will be followed with an issue raised to eat our own dogfood and find every file with <crypto/asn1.h> added to it in this commit, and change to the appropriate accessors, which should be possible in most places we aren't actually implementing things that change the values Fixes: https://github.com/openssl/openssl/issues/29860 Reviewed-by: Neil Horman <[email protected]> Reviewed-by: Paul Dale <[email protected]> Reviewed-by: Tomas Mraz <[email protected]> MergeDate: Wed Feb 25 10:14:57 2026 (Merged from https://github.com/openssl/openssl/pull/29862)
* Constify X509_get_ext() and friends..Bob Beck2026-02-241-6/+5
| | | | | | | | | | | | | | These all took const, but returned non const, they should return const. This then triggers constifying of a whole class of get_ext() functions. Part of #28654 and #29117 Fixes: openssl/project#1779 Reviewed-by: Eugene Syromiatnikov <[email protected]> Reviewed-by: Neil Horman <[email protected]> MergeDate: Tue Feb 24 18:53:25 2026 (Merged from https://github.com/openssl/openssl/pull/29465)
* Fix the uses of X509_check_certificate_timesRichard Levitte2026-02-231-6/+2
| | | | | | | | | | | | | | | | The "error" parameter to 'X509_check_certificate_times' gets an X509 error value, which isn't a OpenSSL ERR reason code. Unfortunately, this was conflated. This restores the behaviour in the places of conflation to something similar enough to what was done before 'X509_check_certificate_times' was implemented. Reviewed-by: David von Oheimb <[email protected]> Reviewed-by: Tomas Mraz <[email protected]> Reviewed-by: Neil Horman <[email protected]> MergeDate: Mon Feb 23 15:43:21 2026 (Merged from https://github.com/openssl/openssl/pull/30088)
* X509V3_set_nconf(): Improve error handling using this function, mostly in apps/Dr. David von Oheimb2026-02-211-0/+20
| | | | | | Reviewed-by: Tomas Mraz <[email protected]> Reviewed-by: Viktor Dukhovni <[email protected]> (Merged from https://github.com/openssl/openssl/pull/16998)
* ECH build artefacts and a bit of codeStephen Farrell2026-02-201-0/+4
| | | | | | Reviewed-by: Tomas Mraz <[email protected]> Reviewed-by: Matt Caswell <[email protected]> (Merged from https://github.com/openssl/openssl/pull/25193)
* windows: Remove redundant includeNorbert Pocs2026-02-131-1/+0
| | | | | | | | | | | | The functions malloc, realloc and free are included from stdlib, therefore no need for redundant malloc.h include. Signed-off-by: Norbert Pocs <[email protected]> Reviewed-by: Saša Nedvědický <[email protected]> Reviewed-by: Tomas Mraz <[email protected]> MergeDate: Fri Feb 13 15:13:13 2026 (Merged from https://github.com/openssl/openssl/pull/29989)
* Cleanup of printing in appsPhilip Prindeville2026-02-1311-106/+107
| | | | | | | | | | Don't use BIO_printf() where BIO_puts() will do. Reviewed-by: Paul Dale <[email protected]> Reviewed-by: Shane Lontis <[email protected]> Reviewed-by: Tomas Mraz <[email protected]> MergeDate: Fri Feb 13 15:05:38 2026 (Merged from https://github.com/openssl/openssl/pull/29677)
* Fix const spec in appsMilan Broz2026-02-042-8/+8
| | | | | | | | | | | | | | | | | | | | | | This patch fixes several const specifiers (visible with non-default const-qual warning). - Functions like SSL_set_tlsext_host_name takes non-cost hostname parameter. - packet buffer is read in BIO_read, so it cannot be const The rest is missing const specifiers where casting to non-cost is not needed. Signed-off-by: Milan Broz <[email protected]> Reviewed-by: Saša Nedvědický <[email protected]> Reviewed-by: Nikola Pajkovsky <[email protected]> Reviewed-by: Neil Horman <[email protected]> MergeDate: Wed Feb 4 19:49:15 2026 (Merged from https://github.com/openssl/openssl/pull/29796)
* Report truncation in oneshot `openssl dgst -sign`Viktor Dukhovni2026-01-261-27/+28
| | | | | | | | | | | | | | | Previously input was silently truncated at 16MB, now if the input is longer than limit, an error is reported. The bio_to_mem() apps helper function was changed to return 0 or 1, and return the size of the result via an output size_t pointer. Fixes CVE-2025-15469 Reviewed-by: Saša Nedvědický <[email protected]> Reviewed-by: Eugene Syromiatnikov <[email protected]> Reviewed-by: Tomas Mraz <[email protected]> MergeDate: Mon Jan 26 19:37:41 2026
* apps/lib/apps.c: fix load_certs_multifile() and load_certstore() w.r.t. ↵Dr. David von Oheimb2026-01-071-4/+12
| | | | | | | | | password source vs. actual password Reviewed-by: Dmitry Belyavskiy <[email protected]> Reviewed-by: Norbert Pocs <[email protected]> Reviewed-by: Paul Dale <[email protected]> (Merged from https://github.com/openssl/openssl/pull/28477)
* apps/lib/apps.c load_key_certs_crls() refactor uidata use and tweak error ↵Dr. David von Oheimb2026-01-071-5/+2
| | | | | | | | | message Reviewed-by: Dmitry Belyavskiy <[email protected]> Reviewed-by: Norbert Pocs <[email protected]> Reviewed-by: Paul Dale <[email protected]> (Merged from https://github.com/openssl/openssl/pull/28477)