summaryrefslogtreecommitdiff
path: root/src/lib/libc/stdlib/recallocarray.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2022-09-10Use correct length for EVP CFB mode ciphers.jsing7-22/+22
The BLOCK_CIPHER_* macros contained a bug where the total length is passed to the underlying cipher implementation, rather than the length of the current chunk. Correct this and use the chunk length instead. Should address the remaining issues reported by Coverity. ok tb@
2022-09-10Use CBS to parse TLS alerts in the legacy stack.jsing1-4/+10
ok tb@
2022-09-10Provide a version of ssl_msg_callback() that takes a CBS.jsing3-8/+17
Use this from the TLSv1.3 code. ok tb@
2022-09-10carrier return character -> carriage return characterjsg1-2/+2
ok jmc@ miod@
2022-09-10fix repeated wordsjsg5-15/+15
ok ok miod@ ack ack jmc@
2022-09-10fix repeated wordsjsg1-3/+3
ok miod@ jmc@
2022-09-08ssl_cipher_process_rulestr: return early if a cipher command is invalidmillert1-5/+2
This is a safer fix for the bug where we might read outside rule_str buffer and is how BoringSSL fixed it. OK tb@
2022-09-07ssl_cipher_process_rulestr: don't read outside rule_str buffermillert1-2/+3
If rule_str ended in a "-", "l" was incremented one byte past the end of the buffer. This resulted in an out-of-bounds read when "l" is dereferenced at the end of the loop. OK tb@
2022-09-07Add EVP test coverage for RC2.tb1-1/+194
From Joshua Sing
2022-09-07Add output length validation for EVPtb1-6/+24
From Joshua Sing
2022-09-06Add a table-driven test for RC2 in ECB mode to replace the old one.tb3-140/+296
From Joshua Sing
2022-09-06Remove more mkerr.pl remnants, missed in previouskn1-54/+3
Noticed by jsg Feedback OK jsg
2022-09-06Replace aes_{ccm,xts}_cleanup usage with NULL.jsing1-16/+11
Only change in generated assembly is due to line numbers.
2022-09-06Stop casting a size_t to a long and then passing it as a size_t.jsing3-31/+31
These cipher implementations take a size_t length argument, so stop casting it to a long. Found by Coverity. ok tb@
2022-09-05Fix copy-paste errortb1-2/+2
2022-09-05Plug leaks due to not resetting the EVP_CIPHER_CTXtb1-1/+11
2022-09-05Two more missing long long caststb1-3/+3
2022-09-05More long long casts for printing time_ttb1-3/+3
2022-09-05Convert from %i to %dtb12-84/+84
2022-09-05cast time_t to long long before printing for portabilitytb1-2/+2
2022-09-04Remove dead code.jsing2-36/+12
No change in generated assembly.
2022-09-04Add bounds checks for various EVP cipher implementations.jsing6-7/+98
The EVP cipher API uses size_t, however a number of the underlying implementations use long in their API. This means that an input with size > LONG_MAX will go negative. Found by Coverity, hiding under a large pile of macros. ok tb@
2022-09-04Remove dead code.jsing5-25/+10
Only change to generated assembly is due to line numbers.
2022-09-04Expand the looney M_do_cipher macro.jsing1-11/+9
Only change in generated assembly is due to line numbers.
2022-09-04Rearrange some functions.jsing8-177/+141
Pull the init_key and ctrl (if present) functions up to the top. This improves readability and allows for the removal of function prototypes. No functional change.
2022-09-04Remove now unused EVP_C_DATA macro.jsing1-3/+1
2022-09-04Remove now unused BLOCK_CIPHER_* macros.jsing1-186/+1
2022-09-04Expand BLOCK_CIPHER_* macros.jsing1-15/+108
No change in generated assembly.
2022-09-04Mechanically expand BLOCK_CIPHER_* macros.jsing2-32/+387
No change in generated assembly.
2022-09-04Mechanically expand BLOCK_CIPHER_* ciphers.jsing1-17/+145
This includes the wonderful BLOCK_CIPHER_ecb_loop - a for loop in a macro. No change in generated assembly.
2022-09-04Remove now unused IMPLEMENT_CFBR macro.jsing1-10/+1
2022-09-04Make ssl_create_cipher_list() have a single exittb1-23/+23
This simplifies memory management and makes it easier to see the leak that were introduced in the previous commit. Sprinkle a few malloc errors for consistency. CID 278396 with/ok jsing
2022-09-04Mechanically expand IMPLEMENT_CFBR macros.jsing1-8/+267
Only change to generated assembly is due to the use of EVPerror().
2022-09-03Remove now unused IMPLEMENT_BLOCK_CIPHER macro.jsing4-19/+4
Also remove various comments noting that it cannot be used for certain block ciphers (which kinda defeats the purpose of having a generic implementation in the first place).
2022-09-03Mechanically expand IMPLEMENT_BLOCK_CIPHER macro.jsing1-21/+486
Only change to generated assembly is due to EVPerror()'s use of line numbers.
2022-09-03Mechanically expand IMPLEMENT_BLOCK_CIPHER macro.jsing1-4/+162
No change in generated assembly.
2022-09-03Mechanically expand IMPLEMENT_BLOCK_CIPHER macro.jsing1-8/+161
Only change to generated assembly is due to EVPerror()'s use of line numbers. CVS ----------------------------------------------------------------------
2022-09-03Mechanically expand IMPLEMENT_BLOCK_CIPHER macro.jsing1-6/+162
No change to generated assembly.
2022-09-03Mechanically expand IMPLEMENT_BLOCK_CIPHER macro.jsing1-5/+163
These macros make the ASN.1 macros seem sane - there are layers and layers and layers here, which are hiding bugs. No change to generated assembly. Discussed with tb@
2022-09-03Rewrap some lines, no functional change.jsing1-4/+6
2022-09-03Tidy up asn1_c2i_primitive() slightly.jsing1-8/+8
Rename some variables and consistently goto error. ok tb@
2022-09-03Avoid recycling ASN1_STRINGs when decoding ASN.1.jsing1-14/+12
Rather than recycling an existing ASN1_STRING and changing its type, free it and allocate a replacement. This simplifies the code and potentially avoids bugs resulting from reuse. ok tb@
2022-09-03Remove duplicate prototype that just snuck in.jsing1-3/+1
2022-09-03Ensure a constructed ASN.1 INTEGER is considered invalid when decoding.jsing1-1/+15
2022-09-03Ensure ASN.1 types are appropriately encoded.jsing3-7/+52
Per X.690, some ASN.1 types must be primitive encoded, some must be constructed and some may be either. Add this data to our types table and check the encoding against this information when decoding. ok tb@
2022-09-03Provide c2i_ASN1_ENUMERATED_cbs() and call it from asn1_c2i_primitive().jsing3-9/+33
This avoids asn1_c2i_primitive() from needing knowledge about the internals of ASN1_INTEGER and ASN1_ENUMERATED. ok tb@
2022-09-03Prepare to provide OPENSSL_cleanup.jsing3-6/+30
OPENSSL_cleanup() cleans up and deallocates memory in use by the library. There are a couple of use cases for this, primarily related to memory leak testing. This will not be called automatically in LibreSSL, which means that OpenSSL's OPENSSL_NO_INIT_ATEXIT is implied. If code wants to clean up then they need to explicitly call this themselves. ok tb@
2022-09-03New test coverage for RC4tb3-227/+453
From Joshua Sing
2022-09-03Stop using CBIGNUM_it internal to libcrypto.jsing3-8/+11
CBIGNUM_it is supposed to be the "clear bignum" or "secure" bignum - that is one which zeros its memory after use and ensures that the constant time flags are set... in LibreSSL we always do both of these things for BIGNUMs, so just use BIGNUM_it instead. ok tb@
2022-09-02Rewrite RMD-160 tests to be table-driven.tb3-130/+203
From Joshua Sing