summaryrefslogtreecommitdiff
path: root/lib/auth.c
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@redhat.com>2018-05-14 09:01:59 +0200
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2018-05-26 04:12:04 +0000
commitb14624d4ff71ba3d3bf3d1c95da02ab3c059a03d (patch)
tree754104f681f1367fc3fa6f3552e9548abc161cb3 /lib/auth.c
parent4b5678716f506d46da8dabdd343b268a5b9dd9b4 (diff)
downloadgnutls-b14624d4ff71ba3d3bf3d1c95da02ab3c059a03d.tar.gz
gnutls_auth_get_type: simplified
Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
Diffstat (limited to 'lib/auth.c')
-rw-r--r--lib/auth.c20
1 files changed, 4 insertions, 16 deletions
diff --git a/lib/auth.c b/lib/auth.c
index e4cc3f9f31..1ee2d72476 100644
--- a/lib/auth.c
+++ b/lib/auth.c
@@ -198,22 +198,10 @@ gnutls_credentials_get(gnutls_session_t session,
**/
gnutls_credentials_type_t gnutls_auth_get_type(gnutls_session_t session)
{
-/* This is not the credentials we must set, but the authentication data
- * we get by the peer, so it should be reversed.
- */
- gnutls_kx_algorithm_t kx;
- int server =
- session->security_parameters.entity == GNUTLS_SERVER ? 0 : 1;
-
- if (!session->security_parameters.cs) {
- gnutls_assert();
- return 0;
- }
-
- kx = gnutls_kx_get(session);
-
- return
- _gnutls_map_kx_get_cred(kx, server);
+ if (session->security_parameters.entity == GNUTLS_SERVER)
+ return gnutls_auth_client_get_type(session);
+ else
+ return gnutls_auth_server_get_type(session);
}
/**