}
static const char *
-openssl_iostream_get_peer_name(struct ssl_iostream *ssl_io)
+openssl_iostream_get_peer_username(struct ssl_iostream *ssl_io)
{
X509 *x509;
char *name;
.has_valid_client_cert = openssl_iostream_has_valid_client_cert,
.has_broken_client_cert = openssl_iostream_has_broken_client_cert,
.cert_match_name = openssl_iostream_cert_match_name,
- .get_peer_name = openssl_iostream_get_peer_name,
+ .get_peer_username = openssl_iostream_get_peer_username,
.get_server_name = openssl_iostream_get_server_name,
.get_compression = openssl_iostream_get_compression,
.get_security_string = openssl_iostream_get_security_string,
bool (*has_broken_client_cert)(struct ssl_iostream *ssl_io);
bool (*cert_match_name)(struct ssl_iostream *ssl_io, const char *name,
const char **reason_r);
- const char *(*get_peer_name)(struct ssl_iostream *ssl_io);
+ const char *(*get_peer_username)(struct ssl_iostream *ssl_io);
const char *(*get_server_name)(struct ssl_iostream *ssl_io);
const char *(*get_compression)(struct ssl_iostream *ssl_io);
const char *(*get_security_string)(struct ssl_iostream *ssl_io);
return 0;
}
-const char *ssl_iostream_get_peer_name(struct ssl_iostream *ssl_io)
+const char *ssl_iostream_get_peer_username(struct ssl_iostream *ssl_io)
{
- return ssl_vfuncs->get_peer_name(ssl_io);
+ return ssl_vfuncs->get_peer_username(ssl_io);
}
const char *ssl_iostream_get_server_name(struct ssl_iostream *ssl_io)
will always return FALSE before even checking the hostname. */
bool ssl_iostream_cert_match_name(struct ssl_iostream *ssl_io, const char *name,
const char **reason_r);
-/* Returns name of the peer if available, NULL if not. Usually used to retrieve
- username from certificate. */
-const char *ssl_iostream_get_peer_name(struct ssl_iostream *ssl_io);
+/* Returns username from the received certificate of the peer (client) if
+ available, NULL if not. The username is based on cert_username_field
+ setting. */
+const char *ssl_iostream_get_peer_username(struct ssl_iostream *ssl_io);
/* Returns used compression, if any. Returns NULL if not available. */
const char *ssl_iostream_get_compression(struct ssl_iostream *ssl_io);
/* Returns TLS extension server_name(0) requested by client, or NULL if not
}
/* get peer name */
- const char *username = ssl_iostream_get_peer_name(client->ssl_iostream);
+ const char *username = ssl_iostream_get_peer_username(client->ssl_iostream);
/* if we wanted peer name, but it was not there, fail */
if (client->set->auth_ssl_username_from_cert &&