summaryrefslogtreecommitdiff
path: root/src/lib/libc/stdlib/recallocarray.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2023-03-27Drop unnecessary parentheses.tb1-3/+3
ok jsing
2023-03-27Convert bn_nist.c to BN_copy()tb1-6/+6
Like everything else in this file, the use of BN_copy() needs to be ... special. Simplify using the new bn_copy(). ok jsing
2023-03-27Add bn_copy(), a sane wrapper of BN_copy() for internal usetb2-2/+10
ok jsing
2023-03-26Remove the now almost empty and unused bn_mod_exp2_mont.ctb1-22/+0
2023-03-26Unhook bn_mod_exp2_mont testtb1-2/+1
2023-03-26Fold the small BN_mod_exp2_mont() crash test into bn_mod_exp.ctb2-23/+27
2023-03-26Test negative modulus as well.tb1-5/+7
Lower the number of rounds. These tests are expensive.
2023-03-26Align bn_mod_exp_zero_test() with bn_mod_exp_test()tb1-11/+11
2023-03-26Fix copy-paste errortb1-2/+2
2023-03-26Replace HASH_BLOCK_DATA_ORDER with sha1_block_data_order.jsing1-4/+4
The only reason to use HASH_BLOCK_DATA_ORDER in the implementation is to make the code harder to read.
2023-03-26Remove unnecessary HIDDEN_DECLS.jsing1-6/+1
2023-03-26Removes some unwanted spaces.jsing1-7/+7
2023-03-26Whack sha1dgst.c with the style(9) stick again.jsing1-193/+246
2023-03-26Add regress coverage for some BIO_f_asn1() bugs fixed before releasetb2-1/+176
2023-03-26Minor whitespace tidyingtb2-6/+7
2023-03-26Tidy up includes.jsing1-9/+5
2023-03-26Inline sha_local.h in sha1dgst.c.jsing1-3/+360
Nothing other than sha1dst.c uses this header - pull it in to sha1dgst.c directly (sha_local.h will be removed at a later date).
2023-03-26Fix a typo in dump_exp_results()tb1-2/+2
2023-03-26Add more extensive regress coverage for BN_mod_exp2_mont()tb1-1/+191
2023-03-26Rename dump_results() into dump_exp_results()tb1-4/+4
This prepares for consistency with an upcoming diff. While here fix an argument order bug.
2023-03-26Move the N_MOD_EXP_TESTS up to where it belongstb1-3/+3
2023-03-26Make several calls to BN_nnmod() unconditionaltb1-19/+10
This removes a potential branch in a sensitive function and makes the code a lot simpler. It is a really bad idea optimize here for what davidben aptly calls "calculator" purposes. ok jsing
2023-03-26Correctly reduce negative inpot to BN_mod_exp2_mont()tb1-3/+3
Negative bases could result in a negative modulus being returned. This is not strictly speaking incorrect but slightly surprising. This is all a consequence of the shortcut of defining BN_mod() as a macro using BN_div(). Fixes ossfuzz #55997 ok jsing
2023-03-26Add regress coverage for an issue with BN_mod_exp2_mont() reportedtb1-1/+23
by Guido Vranken in ossfuzz #55997. This test currently fails and will be fixed momentarily. This also checks sensible behavior with respect to zero exponents for this functions.
2023-03-26bn_primes: there is no need to link this statically. It can pull thetb1-2/+5
primes table in directly.
2023-03-26Add license to sha256.c/sha512.c.jsing2-6/+100
2023-03-26Use multiple statements instead of comma separated expressions.jsing1-24/+33
No change to generated assembly.
2023-03-26Add blank lines for readability.jsing1-1/+4
2023-03-26Add some blank lines for readability, along with some more style(9) tweaks.jsing2-7/+24
2023-03-26Whack sha with a style(9) stick.jsing4-505/+706
No change in generated assembly.
2023-03-26bn_mod_exp_ret() fix stupid logic errortb1-4/+5
2023-03-26bn_prime.pl: fix shebang and a couple more whitespace tweakstb1-3/+4
2023-03-25Last arg is also a pointer, so pass NULL instead of 0; ok deraadt@otto1-2/+2
2023-03-25Change malloc chunk sizes to be fine grained.otto1-102/+142
The basic idea is simple: one of the reasons the recent sshd bug is potentially exploitable is that a (erroneously) freed malloc chunk gets re-used in a different role. malloc has power of two chunk sizes and so one page of chunks holds many different types of allocations. Userland malloc has no knowledge of types, we only know about sizes. So I changed that to use finer-grained chunk sizes. This has some performance impact as we need to allocate chunk pages in more cases. Gain it back by allocation chunk_info pages in a bundle, and use less buckets is !malloc option S. The chunk sizes used are 16, 32, 48, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, 384, 448, 512, 640, 768, 896, 1024, 1280, 1536, 1792, 2048 (and a few more for sparc64 with its 8k sized pages and loongson with its 16k pages). If malloc option S (or rather cache size 0) is used we use strict multiple of 16 sized chunks, to get as many buckets as possible. ssh(d) enabled malloc option S, in general security sensitive programs should. See the find_bucket() and bin_of() functions. Thanks to Tony Finch for pointing me to code to compute nice bucket sizes. ok tb@
2023-03-25Use strict and warningstb1-1/+6
2023-03-25Make an attempt at reducing the eyebleed in bn_prime.pltb1-24/+18
Use a style more resembling KNF and drop lots of parentheses. Simplify a few things. No change in generated output on success.
2023-03-25Use Eric Young's usual license in the proper place rather than a weirdtb1-12/+57
commented-out license stub in a HERE document.
2023-03-25Add RCSIDtb1-1/+1
2023-03-25Add checks to ensure the uint16_t array isn't overflowed when thistb1-0/+4
script is run. This is more of an issue with uint16_t now than it was with prime_t aka BN_ULONG before r1.6.
2023-03-25Zap an empty linetb1-2/+1
2023-03-25Drop unnecessary casts from and to void *tb1-8/+6
2023-03-25Unindent asn1_bio_get_ex()tb1-6/+7
2023-03-25Guard GF2m-specifics with OPENSSL_NO_EC2Mtb1-2/+7
2023-03-25Enable FRP256v2 teststb1-6/+2
This was previously disabled because tb apparently can't grep. Exercise this curve as well as part of the new test cases in ECDH wycheproof.
2023-03-25Remove dead/unreachable codetb1-7/+1
A copy-paste error would have resulted in a modified msg in case ctLen == 0 or msgLen == 0. So obviously this is unreachable code.
2023-03-25Pull in <openssl/rsa.h> directlytb1-1/+2
This is needed for many reasons. It is currently pulled in via x509.h but only when OPENSSL_NO_DEPRECATED is undefined. Again this should be fixed in the public header as well.
2023-03-25BN_free() is defined in <openssl/bn.h>tb2-4/+7
This is currently pulled in via dsa.h and ecdsa.h, but only when OPENSSL_NO_DEPRECATED is not defined. We should fix this in the public header, too - let's wait a bit with that.
2023-03-18KNF: some missing spaces after commatb1-5/+5
2023-03-18Rename bn_mod_exp_zero to the more appropriate bn_mod_exptb2-4/+4
2023-03-18Retire the bn_mod_exp test.tb2-222/+1
Its is fully covered by bn_mod_exp_zero now.