return ssl_io->state;
}
-static bool
-openssl_iostream_has_handshake_failed(const struct ssl_iostream *ssl_io)
-{
- return ssl_io->handshake_failed;
-}
-
static bool
openssl_iostream_has_valid_client_cert(const struct ssl_iostream *ssl_io)
{
.set_log_prefix = openssl_iostream_set_log_prefix,
.get_state = openssl_iostream_get_state,
- .has_handshake_failed = openssl_iostream_has_handshake_failed,
.has_valid_client_cert = openssl_iostream_has_valid_client_cert,
.has_client_cert = openssl_iostream_has_client_cert,
.cert_match_name = openssl_iostream_cert_match_name,
return ssl_iostream_get_state(ssl_io) == SSL_IOSTREAM_STATE_OK;
}
-bool ssl_iostream_has_handshake_failed(const struct ssl_iostream *ssl_io)
-{
- return ssl_vfuncs->has_handshake_failed(ssl_io);
-}
-
bool ssl_iostream_has_valid_client_cert(const struct ssl_iostream *ssl_io)
{
return ssl_vfuncs->has_valid_client_cert(ssl_io);
/* Returns TRUE if SSL iostream handshake is finished and certificate is valid.
This is the same as state being SSL_IOSTREAM_STATE_OK. */
bool ssl_iostream_is_handshaked(const struct ssl_iostream *ssl_io);
-/* Returns TRUE if the remote cert is invalid, or handshake callback returned
- failure. */
-bool ssl_iostream_has_handshake_failed(const struct ssl_iostream *ssl_io);
bool ssl_iostream_has_valid_client_cert(const struct ssl_iostream *ssl_io);
bool ssl_iostream_has_client_cert(struct ssl_iostream *ssl_io);
/* Checks certificate validity based, also performs name checking. Called by
if (client->failed || server->failed)
ret = -1;
- if (ssl_iostream_has_handshake_failed(client->iostream)) {
+ if (ssl_iostream_get_state(client->iostream) != SSL_IOSTREAM_STATE_OK &&
+ ssl_iostream_get_state(client->iostream) != SSL_IOSTREAM_STATE_HANDSHAKING) {
i_error("client: %s", ssl_iostream_get_last_error(client->iostream));
ret = -1;
- } else if (ssl_iostream_has_handshake_failed(server->iostream)) {
+ } else if (ssl_iostream_get_state(server->iostream) != SSL_IOSTREAM_STATE_OK &&
+ ssl_iostream_get_state(server->iostream) != SSL_IOSTREAM_STATE_HANDSHAKING) {
i_error("server: %s", ssl_iostream_get_last_error(server->iostream));
ret = -1;
/* check hostname */