summaryrefslogtreecommitdiff
path: root/src/lib/libc/stdlib/random.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2024-03-28Use C functions for RC4 public API.jsing5-21/+52
Rather than having public API switch between C and assembly, always use C functions as entry points, which then call an assembly implementation (if available). This makes it significantly easier to deal with symbol aliasing/namespaces and it also means we benefit from vulnerability prevention provided by the C compiler. Rename the assembly generated functions from RC4() to rc4_internal() and RC4_set_key() to rc4_set_key_internal(). Always include rc4.c and change it to use defines that are similar to those used in BN. ok beck@ joshua@ tb@
2024-03-28Fix coverity complaints.beck1-4/+6
2024-03-28Check the return value of EVP_CIPHER_CTX_reset()tb1-3/+5
The function call can't actually fail, but all other calls check its return value. ok joshua jsing
2024-03-28Move des sources to primary Makefile.jsing12-35/+13
Now that all platforms use a C des implementation, move it to the primary Makefile.
2024-03-28Remove now unused des assembly.jsing3-2630/+0
2024-03-28Stop building the assembly implementation of des on sparc64.jsing1-6/+2
This one was hiding behind an m4 script. Build tested by tb@
2024-03-28Remove now unused ripemd i386 assembly.jsing1-591/+0
2024-03-28Stop building the assembly implementation of des and ripemd on i386.jsing1-6/+2
This is the only architecture that has an assembly implementation for these algorithms. There is little to gain from accelerating legacy algorithms on a legacy architecture. Discussed with beck@ and tb@
2024-03-28Consolidate most of the AES modes into a single C file.jsing6-293/+70
Discussed with tb@
2024-03-28PKCS#1.5 PBE: test and assigntb1-3/+2
2024-03-28Stop pandering to the loadbalancer industrial complex.beck1-17/+3
So we initially kept this hack around for f5 boxes that should have been patched in 2014, and were not as of 2017. The f5 article for the bug archived on their web site, and any of these devices on the public internet will have since been upgraded to deal with a host of record layer, TLS, and other bugs, or they likely won't be talking to modern stacks, since as of this point the software with the bug would not have been updated in 10 years. So just make this spec compliant and reject a supported groups extension that should not have been sent by a server. ok tb@ jsing@
2024-03-27fix leaks in the horrible ssl whackery necessary for this test.beck1-4/+5
ok tb@
2024-03-27Fix up server processing of key shares.beck2-13/+173
Ensure that the client can not provide a duplicate key share for any group, or send more key shares than groups they support. Ensure that the key shares must be provided in the same order as the client preference order specified in supported_groups. Ensure we only will choose to use a key share that is for the most preferred group by the client that we also support, to avoid the client being downgraded by sending a less preferred key share. If we do not end up with a key share for the most preferred mutually supported group, will then do a hello retry request selecting that group. Add regress for this to regress/tlsext/tlsexttest.c ok jsing@
2024-03-27Remove unused rc4 parisc assembly.jsing2-299/+1
This is already disabled since it is "about 35% slower than C code".
2024-03-27Catch the blowfish that escaped.jsing1-2/+2
2024-03-27Consolidate rc4 code.jsing12-119/+50
Discussed with tb@
2024-03-27Remove assembly for stitched modes.jsing3-1756/+1
The stitched modes have been removed, so having assembly for them is of little use.
2024-03-27Remove empty rc4_local.h include.jsing3-10/+2
Discussed with tb@
2024-03-27Remove private_RC4_set_key() from the public rc4.h header.jsing1-2/+1
This does not exist in libcrypto.
2024-03-27Unifdef BF_PTR2.jsing2-95/+4
This removes the unused Intel special version of BF_ENC(). ok tb@
2024-03-27Remove unused c2l/c2ln/l2c/l2cn macros.jsing1-47/+3
2024-03-27Consolidate blowfish code.jsing6-639/+381
Requested by tb@
2024-03-27Replace GETU32 and PUTU32.jsing2-29/+26
Replace GETU32 with crypto_load_be32toh() and PUTU32 with crypto_store_htobe32(). Make the offset handling cleaner at the same time. ok beck@ joshua@ tb@
2024-03-27Remove now unused files.jsing2-274/+0
2024-03-27Move bf_enc.c to the primary Makefile.jsing12-34/+12
Now that all architectures are using bf_enc.c, it does not make sense to have it in every Makefile.inc file.
2024-03-27Stop building the assembly implementation of blowfish on i386.jsing1-3/+2
This is the only architecture that has an assembly implementation. There is little to gain from accelerating a legacy algorithm on a legacy architecture. ok beck@ tb@
2024-03-27Do not allow duplicate groups in supported groups.beck1-18/+39
While we are here refactor this to single return. ok jsing@ tb@
2024-03-27Remove near duplicate AES_set_{encrypt,decrypt}_key() functions.jsing1-208/+2
There are currently three ways in which AES is implemented - all in assembly (amd64 et al), all in C (aarch64 et al) and, half in C and half in assembly (hppa and sparc64). The last of these cases currently makes use of a near duplicate AES_set_{encrypt,decrypt}_key() implementation that avoids using the AES tables. Remove the near duplicate version and if only a half assembly version is implemented, use the same C version of AES_set_{encrypt,decrypt}_key() as everyone else. This adds around 8KB of rodata to libcrypto on these two platforms. Discussed with beck and tb.
2024-03-27Explain the weird copy dance in EVP_DigestSignFinal()tb1-2/+3
with jsing
2024-03-27Add TLS_ERROR_INVALID_ARGUMENT error code to libtlsjoshua3-12/+15
This is an initial pass, defining the error code and using it for "too long"/length-related errors. ok beck jsing
2024-03-27Fix whitespacetb1-2/+2
2024-03-27Use crypto_rol_u32() instead of an undefined ROTATE macro.jsing1-9/+5
ok tb@
2024-03-27Unify up_ref implementations in libssltb2-8/+5
ok jsing
2024-03-27Remove unused NDEBUG define.jsing1-7/+1
2024-03-27Tidy includes and a comment.jsing1-3/+7
2024-03-27Remove rather scary unused experimental code.jsing1-1081/+0
ok tb@
2024-03-27Clean up use of EVP_MD_CTX_{legacy_clear,cleanup} injoshua1-18/+24
EVP_DigestSignFinal Additionally, this cleans up some more surrounding code. This is a fixed version of r1.21. ok tb
2024-03-27Demacro md4.jsing1-100/+84
Use static inline functions instead of macros. Also number rounds as per the RFC. ok joshua@ tb@
2024-03-27Hide symbols in enginetb3-1/+87
ok jsing
2024-03-27Recommit r1.20joshua1-27/+31
ok tb jsing
2024-03-27Revert to r1.19 while we track down a bug in the last two commits.jsing1-38/+29
2024-03-27Clean up use of EVP_MD_CTX_{legacy_clear,cleanup} injoshua1-17/+22
EVP_DigestSignFinal Additionally, this cleans up some more surrounding code. ok tB
2024-03-27Use dsa for DSA and dh for DHtb1-88/+90
This unifies variable names and does some other cleanup. Only change in generated assembly is line number changes.
2024-03-27Use dh for DH function arguments.tb1-25/+23
No need for a variety of r, d, ...
2024-03-27Unify *_up_ref() implementationstb6-19/+12
No need for an inconsistently named local variable and a ternary operator. ok jsing
2024-03-26Remove superfluous parentheses in X509_REQ setterstb1-10/+10
No change in generated assembly
2024-03-26Cosmetics, mostly removal of silly parenthesestb1-21/+19
No change in generated assembly
2024-03-26Drop superfluous parentheses in X509_set_version()tb1-5/+5
2024-03-26Tweak versions comment for CRLstb1-1/+2
2024-03-26piuid and psuid have annoyed me for long enoughtb1-7/+7