aboutsummaryrefslogtreecommitdiffstats
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* Update X25519 key format in evptests.txtDr. Stephen Henson2016-08-131-20/+4
| | | | Reviewed-by: Rich Salz <rsalz@openssl.org>
* Check for bad filename in evp_testRich Salz2016-08-121-0/+4
| | | | | | Thanks to Brian Carpter for reporting this. Reviewed-by: Dr. Stephen Henson <steve@openssl.org>
* Don't attempt to load the CT log list with no-ecEmilia Kasper2016-08-102-2/+4
| | | | | | | | In practice, CT isn't really functional without EC anyway, as most logs use EC keys. So, skip loading the log list with no-ec, and skip CT tests completely in that conf. Reviewed-by: Rich Salz <rsalz@openssl.org>
* Change callers to use the new constants.Rich Salz2016-08-102-5/+5
| | | | Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1429)
* Gracefully free a NULL HANDSHAKE_RESULTEmilia Kasper2016-08-101-0/+2
| | | | Reviewed-by: Rich Salz <rsalz@openssl.org>
* Add TEST_checkEmilia Kasper2016-08-105-58/+71
| | | | | | Like OPENSSL_assert, but also prints the error stack before exiting. Reviewed-by: Rich Salz <rsalz@openssl.org>
* SSL tests: port CT tests, add a few moreEmilia Kasper2016-08-1010-25/+302
| | | | | | | | This commit only ports existing tests, and adds some coverage for resumption. We don't appear to have any handshake tests that cover SCT validation success, and this commit doesn't change that. Reviewed-by: Rich Salz <rsalz@openssl.org>
* SSL test ctx: fix testsEmilia Kasper2016-08-102-2/+18
| | | | | | | Some failure tests were failing for the wrong reason after the CTX refactoring. Update those tests. Reviewed-by: Rich Salz <rsalz@openssl.org>
* Kill PACKET_starts() from bad_dtls_testDavid Woodhouse2016-08-101-22/+6
| | | | | | | As discussed in PR#1409 it can be done differently. Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
* Fix clienthellotest to use PACKET functionsDavid Woodhouse2016-08-101-36/+24
| | | | | Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
* NPN and ALPN: test resumptionEmilia Kasper2016-08-086-52/+950
| | | | | | | In NPN and ALPN, the protocol is renegotiated upon resumption. Test that resumption picks up changes to the extension. Reviewed-by: Rich Salz <rsalz@openssl.org>
* Fix ALPN tests when NPN is offEmilia Kasper2016-08-083-11/+7
| | | | | | OPENSSL_NO_NEXTPROTONEG only disables NPN, not ALPN Reviewed-by: Richard Levitte <levitte@openssl.org>
* Reorganize SSL test structuresEmilia Kasper2016-08-0828-913/+1698
| | | | | | | | | | | | | | | | | | | | | Move custom server and client options from the test dictionary to an "extra" section of each server/client. Rename test expectations to say "Expected". This is a big but straightforward change. Primarily, this allows us to specify multiple server and client contexts without redefining the custom options for each of them. For example, instead of "ServerNPNProtocols", "Server2NPNProtocols", "ResumeServerNPNProtocols", we now have, "NPNProtocols". This simplifies writing resumption and SNI tests. The first application will be resumption tests for NPN and ALPN. Regrouping the options also makes it clearer which options apply to the server, which apply to the client, which configure the test, and which are test expectations. Reviewed-by: Richard Levitte <levitte@openssl.org>
* spelling fixes, just comments and readme.klemens2016-08-056-6/+6
| | | | | Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1413)
* Move the building of test/buildtest_*. to be done unconditionallyRichard Levitte2016-08-052-8/+16
| | | | | | | | | These were guarded by $disabled{tests}. However, 'tests' is disabled if we configure 'no-stdio', which means that we don't detect the lack of OPENSSL_NO_STDIO guards in our public header files. So we move the generation and build of test/buildtest_*.c to be unconditional. Reviewed-by: Rich Salz <rsalz@openssl.org>
* VMS: Fix building of bad_dtls_testRichard Levitte2016-08-052-3/+3
| | | | Reviewed-by: Tim Hudson <tjh@openssl.org>
* Add basic test for Cisco DTLS1_BAD_VER and record replay handlingDavid Woodhouse2016-08-043-1/+662
| | | | | Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
* 80-test_ssl_new.t: only skip on $no_tls if no other skip conditions definedRichard Levitte2016-08-021-1/+1
| | | | Reviewed-by: Matt Caswell <matt@openssl.org>
* In 80-test_ssl_new, more "plan tests" to a more useful positionRichard Levitte2016-08-021-4/+4
| | | | Reviewed-by: Matt Caswell <matt@openssl.org>
* Fix tests for no-nextprotonegMatt Caswell2016-08-023-6/+3
| | | | | | | Fix the 80-test_ssl_test_ctx and 80-test_ssl_new tests when used with the no-nextprotoneg option Reviewed-by: Richard Levitte <levitte@openssl.org>
* Fix various no-*s.Ben Laurie2016-08-015-1/+26
| | | | Reviewed-by: Rich Salz <rsalz@openssl.org>
* test/smcont.txt: trigger assertion in bio_enc.c.Andy Polyakov2016-07-311-1/+1
| | | | Reviewed-by: Stephen Henson <steve@openssl.org>
* Fix bogus warningsMatt Caswell2016-07-301-1/+1
| | | | | | Fix some bogus "may be used uninitialized" warnings on some compilers. Reviewed-by: Rich Salz <rsalz@openssl.org>
* Simplify and rename SSL_set_rbio() and SSL_set_wbio()Matt Caswell2016-07-292-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | SSL_set_rbio() and SSL_set_wbio() are new functions in 1.1.0 and really should be called SSL_set0_rbio() and SSL_set0_wbio(). The old implementation was not consistent with what "set0" means though as there were special cases around what happens if the rbio and wbio are the same. We were only ever taking one reference on the BIO, and checking everywhere whether the rbio and wbio are the same so as not to double free. A better approach is to rename the functions to SSL_set0_rbio() and SSL_set0_wbio(). If an existing BIO is present it is *always* freed regardless of whether the rbio and wbio are the same or not. It is therefore the callers responsibility to ensure that a reference is taken for *each* usage, i.e. one for the rbio and one for the wbio. The legacy function SSL_set_bio() takes both the rbio and wbio in one go and sets them both. We can wrap up the old behaviour in the implementation of that function, i.e. previously if the rbio and wbio are the same in the call to this function then the caller only needed to ensure one reference was passed. This behaviour is retained by internally upping the ref count. This commit was inspired by BoringSSL commit f715c423224. RT#4572 Reviewed-by: Rich Salz <rsalz@openssl.org>
* Add some SSL BIO testsMatt Caswell2016-07-291-0/+121
| | | | | | | | This adds some simple SSL BIO tests that check for pushing and popping of BIOs into the chain. These tests would have caught the bugs fixed in the previous three commits, if combined with a crypto-mdebug build. Reviewed-by: Rich Salz <rsalz@openssl.org>
* Add a test for SSL_set_bio()Matt Caswell2016-07-291-3/+122
| | | | | | | The SSL_set_bio() function has some complicated ownership rules. This adds a test to make sure it all works as expected. Reviewed-by: Rich Salz <rsalz@openssl.org>
* Fix no-tls1_2Matt Caswell2016-07-253-4/+5
| | | | | | Misc fixes impacting no-tls1_2. Also fixes no-dtls1_2. Reviewed-by: Rich Salz <rsalz@openssl.org>
* Fix no-dtls*Matt Caswell2016-07-251-5/+4
| | | | | | Also fixes some other options like no-dgram and no-sock. Reviewed-by: Rich Salz <rsalz@openssl.org>
* Fix no-ctMatt Caswell2016-07-251-1/+4
| | | | | | Ensure that we don't build/run the ct fuzzing code if no-ct is used. Reviewed-by: Rich Salz <rsalz@openssl.org>
* SSL tests: compress generated output a littleEmilia Kasper2016-07-228-462/+160
| | | | | | | Don't emit duplicate server/client sections when they are identical. Instead, just point to the same section. Reviewed-by: Rich Salz <rsalz@openssl.org>
* Make boolean SSL test conf values case-insensitiveEmilia Kasper2016-07-222-4/+4
| | | | | | | Undo review mistake: I changed the wrong strcmp in a previous pull request. Add test. Reviewed-by: Rich Salz <rsalz@openssl.org>