diff options
author | Benjamin Kaduk <bkaduk@akamai.com> | 2020-10-26 12:20:31 -0700 |
---|---|---|
committer | Benjamin Kaduk <bkaduk@akamai.com> | 2020-11-02 11:28:24 -0800 |
commit | e7a8fecd0b1138b156bee71d92372abda956f1a8 (patch) | |
tree | 0bebf1ee3d300d7e288e8e3f61b96d755e42cfbd /test | |
parent | 467dc325243d7fcbd74cc30a223ea5741f1f9473 (diff) |
Add more diagnostics to ossl_shim
We had several cases where the connection failed but we did not
have an error message to differentiate which failure condition had
been triggered. Add some more messages to help clarify what is
going wrong.
[extended tests]
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/13251)
Diffstat (limited to 'test')
-rw-r--r-- | test/ossl_shim/ossl_shim.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/ossl_shim/ossl_shim.cc b/test/ossl_shim/ossl_shim.cc index 1d32073f84..380e6853c6 100644 --- a/test/ossl_shim/ossl_shim.cc +++ b/test/ossl_shim/ossl_shim.cc @@ -1085,6 +1085,7 @@ static bool DoExchange(bssl::UniquePtr<SSL_SESSION> *out_session, } while (config->async && RetryAsync(ssl.get(), ret)); if (ret != 1 || !CheckHandshakeProperties(ssl.get(), is_resume)) { + fprintf(stderr, "resumption check failed\n"); return false; } @@ -1105,6 +1106,7 @@ static bool DoExchange(bssl::UniquePtr<SSL_SESSION> *out_session, return false; } if (WriteAll(ssl.get(), result.data(), result.size()) < 0) { + fprintf(stderr, "writing exported key material failed\n"); return false; } } @@ -1135,6 +1137,7 @@ static bool DoExchange(bssl::UniquePtr<SSL_SESSION> *out_session, if (config->shim_writes_first) { if (WriteAll(ssl.get(), reinterpret_cast<const uint8_t *>("hello"), 5) < 0) { + fprintf(stderr, "shim_writes_first write failed\n"); return false; } } @@ -1160,6 +1163,7 @@ static bool DoExchange(bssl::UniquePtr<SSL_SESSION> *out_session, fprintf(stderr, "Invalid SSL_get_error output\n"); return false; } + fprintf(stderr, "Unexpected entry in error queue\n"); return false; } // Successfully read data. @@ -1179,6 +1183,7 @@ static bool DoExchange(bssl::UniquePtr<SSL_SESSION> *out_session, buf[i] ^= 0xff; } if (WriteAll(ssl.get(), buf.get(), n) < 0) { + fprintf(stderr, "write of inverted bitstream failed\n"); return false; } } |