aboutsummaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)AuthorFilesLines
2016-08-05Move the building of test/buildtest_*. to be done unconditionallyRichard Levitte2-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>
2016-08-05VMS: Fix building of bad_dtls_testRichard Levitte2-3/+3
Reviewed-by: Tim Hudson <tjh@openssl.org>
2016-08-04Add basic test for Cisco DTLS1_BAD_VER and record replay handlingDavid Woodhouse3-1/+662
Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
2016-08-0280-test_ssl_new.t: only skip on $no_tls if no other skip conditions definedRichard Levitte1-1/+1
Reviewed-by: Matt Caswell <matt@openssl.org>
2016-08-02In 80-test_ssl_new, more "plan tests" to a more useful positionRichard Levitte1-4/+4
Reviewed-by: Matt Caswell <matt@openssl.org>
2016-08-02Fix tests for no-nextprotonegMatt Caswell3-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>
2016-08-01Fix various no-*s.Ben Laurie5-1/+26
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-07-31test/smcont.txt: trigger assertion in bio_enc.c.Andy Polyakov1-1/+1
Reviewed-by: Stephen Henson <steve@openssl.org>
2016-07-30Fix bogus warningsMatt Caswell1-1/+1
Fix some bogus "may be used uninitialized" warnings on some compilers. Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-07-29Simplify and rename SSL_set_rbio() and SSL_set_wbio()Matt Caswell2-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>
2016-07-29Add some SSL BIO testsMatt Caswell1-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>
2016-07-29Add a test for SSL_set_bio()Matt Caswell1-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>
2016-07-25Fix no-tls1_2Matt Caswell3-4/+5
Misc fixes impacting no-tls1_2. Also fixes no-dtls1_2. Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-07-25Fix no-dtls*Matt Caswell1-5/+4
Also fixes some other options like no-dgram and no-sock. Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-07-25Fix no-ctMatt Caswell1-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>
2016-07-22SSL tests: compress generated output a littleEmilia Kasper8-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>
2016-07-22Make boolean SSL test conf values case-insensitiveEmilia Kasper2-4/+4
Undo review mistake: I changed the wrong strcmp in a previous pull request. Add test. Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-07-21Test client-side resumptionEmilia Kasper9-13/+1352
Add tests for resuming with a different client version. This happens in reality when clients persist sessions on disk through upgrades. Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-07-20SSL test framework: port resumption testsEmilia Kasper20-85/+1330
Systematically test every server-side version downgrade or upgrade. Client version upgrade or downgrade could be tested analogously but will be done in a later change. Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
2016-07-20Fix a few if(, for(, while( inside code.FdaSilvaYY2-2/+2
Fix some indentation at the same time Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1292)
2016-07-20Use more X509_REQ_get0_pubkey & X509_get0_pubkeyFdaSilvaYY1-4/+4
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1284)
2016-07-19Fix building with no-cmsMatt Caswell1-1/+5
The new fuzzing code broke no-cms Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-07-19SSL test framework: port NPN and ALPN testsEmilia Kasper16-118/+1399
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-07-19Add more session testsMatt Caswell2-28/+194
Add some more tests for sessions following on from the previous commit to ensure the callbacks are called when appropriate. Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-07-18Use _NO_INST in some build.info filesRichard Levitte1-2/+2
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-07-18Fix client auth test_ssl_new failures when enabling/disabling protocolsMatt Caswell1-0/+1
If configuring for anything other than the default TLS protocols then test failures were occuring. Reviewed-by: Emilia Käsper <emilia@openssl.org>
2016-07-18Fix SSLv3 ClientAuth alert checkingMatt Caswell2-1/+8
In TLS during ClientAuth if the CA is not recognised you should get an UnknownCA alert. In SSLv3 this does not exist and you should get a BadCertificate alert. Reviewed-by: Emilia Käsper <emilia@openssl.org>
2016-07-18Fix Client Auth testsMatt Caswell2-41/+81
The Client Auth tests were not correctly setting the Protocol, so that this aspect had no effect. It was testing the same thing lots of times for TLSv1.2 every time. Reviewed-by: Emilia Käsper <emilia@openssl.org>
2016-07-15check return values for EVP_Digest*() APIsDr. Stephen Henson8-79/+151
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-07-12Perform DANE-EE(3) name checks by defaultViktor Dukhovni2-50/+103
In light of potential UKS (unknown key share) attacks on some applications, primarily browsers, despite RFC761, name checks are by default applied with DANE-EE(3) TLSA records. Applications for which UKS is not a problem can optionally disable DANE-EE(3) name checks via the new SSL_CTX_dane_set_flags() and friends. Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-07-11Extend mkcert.sh to support nameConstraints generation and more complexDr. Stephen Henson37-3/+1039
subject alternate names. Add nameConstraints tests incluing DNS, IP and email tests both in subject alt name extension and subject name. Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-07-08Platform sanity testRich Salz5-25/+72
Replace nptest with sanity test. Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-07-08include/openssl: don't include <windows.h> in public headers.Andy Polyakov2-0/+8
If application uses any of Windows-specific interfaces, make it application developer's respondibility to include <windows.h>. Rationale is that <windows.h> is quite "toxic" and is sensitive to inclusion order (most notably in relation to <winsock2.h>). It's only natural to give complete control to the application developer. Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
2016-07-01Use the SSL_METHODs passed to create_ssl_ctx_pair()Matt Caswell1-2/+2
Don't use hardcoded SSL_METHODs! Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-07-01Simplify INCLUDE statements in build.info filesRichard Levitte1-67/+65
Now that INCLUDE considers both the source and build trees, no need for the rel2abs perl fragment hacks any more. Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-07-01Re-add x509 and crl fuzzerKurt Roeckx1-1/+1
Reviewed-by: Rich Salz <rsalz@openssl.org> GH: #1276
2016-07-01Run the fuzzing corpora as tests.Ben Laurie2-1/+53
Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-06-30Fix hmac test case 6Kurt Cancemi1-2/+2
Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1267)
2016-06-29Whitespace cleanup in appsFdaSilvaYY2-3/+3
Reviewed-by: Andy Polyakov <appro@openssl.org> Reviewed-by: Kurt Roeckx <kurt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1264)
2016-06-29SpellingFdaSilvaYY1-1/+1
Reviewed-by: Andy Polyakov <appro@openssl.org> Reviewed-by: Kurt Roeckx <kurt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1264)
2016-06-28SSL test framework: port SNI testsEmilia Kasper12-61/+441
Observe that the old tests were partly ill-defined: setting sn_server1 but not sn_server2 in ssltest_old.c does not enable the SNI callback. Fix this, and also explicitly test both flavours of SNI mismatch (ignore / fatal alert). Tests still pass. Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-06-27Add a test for fragmented alertsMatt Caswell1-1/+61
The previous commit fixed a problem where fragmented alerts would cause an infinite loop. This commit adds a test for these fragmented alerts. Reviewed-by: Andy Polyakov <appro@openssl.org>
2016-06-24Add a getter to obtain the HMAC_CTX mdMatt Caswell1-0/+15
As a result of opaque HMAC_CTX apps need a getter for the HMAC_CTX md. GitHub Issue #1152 Reviewed-by: Tim Hudson <tjh@openssl.org>
2016-06-23RT2867: des_ede3_cfb1 ignored "size in bits" flagRich Salz1-0/+19
Code and tests by Steve. Reviewed-by: Dr. Stephen Henson <steve@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-06-23Drop extraneous printf argument in mkcert.shViktor Dukhovni1-1/+1
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-06-22Fix generation of expired CA certificate.Dr. Stephen Henson2-2/+4
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-06-22OpenSSL::Test: Fix directory calculations in __cwd()Richard Levitte1-1/+6
The previous fix contained a mistake, where any absolute path in %directories would be cleared away instead of just being left alone. Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-06-22crypto/cryptlib.c: omit OPENSSL_ia32cap_loc().Andy Polyakov2-26/+0
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-06-21OpenSSL::Test: Fix directory calculations in __cwd()Richard Levitte1-8/+18
We recalculate the location of the directories we keep track of. However, we did so after having moved to the new directory already, so the data we did the calculations from were possibly not quite correct. This change moves the calculations to happen before moving to the new directory. This issue is sporadic, and possibly dependent on the platform. Reviewed-by: Matt Caswell <matt@openssl.org>
2016-06-20Add verification of proxy certs to 25-test_verify.tRichard Levitte1-1/+23
Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Stephen Henson <steve@openssl.org>