summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* Use CBS to parse TLS alerts in the legacy stack.jsing2022-09-101-4/+10
| | | | ok tb@
* Provide a version of ssl_msg_callback() that takes a CBS.jsing2022-09-103-8/+17
| | | | | | Use this from the TLSv1.3 code. ok tb@
* carrier return character -> carriage return characterjsg2022-09-101-2/+2
| | | | ok jmc@ miod@
* fix repeated wordsjsg2022-09-105-15/+15
| | | | ok ok miod@ ack ack jmc@
* fix repeated wordsjsg2022-09-101-3/+3
| | | | ok miod@ jmc@
* ssl_cipher_process_rulestr: return early if a cipher command is invalidmillert2022-09-081-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@
* ssl_cipher_process_rulestr: don't read outside rule_str buffermillert2022-09-071-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@
* Add EVP test coverage for RC2.tb2022-09-071-1/+194
| | | | From Joshua Sing
* Add output length validation for EVPtb2022-09-071-6/+24
| | | | From Joshua Sing
* Add a table-driven test for RC2 in ECB mode to replace the old one.tb2022-09-063-140/+296
| | | | From Joshua Sing
* Remove more mkerr.pl remnants, missed in previouskn2022-09-061-54/+3
| | | | | Noticed by jsg Feedback OK jsg
* Replace aes_{ccm,xts}_cleanup usage with NULL.jsing2022-09-061-16/+11
| | | | Only change in generated assembly is due to line numbers.
* Stop casting a size_t to a long and then passing it as a size_t.jsing2022-09-063-31/+31
| | | | | | | | | These cipher implementations take a size_t length argument, so stop casting it to a long. Found by Coverity. ok tb@
* Fix copy-paste errortb2022-09-051-2/+2
|
* Plug leaks due to not resetting the EVP_CIPHER_CTXtb2022-09-051-1/+11
|
* Two more missing long long caststb2022-09-051-3/+3
|
* More long long casts for printing time_ttb2022-09-051-3/+3
|
* Convert from %i to %dtb2022-09-0512-84/+84
|
* cast time_t to long long before printing for portabilitytb2022-09-051-2/+2
|
* Remove dead code.jsing2022-09-042-36/+12
| | | | No change in generated assembly.
* Add bounds checks for various EVP cipher implementations.jsing2022-09-046-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@
* Remove dead code.jsing2022-09-045-25/+10
| | | | Only change to generated assembly is due to line numbers.
* Expand the looney M_do_cipher macro.jsing2022-09-041-11/+9
| | | | Only change in generated assembly is due to line numbers.
* Rearrange some functions.jsing2022-09-048-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.
* Remove now unused EVP_C_DATA macro.jsing2022-09-041-3/+1
|
* Remove now unused BLOCK_CIPHER_* macros.jsing2022-09-041-186/+1
|
* Expand BLOCK_CIPHER_* macros.jsing2022-09-041-15/+108
| | | | No change in generated assembly.
* Mechanically expand BLOCK_CIPHER_* macros.jsing2022-09-042-32/+387
| | | | No change in generated assembly.
* Mechanically expand BLOCK_CIPHER_* ciphers.jsing2022-09-041-17/+145
| | | | | | This includes the wonderful BLOCK_CIPHER_ecb_loop - a for loop in a macro. No change in generated assembly.
* Remove now unused IMPLEMENT_CFBR macro.jsing2022-09-041-10/+1
|
* Make ssl_create_cipher_list() have a single exittb2022-09-041-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
* Mechanically expand IMPLEMENT_CFBR macros.jsing2022-09-041-8/+267
| | | | Only change to generated assembly is due to the use of EVPerror().
* Remove now unused IMPLEMENT_BLOCK_CIPHER macro.jsing2022-09-034-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).
* Mechanically expand IMPLEMENT_BLOCK_CIPHER macro.jsing2022-09-031-21/+486
| | | | | Only change to generated assembly is due to EVPerror()'s use of line numbers.
* Mechanically expand IMPLEMENT_BLOCK_CIPHER macro.jsing2022-09-031-4/+162
| | | | No change in generated assembly.
* Mechanically expand IMPLEMENT_BLOCK_CIPHER macro.jsing2022-09-031-8/+161
| | | | | | Only change to generated assembly is due to EVPerror()'s use of line numbers. CVS ----------------------------------------------------------------------
* Mechanically expand IMPLEMENT_BLOCK_CIPHER macro.jsing2022-09-031-6/+162
| | | | No change to generated assembly.
* Mechanically expand IMPLEMENT_BLOCK_CIPHER macro.jsing2022-09-031-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@
* Rewrap some lines, no functional change.jsing2022-09-031-4/+6
|
* Tidy up asn1_c2i_primitive() slightly.jsing2022-09-031-8/+8
| | | | | | Rename some variables and consistently goto error. ok tb@
* Avoid recycling ASN1_STRINGs when decoding ASN.1.jsing2022-09-031-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@
* Remove duplicate prototype that just snuck in.jsing2022-09-031-3/+1
|
* Ensure a constructed ASN.1 INTEGER is considered invalid when decoding.jsing2022-09-031-1/+15
|
* Ensure ASN.1 types are appropriately encoded.jsing2022-09-033-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@
* Provide c2i_ASN1_ENUMERATED_cbs() and call it from asn1_c2i_primitive().jsing2022-09-033-9/+33
| | | | | | | This avoids asn1_c2i_primitive() from needing knowledge about the internals of ASN1_INTEGER and ASN1_ENUMERATED. ok tb@
* Prepare to provide OPENSSL_cleanup.jsing2022-09-033-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@
* New test coverage for RC4tb2022-09-033-227/+453
| | | | From Joshua Sing
* Stop using CBIGNUM_it internal to libcrypto.jsing2022-09-033-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@
* Rewrite RMD-160 tests to be table-driven.tb2022-09-023-130/+203
| | | | From Joshua Sing
* Retire the old crap. Thanks, Joshuatb2022-09-024-269/+0
|