summaryrefslogtreecommitdiff
path: root/lib/gnutls_auth.c
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2004-05-03 00:43:37 +0000
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2004-05-03 00:43:37 +0000
commit510c7176382df5c29cdbf44e8e71cc93b051823f (patch)
treeae083d911c5b4304be6ad23df3275bad896cbbaf /lib/gnutls_auth.c
parentc1892d31204460533da9883bef39b0fe40f986ed (diff)
downloadgnutls-510c7176382df5c29cdbf44e8e71cc93b051823f.tar.gz
Added gnutls_auth_client_get_type() and gnutls_auth_server_get_type().
Diffstat (limited to 'lib/gnutls_auth.c')
-rw-r--r--lib/gnutls_auth.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/lib/gnutls_auth.c b/lib/gnutls_auth.c
index 60ee3558d1..a3860e0bf4 100644
--- a/lib/gnutls_auth.c
+++ b/lib/gnutls_auth.c
@@ -153,6 +153,39 @@ int server = session->security_parameters.entity==GNUTLS_SERVER?0:1;
&session->security_parameters.current_cipher_suite), server);
}
+/**
+ * gnutls_auth_server_get_type - Returns the type of credentials for the server authentication schema.
+ * @session: is a &gnutls_session structure.
+ *
+ * Returns the type of credentials that were used for server authentication.
+ * The returned information is to be used to distinguish the function used
+ * to access authentication data.
+ *
+ **/
+gnutls_credentials_type gnutls_auth_server_get_type( gnutls_session session)
+{
+ return _gnutls_map_kx_get_cred(
+ _gnutls_cipher_suite_get_kx_algo(
+ &session->security_parameters.current_cipher_suite), 1);
+}
+
+/**
+ * gnutls_auth_client_get_type - Returns the type of credentials for the client authentication schema.
+ * @session: is a &gnutls_session structure.
+ *
+ * Returns the type of credentials that were used for client authentication.
+ * The returned information is to be used to distinguish the function used
+ * to access authentication data.
+ *
+ **/
+gnutls_credentials_type gnutls_auth_client_get_type( gnutls_session session)
+{
+ return _gnutls_map_kx_get_cred(
+ _gnutls_cipher_suite_get_kx_algo(
+ &session->security_parameters.current_cipher_suite), 0);
+}
+
+
/*
* This returns a pointer to the linked list. Don't
* free that!!!