X-Git-Url: http://www.project-moonshot.org/gitweb/?a=blobdiff_plain;f=lib%2Fconn.c;h=815784f70ae649f3de2b70d38d5ba2020dfe57a5;hb=214a29955b9c7a8eafc90997ee29f86a284e3a12;hp=90f1e612ebd2e092205cf671efb780f5bf3ae4c4;hpb=046bcd92b3eea69b61a6362e599d75fb912791eb;p=radsecproxy.git diff --git a/lib/conn.c b/lib/conn.c index 90f1e61..815784f 100644 --- a/lib/conn.c +++ b/lib/conn.c @@ -61,6 +61,23 @@ conn_activate_timeout (struct rs_connection *conn) return RSE_OK; } +int +conn_type_tls (const struct rs_connection *conn) +{ + assert (conn->active_peer); + return conn->realm->type == RS_CONN_TYPE_TLS + || conn->realm->type == RS_CONN_TYPE_DTLS; +} + +int +conn_cred_psk (const struct rs_connection *conn) +{ + assert (conn->active_peer); + return conn->active_peer->transport_cred && + conn->active_peer->transport_cred->type == RS_CRED_TLS_PSK; +} + + /* Public functions. */ int rs_conn_create (struct rs_context *ctx,