]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
gnutls_auth_get_type: simplified
authorNikos Mavrogiannopoulos <nmav@redhat.com>
Mon, 14 May 2018 07:01:59 +0000 (09:01 +0200)
committerNikos Mavrogiannopoulos <nmav@gnutls.org>
Sat, 26 May 2018 04:12:04 +0000 (04:12 +0000)
Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
lib/auth.c

index e4cc3f9f31b86b2bccb7d95e57621b19a80838f6..1ee2d7247640b83e270c0cbb4bef2e21e7e1287e 100644 (file)
@@ -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);
 }
 
 /**