summaryrefslogtreecommitdiff
path: root/src/lib/libc/stdlib/recallocarray.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2022-12-02Revert bio_prev removaltb2-2/+12
As schwarze points out, you can pop any BIO in a chain, not just the first one (bonus points for a great name for this API). The internal doubly linked was used to fix up the BIO chain bio was part of when you BIO_pop() a bio that wasn't in the first position, which is explicitly allowed in our documentation and implied by OpenSSL's.
2022-12-02bn_mod_exp.c: printing to stdout needs no BIOtb1-17/+9
2022-12-02bn_mod_exp: we have a BN_CTX available...tb1-19/+15
Use BN_CTX_get() instead of BN_new()/BN_free().
2022-12-02Check BN_rand() and BN_mod() return valuestb1-6/+11
CID 430848 CID 430849
2022-12-02Link new bn_mod_exp_zero test to buildtb1-1/+3
2022-12-02Rewrite the tests that various modular exponentiation functionstb2-148/+189
compute a^0 = 0 (mod 1) for all a from scratch.
2022-12-02libcrypto/bn: switch back to manual regress targetstb1-3/+8
The previous change had the undesired side effect of running the super verbose run-regress-bn_test.
2022-12-02regres/libssl/unit: simplify Makefiletb1-20/+10
2022-12-02Use regress framework rather than handrolling ittb1-12/+1
2022-12-02Use the default targets from bsd.regress.mk as far as possibletb1-9/+4
2022-12-02Let bsd.regress.mk take care of running teststb1-8/+1
2022-12-02bn_add_sub: no need for a BIO to print to stderrtb1-21/+13
2022-12-01Unhook exptb1-2/+1
2022-12-01Fix typo, move one .PHONY target nearer to the target itselftb1-4/+3
2022-12-01zap extra blank linetb1-2/+1
2022-12-01Check that the bn_isqrt -C output isn't changedtb2-1/+43
bn_isqrt -C generates code included in lib/libcrypto/lib/bn_isqrt.c. The regress tests already ensure that the content of the tables don't change. Ensure further that the code generation doesn't get out of sync.
2022-12-01Update reference to table generationtb1-2/+2
2022-12-01regress/libcrypto: merge exp/ into bn/tb3-11/+4
Move exp/exptest.c to bn/bn_mod_exp.c. This is a BN test that mostly tests a variety of BN_mod_exp*() API behavior and correctness. Commit stolen from jsing
2022-12-01Silence this test and sprinkle some KNFtb1-11/+6
This test is fast enough even on very slow machines that printing dots doesn't seem necessary.
2022-12-01Flatten structure of libcrypto/bn teststb15-116/+62
The bn tests were distributed into three subdirectories rather randomly. It's cleaner and easier to maintain if all this is in a single directory. Use consistent names for the .c files, unify handling of the tests with the exception of bn_test, which is special. Discussed with jsing
2022-12-01Test prime constants exposed in public BN APItb1-1/+97
Run the prime constants exposed in BN_get0_nist_prime_*() and BN_get_rfc3526_prime_*() through Ballie-PSW.
2022-12-01Make tests silent on success.tb2-21/+17
Also, run all x25519 tests, don't stop on first failure.
2022-12-01Refrain from printing SUCCESS in some of my teststb13-50/+16
Silence is good. On failure, the regress framework will make it clear.
2022-12-01Mark the X509_V_FLAG_CB_ISSUER_CHECK flag as deprecatedtb1-11/+5
2022-12-01Annotate X509_V_FLAG_CB_ISSUER_CHECK as deprecated and unusedtb1-3/+3
2022-12-01Retire X509_V_FLAG_CB_ISSUER_CHECKtb1-16/+8
This flag has been deprecated in OpenSSL 1.1 and has not had an effect since. This way we can simplify the default check_issued() callback, which helpfully has its arguments reversed compared to the public API X509_check_issued(). ok jsing
2022-12-01Getters and setters for the check_issued() callbacktb3-3/+39
Open62541 uses X509_STORE_CTX_get_check_issued(), so provide it along with X509_STORE_{get,set}_check_issued(). As you would expect, they all return or take an X509_STORE_CTX_check_issued_fn. The getters aren't const in OpenSSL 1.1, but they now are in OpenSSL 3... These will be made available in the next minor bump and will ship in the stable release of LibreSSL 3.7 Part of OpenSSL commit 1060a50b See also https://github.com/libressl-portable/portable/issues/748 ok beck jsing
2022-12-01BN_one() can fail, check its return value.jsing1-3/+5
2022-12-01BN_one() can fail, check its return value.jsing2-9/+16
ok tb@
2022-11-30Rewrite bn_correct_top().jsing2-14/+10
bn_correct_top() is currently a macro and far more complex than it needs to be - rewrite it as a function. ok tb@
2022-11-30Fix return values bug in BN_ucmp().jsing1-4/+6
BN_ucmp() is supposed to return -1/0/1 on a < b, a == b and a > b, however it currently returns other negative and positive values when the top of a and b differ. Correct this. ok tb@
2022-11-30Add regress coverage for BN_cmp()/BN_ucmp().jsing2-3/+347
Some tests current fail due to a bug in BN_ucmp(), which will be fixed soon.
2022-11-30Mostly align BIO_read()/BIO_write() return values with OpenSSL 3.x.jsing1-7/+21
For various historical reasons, there are a number of cases where our BIO_read() and BIO_write() return slightly different values to what OpenSSL 3.x does (of course OpenSSL 1.0 differs from OpenSSL 1.1 which differs from OpenSSL 3.x). Mostly align these - some further work will be needed. Issue raised by tb@ who also wrote some test code.
2022-11-30Mop up more BN_DEBUG related code.jsing7-48/+7
2022-11-29Add missing markup to comments and to RFC 3779 errortb1-10/+12
2022-11-29First pass at updating verifier error docstb1-13/+41
X509_verify_cert_error_string() is now thread safe as it no longer returns a static buffer. Document X509_V_ERR_UNSPECIFIED. Stop asserting that the X509_V_ERR_CERT_CHAIN_TOO_LONG code is unused, the new verifier can set it. Add commented versions of various missing error codes in the proper spots and move X509_V_ERR_UNNESTED_RESOURCE where it belongs. prompted by claudio
2022-11-29Remove a few doubled spaces and wrap an overlong linetb1-8/+9
2022-11-29Sort a few outliers by increasing error number to match x509_vfy.htb1-13/+13
2022-11-29Fix includestb1-11/+2
No need for errno, stdio, time, asn1, buffer, evp, lhash, objects, x509 for a switch containing string constants. We do need x509_vfy instead.
2022-11-29Add missing X509_V_ERR_UNSPECIFIED casetb1-1/+3
2022-11-29Fix some KNF issuestb1-65/+64
Requested by claudio
2022-11-29Make X509_verify_cert_error_string() thread safetb1-5/+2
Stop returning a pointer to a static buffer containing the error code on unknown error. While this might be helpful, it's not going to end well. ok beck claudio jsing
2022-11-28Garbage collect the unused asn1_add_error()tb1-7/+1
ok jsing
2022-11-28Retire prev_biotb2-12/+2
While BIO chains are doubly linked lists, nothing has ever made use of this fact internally. Even libssl has failed to maintain prev_bio properly in two places for a long time. When BIO was made opaque, the opportunity to fix that was missed. Instead, BIO_set_next() now allows breaking the lists from outside the library, which freerdp has long done. Problem found by schwarze while trying to document BIO_set_next(). schwarze likes the idea ok jsing
2022-11-28Tweak x509_constraints_uri_host() regress to test for NULL deref intb1-1/+3
fixed in x509_constraints.c r1.29.
2022-11-28Fix NULL dereference in x509_constraints_uri_host()tb1-2/+3
When called from v2i, hostpart in x509_constraints_uri_host() is NULL, so add a NULL check before storing the strdup result in it. From Anton Borowka ok jsing miod
2022-11-27In bio.h rev. 1.50 and rev. 1.51, tb@ provided BIO_set_retry_reason(3).schwarze1-4/+20
Merge the documentation from the OpenSSL 1.1.1 branch, which is still under a free license, tweaked by me.
2022-11-26Make header guards of internal headers consistenttb16-56/+55
Not all of them, only those that didn't leak into a public header... Yes.
2022-11-26bn_lcl.h wanted special treatment.tb1-567/+0
2022-11-26Make internal header file names consistenttb445-970/+1536
Libcrypto currently has a mess of *_lcl.h, *_locl.h, and *_local.h names used for internal headers. Move all these headers we inherited from OpenSSL to *_local.h, reserving the name *_internal.h for our own code. Similarly, move dtls_locl.h and ssl_locl.h to dtls_local and ssl_local.h. constant_time_locl.h is moved to constant_time.h since it's special. Adjust all .c files in libcrypto, libssl and regress. The diff is mechanical with the exception of tls13_quic.c, where #include <ssl_locl.h> was fixed manually. discussed with jsing, no objection bcook