summaryrefslogtreecommitdiffstats
path: root/test/evp_test.c
AgeCommit message (Collapse)Author
2017-06-05Use common STANZA for bn and exp testsRich Salz
Standardize file:line messages Reduce buff size; move to end of STANZA Add some Title entries (with blank line after) Add Title to some BN test files. Reviewed-by: Andy Polyakov <appro@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3608)
2017-05-26test/evp_test.c: improve output in case of errors.Andy Polyakov
Recently introduced TEST_* macros print variables' symbolic names. In order to make error output more readable rename some variables. Reviewed-by: Rich Salz <rsalz@openssl.org>
2017-05-23Revise evp_test parser; make like bn_testRich Salz
Re-order and comment on the functions Reviewed-by: Andy Polyakov <appro@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3506)
2017-05-20move comments to same line as fieldsDr. Stephen Henson
Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3500)
2017-05-20Add test support for "oneshot" versions EVP_DigestSign, EVP_DigestVerify.Dr. Stephen Henson
Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3500)
2017-05-20Add tests in evp_test for EVP_Digest{Sign,Verify}{Init,Update,Final}Dr. Stephen Henson
Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3500)
2017-05-19Add support for multiple update calls in evp_testDr. Stephen Henson
Allow multiple "Input" lines to call the update function multiple times. Add "Ncopy" keyword to copy the input buffer. So for example: Input = "a" Ncopy = 1024 Will create a buffer consisting of 1024 "a" characters. Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3451)
2017-05-12Add "Title" directive to evp_testRich Salz
Reviewed-by: Stephen Henson <steve@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3454)
2017-05-11evp_test: use the test file name as the test titleRichard Levitte
Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3445)
2017-05-11Use compare_mem wrapperRich Salz
Add file/line# to test error message. Also remove expected/got fields since TEST structure prints them. Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3324)
2017-05-11Address some feedbackRich Salz
Report test detail error. Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3324)
2017-05-11Convert of evp_test to frameworkRich Salz
Also, allow multiple files on commandline (for future splitup of evptests.txt) Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3324)
2017-04-25evp_test.c: Add PrivPubKeyPair testsRich Salz
Reviewed-by: Stephen Henson <steve@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3245)
2017-04-16Catch EC_R_UNKNOWN_GROUP in check_unsupported()Rich Salz
If EC support is enabled we should catch also EC_R_UNKNOWN_GROUP as an hint to an unsupported algorithm/curve (e.g. if binary EC support is disabled). Before this commit the issue arise for example if binary EC keys are added in evptests.txt, and the test is run when EC is enabled but EC2m is disabled. E.g. adding these lines to evptests.txt would reproduce the issue: ~~~ PrivateKey=KAS-ECC-CDH_K-163_C0 -----BEGIN PRIVATE KEY----- MGMCAQAwEAYHKoZIzj0CAQYFK4EEAAEETDBKAgEBBBUAZlO2B3OY+tx79eYBWBcB SMPcRSehLgMsAAQHH4sod9YCfZwa3kJE8t6hJpLvI9UFwV7ndiIccrhLNHzjg/OA Z7icPpo= -----END PRIVATE KEY----- PublicKey=KAS-ECC-CDH_K-163_C0-PUBLIC -----BEGIN PUBLIC KEY----- MEAwEAYHKoZIzj0CAQYFK4EEAAEDLAAEBx+LKHfWAn2cGt5CRPLeoSaS7yPVBcFe 53YiHHK4SzR844PzgGe4nD6a -----END PUBLIC KEY----- PublicKey=KAS-ECC-CDH_K-163_C0-Peer-PUBLIC -----BEGIN PUBLIC KEY----- MEAwEAYHKoZIzj0CAQYFK4EEAAEDLAAEBXQjbxQoxDITCUZ4Ols6q7bCfqXWB5CM JRuNoCHLrCgfEj969PrFs9u4 -----END PUBLIC KEY----- Derive=KAS-ECC-CDH_K-163_C0 PeerKey=KAS-ECC-CDH_K-163_C0-Peer-PUBLIC Ctrl=ecdh_cofactor_mode:1 SharedSecret=04325bff38f1b0c83c27f554a6c972a80f14bc23bc ~~~ Reviewed-by: Andy Polyakov <appro@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3226)
2017-03-17Fixed PKCS5_PBKDF2_HMAC() to adhere to the documentation.Péter Budai
The documentation of this function states that the password parameter can be NULL. However, the implementation returns an error in this case due to the inner workings of the HMAC_Init_ex() function. With this change, NULL password will be treated as an empty string and PKCS5_PBKDF2_HMAC() no longer fails on this input. I have also added two new test cases that tests the handling of the special values NULL and -1 of the password and passlen parameters, respectively. Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1692)
2017-02-28Avoid buffer underflow in evp_test.Pauli
The second loop in the remove_space function doesn't check for walking back off of the start of the string while setting white space to 0. This fix exits this loop once the pointer is before the (updated) beginning of the string. Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2752)
2017-02-08Call EVP_CipherFinal in CCM mode for tests.Dr. Stephen Henson
Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2550)
2017-02-01Add support for parameterized SipHashTodd Short
The core SipHash supports either 8 or 16-byte output and a configurable number of rounds. The default behavior, as added to EVP, is to use 16-byte output and 2,4 rounds, which matches the behavior of most implementations. There is an EVP_PKEY_CTRL that can control the output size. Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2216)
2017-01-29test/evp_test.c: If no algorithm was specified, don't try to check for DESRichard Levitte
Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2319)
2017-01-25Adjust in and in_len instead of donelenMatt Caswell
Don't use the temp variable donelen in the non-aad fragmented code path. Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2275)
2017-01-25Fix the overlapping check for fragmented "Update" operationsMatt Caswell
When doing in place encryption the overlapping buffer check can fail incorrectly where we have done a partial block "Update" operation. This fixes things to take account of any pending partial blocks. Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2275)
2017-01-25Update evp_test to make sure passing partial block to "Update" is okMatt Caswell
The previous commit fixed a bug where a partial block had been passed to an "Update" function and it wasn't properly handled. We should catch this type of error in evp_test. Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2275)
2017-01-24Add support for Poly1305 in EVP_PKEYTodd Short
Add Poly1305 as a "signed" digest. Reviewed-by: Andy Polyakov <appro@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2128)
2017-01-05Remove BIO_seek/BIO_tell from evp_test.cDr. Stephen Henson
BIO_seek and BIO_tell can cause problems with evp_test.c on some platforms. Avoid them by using a temporary memory BIO to store key PEM data. Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2183)
2016-12-16evp_test: when function and reason strings aren't available, just skipRichard Levitte
Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2093)
2016-12-14Add function and reason checking to evp_testDr. Stephen Henson
Add options to check the function and reason code matches expected values. Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-12-10Additional error tests in evp_test.cDr. Stephen Henson
Support checking for errors during test initialisation and parsing. Add errors and tests for key operation initalisation and ctrl errors. Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-11-21Skipping tests in evp_test leaks memoryTodd Short
When configured with "no-mdc2 enable-crypto-mdebug" the evp_test will leak memory due to skipped tests, and error out. Also fix a skip condition Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1968)
2016-11-10Fix the evp_test Ctrl keyword processingRichard Levitte
Skip the test if the value after ":" is a disabled algorithm, rather than failing it Reviewed-by: Matt Caswell <matt@openssl.org>
2016-08-12Check for bad filename in evp_testRich Salz
Thanks to Brian Carpter for reporting this. Reviewed-by: Dr. Stephen Henson <steve@openssl.org>
2016-05-17Copyright consolidation 02/10Rich Salz
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-05-16test/evp_test.c: exercise in-place encryption.Andy Polyakov
Reviewed-by: Emilia Käsper <emilia@openssl.org>
2016-05-06test/evp_test.c: exercise different combinations of data misalignment.Andy Polyakov
Reviewed-by: Emilia Käsper <emilia@openssl.org>
2016-04-18Make string_to_hex/hex_to_string publicRich Salz
Give the API new names, document it. Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-04-07test/[dane|evp_]test.c: BIO-fy file I/O.Andy Polyakov
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-03-21Fix no-scryptMatt Caswell
Fix the evp tests when no-scrypt is used. Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-03-18Fix no-desMatt Caswell
Numerous fixes for no-des. Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-03-18Fix no-cmacMatt Caswell
There were a couple of CMAC references without OPENSSL_NO_CMAC guards. Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-03-02Generalise KDF test in evp_test.cDr. Stephen Henson
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-03-02Add Ctrl keyword to KDF test in evp_testDr. Stephen Henson
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-09Clean up the tests for auto-init/de-initMatt Caswell
Remove the need to explicitly initialise/deinitialise for the tests Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-05If memory debugging enabled return error on leaks.Dr. Stephen Henson
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-01-30handle "Ctrl" in separate functionDr. Stephen Henson
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
2016-01-30Add support for EVP_PKEY_derive in evp_testDr. Stephen Henson
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
2016-01-30fix warningDr. Stephen Henson
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
2016-01-26Remove /* foo.c */ commentsRich Salz
This was done by the following find . -name '*.[ch]' | /tmp/pl where /tmp/pl is the following three-line script: print unless $. == 1 && m@/\* .*\.[ch] \*/@; close ARGV if eof; # Close file to reset $. And then some hand-editing of other files. Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
2016-01-19Add TLS1-PRF test support to evp_testDr. Stephen Henson
Reviewed-by: Matt Caswell <matt@openssl.org>
2016-01-11Enable/disable crypto-mdebug just like other featuresViktor Dukhovni
Also always abort() on leak failure. Reviewed-by: Stephen Henson <steve@openssl.org>
2015-12-16Rename some BUF_xxx to OPENSSL_xxxRich Salz
Rename BUF_{strdup,strlcat,strlcpy,memdup,strndup,strnlen} to OPENSSL_{strdup,strlcat,strlcpy,memdup,strndup,strnlen} Add #define's for the old names. Add CRYPTO_{memdup,strndup}, called by OPENSSL_{memdup,strndup} macros. Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-12-11Adapt EVP tests to the opaque EVP_ENCODE_CTXRichard Levitte
Reviewed-by: Rich Salz <rsalz@openssl.org>