summaryrefslogtreecommitdiffstats
path: root/test
AgeCommit message (Collapse)Author
2017-03-06Fix an endless loop in rsa_builtin_keygen.Rich Salz
And add a test case. Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2757) (cherry picked from commit 697958313ba48c8ebc832ab8f9f2b845fb7acfd4)
2017-03-03Reset executable bits on files where not needed.Bernd Edlinger
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2838)
2017-02-28Test framework: Add the possibility to have a test specific data dirRichard Levitte
This data directory is formed automatically by taking the recipe name and changing '.t' to '_data'. Files in there can be reached with the new function data_file() (Merged from https://github.com/openssl/openssl/pull/2027) (cherry picked from commit 6c6a2ae6fc964795304bbe7687e42b2b0cdf81b3) Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2802)
2017-02-28Add AGL's "beer mug" PEM file as another test inputBenjamin Kaduk
AGL has a history of pointing out the idiosynchronies/laxness of the openssl PEM parser in amusing ways. If we want this functionality to stay present, we should test that it works. Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2756) (cherry picked from commit a00b9560f7ece1e51bd7a8dc6a7ffb7a3d20cf86)
2017-02-28Add test corpus for PEM readingBenjamin Kaduk
Generate a fresh certificate and DSA private key in their respective PEM files. Modify the resulting ASCII in various ways so as to produce input files that might be generated by non-openssl programs (openssl always generates "standard" PEM files, with base64 data in 64-character lines except for a possible shorter last line). Exercise various combinations of line lengths, leading/trailing whitespace, non-base64 characters, comments, and padding, for both unencrypted and encrypted files. (We do not have any other test coverage that uses encrypted files, as far as I can see, and the parser enforces different rules for the body of encrypted files.) Add a recipe to parse these test files and verify that they contain the expected string or are rejected, according to the expected status. Some of the current behavior is perhaps suboptimal and could be revisited. Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2756) (cherry picked from commit e8cee55718bb9cb957f449fbe7145a77f252bb73)
2017-02-28Exdata test was never enabled.Rich Salz
Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2787) (cherry picked from commit 629192c1b9f17965e0a6b73229b7b1e004bfbd98)
2017-02-28Fix test_ssl_new when compiled with no-tls1_2 or no-dtls1_2Matt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2788) (cherry picked from commit 4d118fe007692de2dd8c5dd084254f8d3b308167)
2017-02-23Add -Wundef to strict-warningsRich Salz
Avoid a -Wundef warning in o_str.c Avoid a -Wundef warning in testutil.h Include internal/cryptlib.h before openssl/stack.h to avoid use of undefined symbol OPENSSL_API_COMPAT. Reviewed-by: Andy Polyakov <appro@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2709)
2017-02-19VMS fix of test/recipes/80-test_ssl_new.tRichard Levitte
On VMS, file names with more than one period get all but the last get escaped with a ^, so 21-key-update.conf.in becomes 21-key-update^.conf.in That means that %conf_dependent_tests and %skip become useless unless we massage the file names that are used as indexes. Reviewed-by: Andy Polyakov <appro@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2678) (cherry picked from commit d89f66412ba5168e7d6fd9dd88619d927d716f55)
2017-02-17Fix test_x509_storeRichard Levitte
Don't run this test unless 'openssl rehash' works properly. Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2664) (cherry picked from commit 73540f4729bb856ab066c6e7a57513a97e3ca36f)
2017-02-17Add a test of the X509_STORE / X509_LOOKUP APIRichard Levitte
Fortunately, "openssl verify" makes good use of that API Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2652) (cherry picked from commit bb0f7eca75b8da1538c08c1f5be1bb7ea8f40638)
2017-02-17test/README: clarify test number groupsRichard Levitte
Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2652) (cherry picked from commit 532e7b36d9622ac06a96fb3557b5bc16016e5ca8)
2017-02-16Fix a mem leak in ssl_test_ctx.cMatt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2650) (cherry picked from commit d605fc3a0ce4103ca6660904795bf1209cdb55b7)
2017-02-16Don't run MSBLOB conversion tests when RSA or DSA are disabledRichard Levitte
Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2174) (cherry picked from commit d8594555ffaf98ada08b26ce3d1138f16bc029c5)
2017-02-16Provide a test for the Encrypt-Then-Mac renegotiation crashMatt Caswell
Changing the ciphersuite during a renegotiation can result in a crash leading to a DoS attack. ETM has not been implemented in 1.1.0 for DTLS so this is TLS only. This commit provides a test for the issue. CVE-2017-3733 Reviewed-by: Richard Levitte <levitte@openssl.org>
2017-02-13Add test to show wrong behavior of ASYNC_WAIT_CTXAndrea Grandi
This happens when a fd is added and then immediately removed from the ASYNC_WAIT_CTX before pausing the job. Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2581) (cherry picked from commit f44e63644d29e5908be52b7896d5031a5cf460eb)
2017-02-13test_rehash does nothing, have it do somethingRichard Levitte
test/recipes/40-test_rehash.t uses test files from certs/demo, which doesn't exist any longer. Have it use PEM files from test/ instead. Because rehash wants only one certificate or CRL per file, we must also filter those PEM files to produce test files with a single object each. Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2594) (cherry picked from commit 4bbd8a5daaa810c487f684971c0339a1d7c15da9)
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) (cherry picked from commit 31b69e9a26c5b127ce273bc5834b9e13e5e25556)
2017-01-28Add a couple of test to check CRL fingerprintRichard Levitte
Reviewed-by: Kurt Roeckx <kurt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2314) (cherry picked from commit 929860d0e6112f5c7766d9ea036c3f8bd8d3d719)
2017-01-26Add server signature algorithm bug test.Dr. Stephen Henson
Add a client authentication signature algorithm to simple ssl test and a server signature algorithm. Since we don't do client auth this should have no effect. However if we use client auth signature algorithms by mistake this will abort the handshake with a no shared signature algorithms error. Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2297)
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) (cherry picked from commit ef055ec536a3c6e698dd9f45b41d57a32366b4fa)
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) (cherry picked from commit 7141ba31969d0b378d08104a51f8f99b9187b9d5)
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) (cherry picked from commit 0b96d77a62d8ac9a45ac1dda47560ced676b5b8d)
2017-01-23Extend the test_ssl_new renegotiation tests to include client authMatt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1983)
2017-01-23Add a test to check messsages sent are the ones we expectMatt Caswell
Repeat for various handshake types Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1983)
2017-01-18Skip ECDH tests for SSLv3Rich Salz
Reviewed-by: Viktor Dukhovni <viktor@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1597) (cherry picked from commit 4f326dd8998d5b33f72b11432f110e0f2cfcb92b)
2017-01-12GH2176: Add X509_VERIFY_PARAM_get_timeRich Salz
Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2208) (cherry picked from commit 329f2f4a428b0acb7a579869a13f6cd6bf0a3551)
2017-01-08Add new ssl_test option.Dr. Stephen Henson
Add option ExpectedTmpKeyType to test the temporary key the server sends is of the correct type. Reviewed-by: Kurt Roeckx <kurt@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2191) (cherry picked from commit b93ad05dba3e3d2ceb79799a883ae43d42ba16e2)
2017-01-08Add server temp key type checksDr. Stephen Henson
Reviewed-by: Kurt Roeckx <kurt@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2191) (cherry picked from commit 9c4319bd03f17fc87ae63b6231c87c678e5cabd1)
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) (cherry picked from commit 71f60ef3376144885384f2b1b3f00c3d54806f38)
2017-01-03evptests.txt is not a shell scriptDr. Stephen Henson
Reviewed-by: Rich Salz <rsalz@openssl.org> (cherry picked from commit 4fee75ca23b9434928be2476080be42b45a8d99a)
2017-01-03Add RSA decrypt and OAEP tests.Dr. Stephen Henson
Reviewed-by: Rich Salz <rsalz@openssl.org> (cherry picked from commit 13ab87083af862e4af752efa4b0552149ed2cc19)
2016-12-30Provide some tests for the sig algs APIMatt Caswell
Reviewed-by: Tim Hudson <tjh@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2160) (cherry picked from commit f1b25aaed32f90b3309243d24353bf636c1c786b)
2016-12-17test/ssl_test: give up if both client and server wait on readRichard Levitte
In some cases, both client and server end of the test can end up in SSL_ERROR_WANT_READ and never get out of it, making the test spin. Detect it and give up instead of waiting endlessly. Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2096) (cherry picked from commit ceb6d746941063eccf7655c7709ba56ca117044b)
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) (cherry picked from commit cd3fe0e09c97700005ed96c8113907cbdfc45edf)
2016-12-14CRL critical extension bugfixRich Salz
More importantly, port CRL test from boringSSL crypto/x509/x509_test.cc Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1775) (cherry picked from commit 2b40699082d1e5d0e94811542c4f0633ab2d5989)
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> (cherry picked from commit 99f2f1dc3e5c95961f57ca41e9fbb76863e69e46)
2016-12-12Fix a leak in SSL_clear()Matt Caswell
SSL_clear() was resetting numwpipes to 0, but not freeing any allocated memory for existing write buffers. Fixes #2026 Reviewed-by: Rich Salz <rsalz@openssl.org> (cherry picked from commit 4bf086005fe5ebcda5dc4d48ff701b41ab9b07f0)
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> (cherry picked from commit cce65266299e2e89303a90c131e8171225a1bf88)
2016-12-10Add RSA PSS testsDr. Stephen Henson
Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2065) (cherry picked from commit 2d7bbd6c9fb6865e0df480602c3612652189e182)
2016-12-08Add a test for the UI APIRichard Levitte
The best way to test the UI interface is currently by using an openssl command that uses password_callback. The only one that does this is 'genrsa'. Since password_callback uses a UI method derived from UI_OpenSSL(), it ensures that one gets tested well enough as well. Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2040) (cherry picked from commit 17ac8eaf611b588cca251ba63b187e7d9c7edb83)
2016-11-25add CMS SHA1 signing testDr. Stephen Henson
Reviewed-by: Rich Salz <rsalz@openssl.org> (cherry picked from commit c6d67f09f34d8203c5bad7171ed45ec8771c9764)
2016-11-25test/evptests.txt: add regression test for false carry in ctr128.c.Andy Polyakov
GH issue #1916 affects only big-endian platforms. TLS is not affected, because TLS fragment is never big enough. Reviewed-by: Matt Caswell <matt@openssl.org> (cherry picked from commit b47f116b1e02d20b1f8a7488be5a04f7cf5bc712)
2016-11-21Make SSL_read and SSL_write return the old behaviour and document it.Kurt Roeckx
Backport of beacb0f0c1ae7b0542fe053b95307f515b578eb7, revert of 122580ef71e4e5f355a1a104c9bfb36feee43759 Fixes: #1903 Reviewed-by: Matt Caswell <matt@openssl.org> GH: #1966
2016-11-21Make async_read and async_write return -1 on failure.Kurt Roeckx
Reviewed-by: Matt Caswell <matt@openssl.org> GH: #1966
2016-11-20Skipping 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/1946)
2016-11-17Add conversion test for MSBLOB format.Dr. Stephen Henson
Reviewed-by: Rich Salz <rsalz@openssl.org> (cherry picked from commit d922634d0c63cee01c89869d79306cd2df628855)
2016-11-16Make sure things get deleted when test setup fails in ct_test.cRob Percival
Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1548) (cherry picked from commit 765731a88899771989a53c72259cacd1c658bb3f)
2016-11-16Use valid signature in test_decode_tls_sct()Rob Percival
Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1548) (cherry picked from commit e2635c49f35c615820b1c6d92d180e31e28adeb2)
2016-11-16Construct SCT from base64 in ct_testRob Percival
This gives better code coverage and is more representative of how a user would likely construct an SCT (using the base64 returned by a CT log). Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1548) (cherry picked from commit f7a39a5a3f7f91e0d1ba0030323eef26bc8ccddf)