From: Nikos Mavrogiannopoulos Date: Mon, 14 May 2018 07:01:59 +0000 (+0200) Subject: gnutls_auth_get_type: simplified X-Git-Tag: gnutls_3_6_3~113^2~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b14624d4ff71ba3d3bf3d1c95da02ab3c059a03d;p=thirdparty%2Fgnutls.git gnutls_auth_get_type: simplified Signed-off-by: Nikos Mavrogiannopoulos --- 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); } /**