summaryrefslogtreecommitdiffstats
path: root/test (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Do not lookup zero-length session IDKazuki Yamaguchi2017-08-251-8/+20
| | | | | | | | | | A condition was removed by commit 1053a6e2281d; presumably it was an unintended change. Restore the previous behavior so the get_session_cb won't be called with zero-length session ID. Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de> (Merged from https://github.com/openssl/openssl/pull/4236)
* Fix no-chacha and no-poly1305Matt Caswell2017-08-251-0/+4
| | | | | Reviewed-by: Tim Hudson <tjh@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4251)
* Don't run a CT specifc test if CT is disabledMatt Caswell2017-08-251-1/+5
| | | | | Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4245)
* Check range of test values using isascii before diving into the fullPauli2017-08-241-4/+9
| | | | | | | | | | range of ctype functions. Revert "Don't try to compare the ctype functions on values > 127" This reverts commit 6ac589081b53a62bff5f0abe62c1c109c419c7a0. Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4225)
* Check for EOF in ASCII conversions.Pauli2017-08-241-0/+6
| | | | | | | | | | | | | | The C standard defines EOF as: ... an integer constant expression, with type int and a negative value... This means a conforming implemenetation could define this as a one of the printable characters. This won't be a problem for ASCII. A specific test case has been added for EOF. Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4240)
* Fix enable-sctpMatt Caswell2017-08-241-0/+1
| | | | | | | Commit b99fe5f4 broke SCTP. This fixes it again. Reviewed-by: Stephen Henson <steve@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4244)
* (Re)move some things from e_os.hRich Salz2017-08-222-6/+1
| | | | | | | | | | | Remove GETPID_IS_MEANINGLESS and osslargused. Move socket-related things to new file internal/sockets.h; this is now only needed by four(!!!) files. Compiles should be a bit faster. Remove USE_SOCKETS ifdef's Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4209)
* Don't try to compare the ctype functions on values > 127Richard Levitte2017-08-221-1/+1
| | | | | | | | Our internal replacement functions return 0 for those values. However, depending on locale, the C RTL functions may return 1. Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4219)
* Don't try to test ctype functions for values < 0 or > 255Richard Levitte2017-08-221-10/+1
| | | | | | | Values that aren't representable as unsigned give undefined results. Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4219)
* Use "" not <> for internal/ includesRich Salz2017-08-2256-62/+58
| | | | | Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4217)
* Fix the lack of isblank() with VMS CRichard Levitte2017-08-221-0/+12
| | | | | Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4216)
* Add random serial# support.Rich Salz2017-08-221-1/+1
| | | | | | | | | | Add -rand_serial to CA command and "serial_rand" config option. Up RAND_BITS to 159, and comment why: now confirms to CABForum guidelines (Ballot 164) as well as IETF RFC 5280 (PKIX). Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4185)
* This has been added to avoid the situation where some host ctype.h functionsPauli2017-08-223-1/+99
| | | | | | | | | | | | | | | | | | return true for characters > 127. I.e. they are allowing extended ASCII characters through which then cause problems. E.g. marking superscript '2' as a number then causes the common (ch - '0') conversion to number to fail miserably. Likewise letters with diacritical marks can also cause problems. If a non-ASCII character set is being used (currently only EBCDIC), it is adjusted for. The implementation uses a single table with a bit for each of the defined classes. These functions accept an int argument and fail for values out of range or for characters outside of the ASCII set. They will work for both signed and unsigned character inputs. Reviewed-by: Andy Polyakov <appro@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4102)
* Fix ctype arguments.Pauli2017-08-214-6/+6
| | | | | | | | Cast arguments to the various ctype functions to unsigned char to match their documentation. Reviewed-by: Andy Polyakov <appro@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4203)
* Add PKEY_CTX setter tests for TLS1-PRFJohannes Bauer2017-08-211-0/+42
| | | | | | | | | PKEY_CTX setters tests were previously present for HKDF and scrypt; this patch also adds tests for the third currently supported KDF, TLS1-PRF. Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4196)
* Remove double error messagesPauli2017-08-211-11/+7
| | | | | Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4204)
* Reorder extensions to put SigAlgs lastTodd Short2017-08-181-1/+1
| | | | | | | | | | | | | Force non-empty padding extension. When enabled, force the padding extension to be at least 1 byte long. WebSphere application server cannot handle having an empty extension (e.g. EMS/EtM) as the last extension in a client hello. This moves the SigAlgs extension last for TLSv1.2 to avoid this issue. Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3921)
* test/asn1_time_test.c: Better check of signed time_tRichard Levitte2017-08-181-2/+15
| | | | | Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4182)
* Fix windows build after too aggressive e_os.h removalPauli2017-08-183-0/+3
| | | | | Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4187)
* Remove tests dependence on e_os.hPauli2017-08-1856-55/+57
| | | | | | | | | | | | Apart from ssltest_old.c, the test suite relied on e_os.h for the OSSL_NELEM macro and nothing else. The ssltest_old.c also requires EXIT and some socket macros. Create a new header to define the OSSL_NELEM macro and use that instead. Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4186)
* Fix OCSP_basic_verify() cert chain construction in case bs->certs is NULLDavid von Oheimb2017-08-163-56/+145
| | | | | | | | | | | Now the certs arg is not any more neglected when building the signer cert chain. Added case to test/recipes/80-test_ocsp.t proving fix for 3-level CA hierarchy. See also http://rt.openssl.org/Ticket/Display.html?id=4620 Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4124)
* [Win] Fix some test method signatures ...FdaSilvaYY2017-08-1618-71/+71
| | | | | | | | to halves MSVC warnings. Reviewed-by: Andy Polyakov <appro@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4172)
* Revert "Add some casts for %j"Rich Salz2017-08-151-6/+4
| | | | | | | This reverts commit c4d2e483a39176a476c56d35879423fe6e33c0cd. Reviewed-by: Ben Kaduk <kaduk@mit.edu> (Merged from https://github.com/openssl/openssl/pull/4160)
* Use new setup_tests in code of rsa_testPaul Yang2017-08-151-1/+2
| | | | | | | | | | Although this piece of code will not be compiled at current stage, but there seems a plan to re-open the 'no-rsa' option in the future so this should be fixed. Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4161)
* File::Glob option ':bsd_glob' doesn't work everywhere, replace w/ a wrapperRichard Levitte2017-08-156-7/+8
| | | | | Reviewed-by: Andy Polyakov <appro@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4069)
* Consolidate the locations where we have our internal perl modulesRichard Levitte2017-08-158-1685/+4
| | | | | | | | Instead of having perl modules under test/testlib, util and util/perl, consolidate them all to be inside util/perl. Reviewed-by: Andy Polyakov <appro@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4069)
* Add some casts for %jRich Salz2017-08-151-4/+6
| | | | | | Reviewed-by: Paul Dale <paul.dale@oracle.com> Reviewed-by: Ben Kaduk <kaduk@mit.edu> (Merged from https://github.com/openssl/openssl/pull/4160)
* Fix some typo and commentsFdaSilvaYY2017-08-125-7/+7
| | | | | | | | [skip ci] Reviewed-by: Andy Polyakov <appro@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4149)
* Wire SHAKE to EVP.Andy Polyakov2017-08-121-0/+57
| | | | | Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4137)
* Add EVP_DigestFinalXOF, interface to extendable-output functions, XOFs.Andy Polyakov2017-08-121-4/+18
| | | | | Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4137)
* Fix some Typos and indentsFdaSilvaYY2017-08-115-5/+5
| | | | | | Reviewed-by: Andy Polyakov <appro@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4108)
* [extended tests] Add steps to update an external test suiteJon Spillett2017-08-111-0/+30
| | | | | | Reviewed-by: Paul Dale <paul.dale@oracle.com> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4139)
* no-ec2m fixesDr. Stephen Henson2017-08-102-3/+4
| | | | | | | | Fix warning and don't use binary field certificate for ECDH CMS key only test. Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4134)
* Add alternative CMS P-256 certDr. Stephen Henson2017-08-102-0/+26
| | | | | Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4134)
* Fix no-ecDr. Stephen Henson2017-08-101-0/+2
| | | | | Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4134)
* Fix minor type warnings and risk of memory leak in testutil/driver.cDavid von Oheimb2017-08-101-2/+3
| | | | | | | | Discussion is in https://github.com/openssl/openssl/issues/4127 Reviewed-by: Andy Polyakov <appro@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4131)
* Fix memory leak in session cache testBenjamin Kaduk2017-08-091-4/+6
| | | | | | | | | | | | When we are using the internal cache we have to make a copy of the session before removing it from the parent context's cache, since we want our copy to still be resumable. However, SSL_CTX_remove_session() just detaches the session from the SSL_CTX; it does not free the session. So, we must call SSL_SESSION_free() ourselves before overwriting the variable that we dup'd from. Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4126)
* Test server side session cachingMatt Caswell2017-08-091-28/+153
| | | | | | | In particular this covers the scenario mentioned in #4014 Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/4072)
* Fix building without scryptJohannes Bauer2017-08-081-0/+4
| | | | | | | | | Building without the scrypt KDF is now possible, the OPENSSL_NO_SCRYPT define is honored in code. Previous this lead to undefined references. Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Stephen Henson <steve@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4116)
* Add test for ECDH CMS key onlyDr. Stephen Henson2017-08-081-0/+9
| | | | | Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4115)
* Add PKEY_METHOD macro testsJohannes Bauer2017-08-083-1/+153
| | | | | | | | | Added the pkey_meth_kdf_test tests which test the PKEY_METHOD macros (at the moment, of HKDF and scrypt). Reviewed-by: Paul Dale <paul.dale@oracle.com> Reviewed-by: Stephen Henson <steve@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4026)
* Add interface to the scrypt KDF by means of PKEY_METHODJohannes Bauer2017-08-081-0/+50
| | | | | | | | | Add an interface that allows accessing the scrypt KDF as a PKEY_METHOD. This fixes #4021 (at least for the scrypt portion of the issue). Reviewed-by: Paul Dale <paul.dale@oracle.com> Reviewed-by: Stephen Henson <steve@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4026)
* Change SETUP_TEST_FIXTURE so that the fixture structure is passed byPauli2017-08-074-11/+45
| | | | | | | reference not by value. This allows an error return from the setup function. Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4083)
* Consolidate to a single asn1_time_from_tm() functionTodd Short2017-08-044-4/+314
| | | | | | | | | | | | | | | | Add missing ASN1_TIME functions Do some cleanup of the ASN1_TIME code. Add ASN1_TIME_normalize() to normalize ASN1_TIME structures. Add ASN1_TIME_compare() to compare two ASN1_TIME structures. Add ASN1_TIME_cmp_time_t() to compare an ASN1_TIME to time_t (generic version of ASN1_UTCTIME_cmp_time_t()). Replace '0' .. '9' compares with isdigit() Reviewed-by: Paul Dale <paul.dale@oracle.com> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2753)
* Test fixtures changed to pointers.Pauli2017-08-033-127/+139
| | | | | | | | | Change the fixture types to pointers to structures that are heap allocated in the tests that use SETUP_TEST_FIXTURE. This will permit error returns from the setup function and allow for future running tests in parallel. Also removed a call of `exit(2)` which allows the remaining tests to run if one fails to initialise. Reviewed-by: Andy Polyakov <appro@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4071)
* recipes/80-test_ca.t: make it work with spaces in pathnames.Andy Polyakov2017-08-031-1/+1
| | | | Reviewed-by: Richard Levitte <levitte@openssl.org>
* Switch from ossl_rand to DRBG randRich Salz2017-08-0310-241/+112
| | | | | | | | | | | | | | | | | | | | | | | | | | | | If RAND_add wraps around, XOR with existing. Add test to drbgtest that does the wrap-around. Re-order seeding and stop after first success. Add RAND_poll_ex() Use the DF and therefore lower RANDOMNESS_NEEDED. Also, for child DRBG's, mix in the address as the personalization bits. Centralize the entropy callbacks, from drbg_lib to rand_lib. (Conceptually, entropy is part of the enclosing application.) Thanks to Dr. Matthias St Pierre for the suggestion. Various code cleanups: -Make state an enum; inline RANDerr calls. -Add RAND_POLL_RETRIES (thanks Pauli for the idea) -Remove most RAND_seed calls from rest of library -Rename DRBG_CTX to RAND_DRBG, etc. -Move some code from drbg_lib to drbg_rand; drbg_lib is now only the implementation of NIST DRBG. -Remove blocklength Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/4019)
* Allow use of long name for KDFsDr. Stephen Henson2017-08-032-1/+14
| | | | | Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/4079)
* Simplify some of the sslapitest code.Pauli2017-08-021-79/+32
| | | | | | | | | Removing the use of SETUP_TEST_FIXTURE reduces complxity in those tests that used it. Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Andy Polyakov <appro@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4066)
* Remove EXECUTE_TEST_NO_TEARDOWN.Pauli2017-08-022-78/+60
| | | | | | | | Simplify the only test that uses this macro so it doesn't need it anymore. Clean up the formatting a little. Reviewed-by: Andy Polyakov <appro@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4034)