]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
rsa-psk: Use the correct username datum
authorNicolas Dufresne <nicolas.dufresne@collabora.com>
Fri, 28 Apr 2017 21:17:32 +0000 (17:17 -0400)
committerNikos Mavrogiannopoulos <nmav@redhat.com>
Sat, 6 May 2017 21:07:35 +0000 (23:07 +0200)
In rsa-psk we properly request username for the case the
application uses a callback, but later we use the username
cached in the credentials structure. This will lead to empty
username issues.

Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
lib/auth/rsa_psk.c

index 151e88da7f55145c0ec9ed26bc91ba78d74f5ac0..9d65529cdc7f429f0b99e1c8973c33cbe760b504 100644 (file)
@@ -224,8 +224,8 @@ _gnutls_gen_rsa_psk_client_kx(gnutls_session_t session,
         */
        ret =
            _gnutls_buffer_append_data_prefix(data, 16,
-                                             cred->username.data,
-                                             cred->username.size);
+                                             username.data,
+                                             username.size);
        if (ret < 0) {
                gnutls_assert();
                goto cleanup;