summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* 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
|
* Unhook the old md4 and md5 teststb2022-09-021-3/+1
|
* Link new md test to regress.tb2022-09-021-1/+2
|
* New md4/md5 regress teststb2022-09-022-0/+310
| | | | | | These exercise MD4 and MD5 with the test vectors from RFCs 1320 and 1321. From Joshua Sing <joshua () hypera ! dev>
* Add two consttb2022-09-021-3/+3
|
* Make test tables static const and fix a style nittb2022-09-021-5/+4
|
* Simplify and clean up the ecdsa test a little. Use stdio instead of BIOtb2022-09-021-195/+177
| | | | for output, use 'err' as a label and avoid some silly repetitions.
* Retire old SHA teststb2022-09-026-609/+0
| | | | | | The old tests were incomplete, some of them had no license and the code quality was questionable. The new tests by Joshua Sing cover what they did (and additionally SHA-224 and SHA-384). Many thanks!
* Unhook old SHA teststb2022-09-021-4/+1
|
* Add tests for 1 million repeated "a"tb2022-09-021-39/+220
| | | | From Joshua Sing
* Check sk_SSL_CIPHER_push() return valuetb2022-09-011-4/+11
| | | | | | CID 24797 ok jsing
* Link sha test to regresstb2022-09-011-1/+2
|
* Add a nicely licensed, table-driven test for SHAtb2022-09-012-0/+448
| | | | | | | This tests covers the NIST vectors for SHA-{1,224,256,384,256} and will soon be able to replace the old SHA tests entirely. From Joshua Sing <joshua () hypera ! dev>
* Add an empty line for consistency.tb2022-08-311-1/+2
|
* Recommit -r1.45 but without error checking EVP_PKEY_copy_parameters()tb2022-08-311-4/+12
| | | | | | | | EVP_PKEY_copy_parameters() will unconditionally fail if the pkey's ameth has no copy_params(). Obviously this is indistinguishable from actual failure... ok jsing
* Revert r1.46. Causes fireworks in regress.tb2022-08-311-9/+5
|
* Remove most mentions of contexts on the stack.tb2022-08-312-23/+4
|
* nasty whitespacetb2022-08-311-9/+9
|
* Rework DSA_size() and ECDSA_size()tb2022-08-312-43/+32
| | | | | | | | | | | | | | | | | | | DSA_size() and ECDSA_size() have a very special hack. They fudge up an ASN1_INTEGER with a size which is typically > 100 bytes, backed by a buffer of size 4. This was "fine", however, since they set buf[0] = 0xff, where the craziness that was i2c_ASN1_INTEGER() only looks at the first octet (one may then ask why a buffer of size 4 was necessary...). This changed with the rewrite of i2c_ASN1_INTEGER(), which doesn't respect this particular hack and rightly assumes that it is fed an actual ASN1_INTEGER... Instead, create an appropriate signature and use i2d to determine its size. Fixes an out-of-bounds read flagged by ASAN and oss-fuzz. ok jsing
* Avoid division by zero if no connection was made.tb2022-08-311-4/+2
| | | | CID 184043
* Some missing return checkstb2022-08-311-3/+5
|
* Avoid some buffer overflows in ecdsatesttb2022-08-311-2/+15
| | | | | | The ASN.1 encoding of the modified ECDSA signature can grow in size due to padding of the ASN.1 integers. Instead of reusing the same signature buffer freshly allocate it. Avoids some buffer overflows caught by ASAN.
* Revert previous. Committed the wrong version of the diff.tb2022-08-311-14/+4
|
* Avoid some buffer overflows in ecdsatesttb2022-08-311-4/+14
| | | | | | The ASN.1 encoding of the modified ECDSA signature can grow in size due to padding of the ASN.1 integers. Instead of reusing the same signature buffer freshly allocate it. Avoids some buffer overflows caught by ASAN.
* Switch loop bounds from size_t to int in check_hosts()tb2022-08-311-2/+2
| | | | | | | | | sk_num() can return a negative value, in which case the upper bound is SIZE_MAX, which results in a very long for loop. CID 153997 ok jsing
* Check return values in ssl_print_tmp_key()tb2022-08-311-4/+9
| | | | | | | | | | Use EVP_PKEY_get0_EC_KEY() instead of the get1 version to avoid an EVP_PKEY_free(). Check return values: if either EVP_PKEY_get0_EC_KEY() or EC_KEY_get0_group() fail, a NULL dereference occurs. CID 43289 ok jsing