summaryrefslogtreecommitdiffstats
path: root/test/danetest.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Use "" not <> for internal/ includesRich Salz2017-08-221-2/+2
| | | | | Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4217)
* Remove tests dependence on e_os.hPauli2017-08-181-1/+1
| | | | | | | | | | | | 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)
* [Win] Fix some test method signatures ...FdaSilvaYY2017-08-161-1/+1
| | | | | | | | 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)
* Update the test framework so that the need for test_main is removed. EverythingPauli2017-07-261-11/+6
| | | | | | | | | | | | | | | | | | | | that needed test_main now works using the same infrastructure as tests that used register_tests. This meant: * renaming register_tests to setup_tests and giving it a success/failure return. * renaming the init_test function to setup_test_framework. * renaming the finish_test function to pulldown_test_framework. * adding a user provided global_init function that runs before the test frame work is initialised. It returns a failure indication that stops the stest. * adding helper functions that permit tests to access their command line args. * spliting the BIO initialisation and finalisation out from the test setup and teardown. * hiding some of the now test internal functions. * fix the comments in testutil.h Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3953)
* Fix some issues raise by coverity in the tests.Pauli2017-07-131-0/+2
| | | | | Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3846)
* Convert danetest, ssl_test_ctx_testRich Salz2017-05-021-176/+105
| | | | | Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3256)
* Fix some -Wshadow warningsBenjamin Kaduk2017-03-141-2/+2
| | | | | | | Found using various (old-ish) versions of gcc. Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2940)
* Perform DANE-EE(3) name checks by defaultViktor Dukhovni2016-07-121-1/+5
| | | | | | | | | | 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>
* Add checks on CRYPTO_set_ex_data return valueFdaSilvaYY2016-05-231-3/+5
| | | | | | | Fix possible leak in danetest.c Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
* Copyright consolidation 02/10Rich Salz2016-05-171-46/+6
| | | | Reviewed-by: Richard Levitte <levitte@openssl.org>
* Use OPENSSL_hexchar2intRich Salz2016-05-161-8/+5
| | | | Reviewed-by: Richard Levitte <levitte@openssl.org>
* Fix i2d_X509_AUX, update docs and add testsViktor Dukhovni2016-05-111-3/+2
| | | | | | | When *pp is NULL, don't write garbage, return an unexpected pointer or leak memory on error. Reviewed-by: Dr. Stephen Henson <steve@openssl.org>
* fix tab-space mixed indentationFdaSilvaYY2016-05-091-34/+34
| | | | | | | No code change Reviewed-by: Kurt Roeckx <kurt@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
* test/[dane|evp_]test.c: BIO-fy file I/O.Andy Polyakov2016-04-071-8/+8
| | | | Reviewed-by: Richard Levitte <levitte@openssl.org>
* Make sure to use unsigned char for is*() functionsRichard Levitte2016-02-141-6/+8
| | | | | | | | | | | On some platforms, the implementation is such that a signed char triggers a warning when used with is*() functions. On others, the behavior is outright buggy when presented with a char that happens to get promoted to a negative integer. The safest thing is to cast the char that's used to an unsigned char. Reviewed-by: Andy Polyakov <appro@openssl.org>
* Clean up the tests for auto-init/de-initMatt Caswell2016-02-091-10/+0
| | | | | | Remove the need to explicitly initialise/deinitialise for the tests Reviewed-by: Richard Levitte <levitte@openssl.org>
* Suppress DANE TLSA reflection when verification failsViktor Dukhovni2016-02-081-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As documented both SSL_get0_dane_authority() and SSL_get0_dane_tlsa() are expected to return a negative match depth and nothing else when verification fails. However, this only happened when verification failed during chain construction. Errors in verification of the constructed chain did not have the intended effect on these functions. This commit updates the functions to check for verify_result == X509_V_OK, and no longer erases any accumulated match information when chain construction fails. Sophisticated developers can, with care, use SSL_set_verify_result(ssl, X509_V_OK) to "peek" at TLSA info even when verification fail. They must of course first check and save the real error, and restore the original error as quickly as possible. Hiding by default seems to be the safer interface. Introduced X509_V_ERR_DANE_NO_MATCH code to signal failure to find matching TLSA records. Previously reported via X509_V_ERR_CERT_UNTRUSTED. This also changes the "-brief" output from s_client to include verification results and TLSA match information. Mentioned session resumption in code example in SSL_CTX_dane_enable(3). Also mentioned that depths returned are relative to the verified chain which is now available via SSL_get0_verified_chain(3). Added a few more test-cases to danetest, that exercise the new code. Resolved thread safety issue in use of static buffer in X509_verify_cert_error_string(). Fixed long-stating issue in apps/s_cb.c which always sets verify_error to either X509_V_OK or "chain to long", code elsewhere (e.g. s_time.c), seems to expect the actual error. [ The new chain construction code is expected to correctly generate "chain too long" errors, so at some point we need to drop the work-arounds, once SSL_set_verify_depth() is also fixed to propagate the depth to X509_STORE_CTX reliably. ] Reviewed-by: Rich Salz <rsalz@openssl.org>
* Allocate bio_err before turning on memleak checksViktor Dukhovni2016-02-061-2/+2
| | | | Reviewed-by: Tim Hudson <tjh@openssl.org>
* enable leak checking for danetestDr. Stephen Henson2016-02-051-0/+1
| | | | Reviewed-by: Rich Salz <rsalz@openssl.org>
* If memory debugging enabled return error on leaks.Dr. Stephen Henson2016-02-051-1/+2
| | | | Reviewed-by: Rich Salz <rsalz@openssl.org>
* Remove /* foo.c */ commentsRich Salz2016-01-261-1/+0
| | | | | | | | | | | | This was done by the following find . -name '*.[ch]' | /tmp/pl where /tmp/pl is the following three-line script: print unless $. == 1 && m@/\* .*\.[ch] \*/@; close ARGV if eof; # Close file to reset $. And then some hand-editing of other files. Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
* Enable/disable crypto-mdebug just like other featuresViktor Dukhovni2016-01-111-1/+1
| | | | | | Also always abort() on leak failure. Reviewed-by: Stephen Henson <steve@openssl.org>
* fix shadow warningDr. Stephen Henson2016-01-111-2/+2
| | | | Reviewed-by: Rich Salz <rsalz@openssl.org>
* Fixup actually update danetest.cViktor Dukhovni2016-01-081-2/+1
| | | | Reviewed-by: Rich Salz <rsalz@openssl.org>
* Fix another build break for no-mem-debugRich Salz2016-01-071-0/+2
| | | | Reviewed-by: Richard Levitte <levitte@openssl.org>
* mem functions cleanupRich Salz2016-01-071-24/+21
| | | | | | | | | | | | | | | | | Only two macros CRYPTO_MDEBUG and CRYPTO_MDEBUG_ABORT to control this. If CRYPTO_MDEBUG is not set, #ifdef out the whole debug machinery. (Thanks to Jakob Bohm for the suggestion!) Make the "change wrapper functions" be the only paradigm. Wrote documentation! Format the 'set func' functions so their paramlists are legible. Format some multi-line comments. Remove ability to get/set the "memory debug" functions at runtme. Remove MemCheck_* and CRYPTO_malloc_debug_init macros. Add CRYPTO_mem_debug(int flag) function. Add test/memleaktest. Rename CRYPTO_malloc_init to OPENSSL_malloc_init; remove needless calls. Reviewed-by: Richard Levitte <levitte@openssl.org>
* DANE support for X509_verify_cert()Viktor Dukhovni2016-01-071-0/+543
Reviewed-by: Richard Levitte <levitte@openssl.org>