}
static bool
-openssl_iostream_has_broken_client_cert(struct ssl_iostream *ssl_io)
+openssl_iostream_has_client_cert(struct ssl_iostream *ssl_io)
{
- return ssl_io->cert_received && ssl_io->cert_broken;
+ return ssl_io->cert_received;
}
static bool
.is_handshaked = openssl_iostream_is_handshaked,
.has_handshake_failed = openssl_iostream_has_handshake_failed,
.has_valid_client_cert = openssl_iostream_has_valid_client_cert,
- .has_broken_client_cert = openssl_iostream_has_broken_client_cert,
+ .has_client_cert = openssl_iostream_has_client_cert,
.cert_match_name = openssl_iostream_cert_match_name,
.get_allow_invalid_cert = openssl_iostream_get_allow_invalid_cert,
.get_peer_username = openssl_iostream_get_peer_username,
bool (*is_handshaked)(const struct ssl_iostream *ssl_io);
bool (*has_handshake_failed)(const struct ssl_iostream *ssl_io);
bool (*has_valid_client_cert)(const struct ssl_iostream *ssl_io);
- bool (*has_broken_client_cert)(struct ssl_iostream *ssl_io);
+ bool (*has_client_cert)(struct ssl_iostream *ssl_io);
bool (*cert_match_name)(struct ssl_iostream *ssl_io, const char *name,
const char **reason_r);
bool (*get_allow_invalid_cert)(struct ssl_iostream *ssl_io);
return ssl_vfuncs->has_valid_client_cert(ssl_io);
}
-bool ssl_iostream_has_broken_client_cert(struct ssl_iostream *ssl_io)
+bool ssl_iostream_has_client_cert(struct ssl_iostream *ssl_io)
{
- return ssl_vfuncs->has_broken_client_cert(ssl_io);
+ return ssl_vfuncs->has_client_cert(ssl_io);
}
bool ssl_iostream_cert_match_name(struct ssl_iostream *ssl_io, const char *name,
const char *reason;
if (!ssl_iostream_has_valid_client_cert(ssl_io)) {
- if (!ssl_iostream_has_broken_client_cert(ssl_io))
+ if (!ssl_iostream_has_client_cert(ssl_io))
*error_r = "SSL certificate not received";
else {
*error_r = t_strdup(ssl_iostream_get_last_error(ssl_io));
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_broken_client_cert(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
default in handshake, unless handshake callback is set with
ssl_iostream_check_cert_validity().
*human_reason_r = "cert required, client didn't start TLS";
return TRUE;
}
- if (ssl_iostream_has_broken_client_cert(client->ssl_iostream)) {
- *event_reason_r = "client_ssl_cert_untrusted";
- *human_reason_r = "client sent an untrusted cert";
+ if (!ssl_iostream_has_client_cert(client->ssl_iostream)) {
+ *event_reason_r = "client_ssl_cert_missing";
+ *human_reason_r = "client didn't send a cert";
return TRUE;
}
if (!ssl_iostream_has_valid_client_cert(client->ssl_iostream)) {
- *event_reason_r = "client_ssl_cert_missing";
- *human_reason_r = "client didn't send a cert";
+ *event_reason_r = "client_ssl_cert_untrusted";
+ *human_reason_r = "client sent an untrusted cert";
return TRUE;
}
}