aboutsummaryrefslogtreecommitdiffstats
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
* test/x509aux.c: Fix argv loopRichard Levitte2016-09-211-6/+11
| | | | | | | | There are cases when argc is more trustable than proper argv termination. Since we trust argc in all other test programs, we might as well treat it the same way in this program. Reviewed-by: Matt Caswell <matt@openssl.org>
* Convert WPACKET_put_bytes to use convenience macrosMatt Caswell2016-09-201-16/+16
| | | | | | | | All the other functions that take an argument for the number of bytes use convenience macros for this purpose. We should do the same with WPACKET_put_bytes(). Reviewed-by: Rich Salz <rsalz@openssl.org>
* Fix no-ocspRichard Levitte2016-09-191-1/+3
| | | | | | | Some compilers complain about unused variables, and some tests do not run well without OCSP. Reviewed-by: Rich Salz <rsalz@openssl.org>
* Test the new SHA256 and SHA512 based password generation optionsRichard Levitte2016-09-141-8/+92
| | | | Reviewed-by: Rich Salz <rsalz@openssl.org>
* Encourage use of the macros for the various "sub" functionsMatt Caswell2016-09-141-9/+9
| | | | | | | Don't call WPACKET_sub_memcpy(), WPACKET_sub_allocation_bytes() and WPACKET_start_sub_packet_len() directly. Reviewed-by: Rich Salz <rsalz@openssl.org>
* Make wpackettest conform to style rulesMatt Caswell2016-09-141-20/+20
| | | | | | Remove extra indentation at the start of an "if". Reviewed-by: Rich Salz <rsalz@openssl.org>
* Add a WPACKET_sub_allocate_bytes() functionMatt Caswell2016-09-141-0/+16
| | | | | | | Updated the construction code to use the new function. Also added some convenience macros for WPACKET_sub_memcpy(). Reviewed-by: Rich Salz <rsalz@openssl.org>
* Add a test for 'openssl passwd'Richard Levitte2016-09-142-1/+39
| | | | | | | Also, enlarge test group 20 to include openssl commands that aren't tested otherwise Reviewed-by: Rich Salz <rsalz@openssl.org>
* Address WPACKET review commentsMatt Caswell2016-09-131-70/+20
| | | | | | | | | | | A few style tweaks here and there. The main change is that curr and packet_len are now offsets into the buffer to account for the fact that the pointers can change if the buffer grows. Also dropped support for the WPACKET_set_packet_len() function. I thought that was going to be needed but so far it hasn't been. It doesn't really work any more due to the offsets change. Reviewed-by: Rich Salz <rsalz@openssl.org>
* Add tests for the WPACKET implementationMatt Caswell2016-09-133-0/+473
| | | | | | | The tests will only work in no-shared builds because WPACKET is an internal only API that does not get exported by the shared library. Reviewed-by: Rich Salz <rsalz@openssl.org>
* Correct detection of group end in map file when testing symbol presenceRichard Levitte2016-09-061-0/+1
| | | | Reviewed-by: Matt Caswell <matt@openssl.org>
* Move 05-test_fuzz.t to 90-test_fuzz.tRichard Levitte2016-09-011-0/+0
| | | | | | This adheres much better to the documentation in test/README Reviewed-by: Rich Salz <rsalz@openssl.org>
* Revert "Make it possible to disable fuzz testing"Richard Levitte2016-09-011-3/+0
| | | | | | This reverts commit eb40eaed727500bf4a15f848c99e37edd18e142e. Reviewed-by: Emilia Käsper <emilia@openssl.org>
* Add a more versatile test chooserRichard Levitte2016-09-011-23/+48
| | | | | | | | | | | | | | | | | | | | | | | | | So far, the test runner (test/run_tests.pl) could get a list of tests to run, and if non were given, it assumes all available tests should be performed. However, that makes skipping just one or two tests a bit of a pain. This change makes the possibilities more versatile, run_checker.pl takes these arguments and will process them in the given order, starting with an empty set of tests to perform: alltests The current set becomes the whole set of available tests. test_xxx Adds 'test_xxx' to the current set. -test_xxx Removes 'test_xxx' from the current set. If nothing has been added to the set before this argument, the current set is first initialised to the whole set of available tests, then 'test_xxx' is removed from the current set. list Display all available tests, then stop. If no arguments are given, 'alltests' is assumed. Reviewed-by: Emilia Käsper <emilia@openssl.org>
* Make it possible to disable fuzz testingRichard Levitte2016-08-311-0/+3
| | | | | | | | | These tests take a very long time on some platforms, and arent't always strictly necessary. This makes it possible to turn them off. The necessary binaries are still built, though, in case someone still wants to do a manual run. Reviewed-by: Andy Polyakov <appro@openssl.org>
* Add some CertStatus testsMatt Caswell2016-08-3010-2/+303
| | | | | | | | The previous commit revealed a long standing problem where CertStatus processing was broken in DTLS. This would have been revealed by better testing - so add some! Reviewed-by: Rich Salz <rsalz@openssl.org>
* Fix uninit read in sslapitestMatt Caswell2016-08-251-0/+1
| | | | | | msan detected an uninit read. Reviewed-by: Richard Levitte <levitte@openssl.org>
* Windows: UTF-8 opt-in for command-line arguments and console input.Andy Polyakov2016-08-251-0/+1
| | | | | | | | | | User can make Windows openssl.exe to treat command-line arguments and console input as UTF-8 By setting OPENSSL_WIN32_UTF8 environment variable (to any value). This is likely to be required for data interchangeability with other OSes and PKCS#12 containers generated with Windows CryptoAPI. Reviewed-by: Richard Levitte <levitte@openssl.org>
* Fix no-ec2mMatt Caswell2016-08-241-1/+2
| | | | | | The new curves test did not take into account no-ec2m Reviewed-by: Richard Levitte <levitte@openssl.org>
* To avoid SWEET32 attack, move 3DES to weakRich Salz2016-08-241-13/+0
| | | | Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
* 80-test_pkcs12.t: skip the test on Windows with non-Greek locale.Andy Polyakov2016-08-231-10/+20
| | | | | | | | Test doesn't work on Windows with non-Greek locale, because of Win32 perl[!] limitation, not OpenSSL. For example it passes on Cygwin and MSYS... Reviewed-by: Matt Caswell <matt@openssl.org>
* Fix bio_enc_testMatt Caswell2016-08-231-8/+6
| | | | | | | | | | | | There was a block of code at the start that used the Camellia cipher. The original idea behind this was to fill the buffer with non-zero data so that oversteps can be detected. However this block failed when using no-camellia. This has been replaced with a RAND_bytes() call. I also updated the the CTR test section, since it seems to be using a CBC cipher instead of a CTR cipher. Reviewed-by: Andy Polyakov <appro@openssl.org>
* Test the support curves in tlsKurt Roeckx2016-08-223-2/+802
| | | | | Reviewed-by: Rich Salz <rsalz@openssl.org> GH: #1472
* Fix no-desMatt Caswell2016-08-221-0/+13
| | | | | | The PKCS12 command line utility is not available if no-des is used. Reviewed-by: Rich Salz <rsalz@openssl.org>
* RT2676: Reject RSA eponent if even or 1Rich Salz2016-08-221-1/+3
| | | | | | | | | Also, re-organize RSA check to use goto err. Add a test case. Try all checks, not just stopping at first (via Richard Levitte) Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>
* Fix a memory leak in EC_GROUP_get_ecparameters()Kazuki Yamaguchi2016-08-221-0/+29
| | | | | | | | The variable 'buffer', allocated by EC_POINT_point2buf(), isn't free'd on the success path. Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
* Choose a ciphersuite for testing that won't be affected by "no-*" optionsMatt Caswell2016-08-221-1/+1
| | | | | | The previous ciphersuite broke in no-ec builds. Reviewed-by: Richard Levitte <levitte@openssl.org>
* ssltestlib: Tell compiler we don't care about the value when we don'tRichard Levitte2016-08-221-1/+1
| | | | | | | | | In mempacket_test_read(), we've already fetched the top value of the stack, so when we shift the stack, we don't care for the value. The compiler needs to be told, or it will complain harshly when we tell it to be picky. Reviewed-by: Matt Caswell <matt@openssl.org>
* crypto/pkcs12: facilitate accessing data with non-interoperable password.Andy Polyakov2016-08-221-0/+11
| | | | | | | | | | | Originally PKCS#12 subroutines treated password strings as ASCII. It worked as long as they were pure ASCII, but if there were some none-ASCII characters result was non-interoperable. But fixing it poses problem accessing data protected with broken password. In order to make asscess to old data possible add retry with old-style password. Reviewed-by: Richard Levitte <levitte@openssl.org>
* Add PKCS#12 UTF-8 interoperability test.Andy Polyakov2016-08-222-0/+31
| | | | Reviewed-by: Richard Levitte <levitte@openssl.org>
* Add test/bio_enc_test.c.Andy Polyakov2016-08-213-1/+157
| | | | | | RT#4628 Reviewed-by: Rich Salz <rsalz@openssl.org>
* MEMPACKET is typedef'd in ssltestlib.h, don't do so again in ssltestlib.cRichard Levitte2016-08-191-2/+2
| | | | Reviewed-by: Rich Salz <rsalz@openssl.org>
* Fix some clang warningsMatt Caswell2016-08-193-3/+5
| | | | | | | | Clang was complaining about some unused functions. Moving the stack declaration to the header seems to sort it. Also the certstatus variable in dtlstest needed to be declared static. Reviewed-by: Richard Levitte <levitte@openssl.org>
* Add DTLS replay protection testMatt Caswell2016-08-191-4/+16
| | | | | | | | Injects a record from epoch 1 during epoch 0 handshake, with a record sequence number in the future, to test that the record replay protection feature works as expected. This is described more fully in the next commit. Reviewed-by: Richard Levitte <levitte@openssl.org>
* Add a DTLS unprocesed records testMatt Caswell2016-08-193-1/+156
| | | | | | | Add a test to inject a record from the next epoch during the handshake and make sure it doesn't get processed immediately. Reviewed-by: Richard Levitte <levitte@openssl.org>
* Split create_ssl_connection()Matt Caswell2016-08-194-37/+64
| | | | | | | | | Split the create_ssl_connection() helper function into two steps: one to create the SSL objects, and one to actually create the connection. This provides the ability to make changes to the SSL object before the connection is actually made. Reviewed-by: Richard Levitte <levitte@openssl.org>
* Add a DTLS packet mem BIOMatt Caswell2016-08-192-0/+306
| | | | | | | | This adds a BIO similar to a normal mem BIO but with datagram awareness. It also has the capability to inject additional packets at arbitrary locations into the BIO, for testing purposes. Reviewed-by: Richard Levitte <levitte@openssl.org>
* Add a (D)TLS dumper BIOMatt Caswell2016-08-192-0/+223
| | | | | | | Dump out the records passed over the BIO. Only works for DTLS at the moment but could easily be extended to TLS. Reviewed-by: Richard Levitte <levitte@openssl.org>
* Add more details on how to add a new SSL testEmilia Kasper2016-08-192-19/+44
| | | | Reviewed-by: Stephen Henson <steve@openssl.org>
* Test that the peers send at most one fatal alertEmilia Kasper2016-08-184-5/+29
| | | | | | | Duplicate alerts have happened, see 70c22888c1648fe8652e77107f3c74bf2212de36 Reviewed-by: Rich Salz <rsalz@openssl.org>
* Port multi-buffer testsEmilia Kasper2016-08-1810-31/+648
| | | | | | | Make maximum fragment length configurable and add various fragmentation tests, in addition to the existing multi-buffer tests. Reviewed-by: Rich Salz <rsalz@openssl.org>
* Constify char* input parameters in apps codeFdaSilvaYY2016-08-171-1/+1
| | | | | Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
* Convert SSL_SESSION* functions to use const gettersMatt Caswell2016-08-161-1/+1
| | | | | Reviewed-by: Viktor Dukhovni <viktor@openssl.org> Reviewed-by: Stephen Henson <steve@openssl.org>
* two typo fixesFdaSilvaYY2016-08-161-1/+1
| | | | | Reviewed-by: Emilia Käsper <emilia@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1461)
* test/ssl_test.tmpl: make it work with elderly perl.Andy Polyakov2016-08-161-5/+5
| | | | Reviewed-by: Rich Salz <rsalz@openssl.org>
* SSL tests: send some application dataEmilia Kasper2016-08-165-87/+284
| | | | Reviewed-by: Rich Salz <rsalz@openssl.org>
* Remove a stray unneeded line in 70-test_sslrecords.tMatt Caswell2016-08-151-1/+0
| | | | Reviewed-by: Tim Hudson <tjh@openssl.org>
* Add some SSLv2 ClientHello testsMatt Caswell2016-08-151-1/+197
| | | | | | Test that we handle a TLS ClientHello in an SSLv2 record correctly. Reviewed-by: Tim Hudson <tjh@openssl.org>
* Improves CTLOG_STORE settersRob Percival2016-08-151-3/+4
| | | | | | | | Changes them to have clearer ownership semantics, as suggested in https://github.com/openssl/openssl/pull/1372#discussion_r73232196. Reviewed-by: Emilia Käsper <emilia@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1408)
* Skip the SRP tests in 80-test_ssl_old.t if no TLS versions is enabledRichard Levitte2016-08-151-1/+1
| | | | Reviewed-by: Rich Salz <rsalz@openssl.org>