summaryrefslogtreecommitdiff
path: root/src (follow)
Commit message (Collapse)AuthorAgeFilesLines
* tweak previous: "functions returns" -> "functions return"schwarze9 days1-4/+4
| | | | and add a missing Oxford comma
* Let this compile on m88k.miod10 days1-1/+3
|
* Use BN_ULONG in probable_prime_dh()tb10 days1-2/+2
| | | | | | | | | This was the last user of BN_LONG in code. It had no reason to do so. BN_mod_word() returns a BN_ULONG and since the largest prime in the small primes table primes[] is well below 20000, the only return value that could cause 'mod' to be negative was the error sentinel (BN_ULONG)-1. ok jsing kenjiro
* Use more specific types for BN.jsing11 days1-27/+29
| | | | | | | | | | | Be specific about width and use uint64_t/uint32_t, rather than using unsigned int/long/long long, based on platform. Additionally use UINT64_C() and UINT32_C() for constants, along with PRI*64/PRI*32 for formatting. This makes the platform responsible for providing the correct types/defines - all we then need to do is determine is if BN should use a 32 bit or 64 bit configuration. With input from and ok tb@
* Avoid the use of _LP64 in libcrypto regress.jsing11 days1-2/+2
| | | | | | | What the tests actually care about is the size of a BN_ULONG, hence condition on BN_BYTES instead. Discussed with tb@
* In nref_nos() don't leak the ASN1_INTEGER if the push failstb12 days1-2/+4
| | | | | | | (A much bigger problem here is a double free for which I will send out a diff shortly) From Niels Dossche
* x509_cpols: pass correct free function to sk_ASN1_INTEGER_free()tb12 days1-2/+2
| | | | from Niels Dossche
* x509_cpols: indent labels to make diffs more readabletb12 days1-8/+8
|
* Plug memeory leak in CMS_EncryptedData_encrypt()tb12 days1-2/+4
| | | | | | If CMS_EncryptedData_set1_key() fails, cms is leaked. From Niels Dossche
* ec_curve: Remove outdated creditstb14 days1-4/+1
|
* Needs <sys/param.h> for hppa.miod2025-10-311-3/+3
|
* des_key: add missing hyphen in semi-weak keystb2025-10-271-2/+2
| | | | From Thorsten Blum
* This test takes *days* to complete on older platforms, reduce the loop countmiod2025-10-261-2/+8
| | | | for them.
* Simplify tls13_server_hello_build()tb2025-10-251-5/+5
| | | | | | | | There's no need to pass in the hrr parameter as it is redundant with the tls13.hrr flag. This avoids boolean blindness in the caller and removes a leftover from before we had tls13.hrr. ok jsing kenjiro
* Add missing Nm line for SSL_SESSION_duptb2025-10-241-2/+3
|
* Add some regress coverage for SSL_SESSION_dup()tb2025-10-241-2/+22
| | | | ok kenjiro
* The ssl_verify_param.c test can now link dynamically against libcryptotb2025-10-241-3/+1
|
* Use X509_VERIFY_PARAM_get_hostflags() prototype from x509_vfy.htb2025-10-241-3/+2
|
* bump lib{crypto,ssl,tls} minors after symbol additiontb2025-10-243-3/+3
|
* Document SSL_SESSION_dup(3)tb2025-10-241-3/+20
| | | | ok kenjiro
* Provide SSL_SESSION_dup()tb2025-10-244-3/+13
| | | | | | | As reported by ajacoutot and sthen, an update to net/neon is blocked on that missing symbol. ok kenjiro
* Document X509_VERIFY_PARAM_set_hostflags(3)tb2025-10-241-2/+15
| | | | ok kenjiro
* Expose X509_VERIFY_PARAM_get_hostflags()tb2025-10-244-4/+7
| | | | | | | | | | | | | | This is needed by Python 3.14, extending the urllib3 nonsense further. This is a trivial getter and it is exercised by the libssl unit test I added for urllib3 (which can now use dynamic linking for libcrypto). Fixes https://github.com/libressl/portable/issues/1202 Thanks to @orbea for the report. ok kenjiro PS: X509_VERIFY_PARAM_get_flags() and X509_VERIFY_PARAM_get_peername() aren't const correct. Fixing this will require some doing...
* Implement ffsl() and ffsll() using the compiler builtin __builtin_ctzlclaudio2025-10-244-11/+66
| | | | | | now that all archs use at least gcc4. ffsl() and ffsll() are now part of POSIX. OK deraadt@, input from miod@ and jsg@
* libssl: const correct the ssl_session_dup() helpertb2025-10-242-5/+5
| | | | | | | | | This allows a const correct SSL_SESSION_dup() implementation at the cost of casting away const due to the const incorrect CRYPTO_dup_ex_data()... (I should look into fixing that, but things like rust-openssl make that hard at this point in the release cycle.) ok kenjiro (as part of a larger diff)
* Prepare for gcc 3 leaving the building, COMPILER_VERSION can no longer getmiod2025-10-231-4/+4
| | | | set to "gcc3".
* Revert r1.286 now that all supported platforms have __builtin_clz.miod2025-10-231-20/+1
|
* Give this test a chance to pass on 32-bit platforms.miod2025-10-201-1/+2
|
* Ensure that we specify the correct group when creating a HelloRetryRequest.jsing2025-10-162-9/+4
| | | | | | | | | | | | | | | | | When processing the client supported groups and key shares extensions, the group selection is currently based on client preference. However, when building a HRR the preferred group is identified by calling tls1_get_supported_group(). If SSL_OP_CIPHER_SERVER_PREFERENCE is enabled, group selection will be based on server instead of client preference. This in turn can result in the server sending a HRR for a group that the client has already provided a key share for, violating the RFC. Avoid this issue by storing the client preferred group when processing the key share extension, then using this group when creating the HRR. Thanks to dzwdz for identifying and reporting the issue. ok beck@ tb@
* use strtonum() instead of atoi(), and error out for bad numbersderaadt2025-10-111-2/+7
| | | | | | | This generates a host-order number, so the ntohs() for getservbyport() was wrong, that should always have been htons(). The transform is the same, but misleading. ok tb
* const correct X509_VERIFY_PARAM_get_hostflags()tb2025-10-102-4/+4
| | | | | | | This is currently an internal helper only used by a regress test. We'll have to expose in the public API for Python 3.14: https://github.com/libressl/portable/issues/1202
* Remove unused sequence member from x509_revoked_sttb2025-10-102-11/+2
| | | | | | | | | | | | | | | | | To allow binary search for looking up if a cert was revoked in a CRL, the list of revoked serial numbers is sorted in crl_lookup(). On the other hand, to be able to output the DER that was actually signed by the issuer, the original order needs to be remembered. Before the encoding was cached, there was a mechanism that would restore the original order on serialization using the .sequence member. This was done without a lock and was thus racy (hilarity would ensue if one thread performed a CRL lookup while another thread serialized the same CRL). When the racy mechanism was removed in 2004, the only reader of .sequence, X509_REVOKED_seq_cmp(), was also removed, and this piece of dead code was left behind. Garbage collect it. ok kenjiro
* Revert previous. Let's deal with it when the portable release is out.tb2025-10-071-7/+3
|
* test framework: allow overriding the "/tmp/" directorytb2025-10-071-3/+7
| | | | | Windows is super picky when it comes to paths, so it needs some special massaging. Will let us avoid a patch or hack in portable.
* cms: fix incorrect length check in kek_unwrap_key()tb2025-09-301-2/+2
| | | | | | | | | | An incorrect length check can result in a 4-byte overwrite and an 8-byte overread. From Stanislav Fort and Viktor Dukhovni via OpenSSL. CVE-2025-9230. ok jsing
* cms_RecipientInfo_pwri_crypt: fix incorrect return checktb2025-09-301-3/+3
| | | | ok jsing
* cms_RecipientInfo_pwri_crypt: plug leak of kekalgtb2025-09-301-3/+3
| | | | ok jsing
* libcrypto: rsa gen: min. distance between p and qjan2025-09-291-3/+19
| | | | | | | | | | | | | | | | | This is required in NIST Special Publication 800-56B Revision 2 "Recommendation for Pair-Wise Key Establishment Using Integer Factorization Cryptography": 6 RSA Key Pairs 6.2 Criteria for RSA Key Pairs for Key Establishment 6.2.1 Definition of a Key Pair 3. The prime factors p and q shall be generated using one of the methods specified in Appendix B.3 of FIPS 186 such that: c. |p – q| > 2nBits/2−100 ok djm@, tb@
* Bump libressl version to 4.2.0tb2025-09-281-3/+3
| | | | | The version check will break the rust-openssl regress unless you have rust-openssl-tests-20250927p0.
* Revert NULL,0 -> OPENSSL_FILE,OPENSSL_LINE from r1.78tb2025-09-281-9/+9
| | | | | | | | | | | This wasn't part of the initial proposal and causes issues in curl downstream. We could pile more hacks on top of this, but at some point this is getting too silly. Relatedly, most of the FOOerr() could be removed, although PEMerr(), RSAerr() and SSLerr() are used by some downstreams and probably not worth patching out. Discussed with @vszakats in https://github.com/libressl/portable/issues/1154
* ec_asn1_test: add an example using BLS12-377tb2025-09-171-1/+80
| | | | | | This exercises the cofactor guessing code with a large cofactor. Thanks to Daniel Bleichenbacher for pointing out this example. This contains a hack to use a bogus OID since this curve has none.
* wycheproof: provide PBKDF2 test harnesstb2025-09-161-2/+58
| | | | | Skip the tests for now since they increase the test's runtime by ~50%. A later commit will gate these tests behind REGRESS_SKIP_SLOW.
* mlkem_generate_key_external_entropy: normalize sizeof() usetb2025-09-161-2/+2
|
* Simplify MLKEM_{private,public}_key_new()tb2025-09-161-19/+7
| | | | | | | This removes two unnecessary variables in each of these functions, normalizes the sizeof() use and undoes unnecessary line wraps. ok deraadt djm kenjiro
* wycheproof: run HMACSM3 tests against libcryptotb2025-09-151-4/+7
|
* aes: move explicit_bzero() after NULL checktb2025-09-151-5/+7
| | | | | | CID 621601 621602 ok djm jsg jsing miod
* MLKEM_private_key_new: add missing space before =tb2025-09-151-2/+2
|
* wycheproof: run ML-KEM test vectors against libcryptotb2025-09-141-2/+139
|
* mlkem_public_to_private: fix overread/information leaktb2025-09-141-3/+3
| | | | | | | | | | | | After the guts of MLKEM_public_key were changed from a union to a struct, the aligner grew the struct, leaking as many bytes of private key data as the struct grew (on normal platforms that would be 2). Ideally this would all be a bit more robust. CID 621603 621604 ok jsing kenjiro
* wycheproof: zap stray empty linetb2025-09-091-2/+1
|