aboutsummaryrefslogtreecommitdiffstats
path: root/test/danetest.c
Commit message (Collapse)AuthorAgeFilesLines
* 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-101-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>