diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2011-05-28 00:00:06 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2011-05-28 00:00:06 +0200 |
commit | f6656624d81c04ffa193257470d96f681e864fec (patch) | |
tree | 6d9ecad391ab4c5732dcaf62355088bf67a5cf81 /lib/auth | |
parent | 911d1b16482cbe53c0c47db7c08c3c2749731c43 (diff) | |
download | gnutls-f6656624d81c04ffa193257470d96f681e864fec.tar.gz |
explicitly request for client key in server side.
Diffstat (limited to 'lib/auth')
-rw-r--r-- | lib/auth/psk.c | 26 |
1 files changed, 6 insertions, 20 deletions
diff --git a/lib/auth/psk.c b/lib/auth/psk.c index a0d4dc4ab6..dbc9526b82 100644 --- a/lib/auth/psk.c +++ b/lib/auth/psk.c @@ -72,24 +72,6 @@ _gnutls_set_psk_session_key (gnutls_session_t session, size_t dh_secret_size; int ret; - if (session->security_parameters.entity == GNUTLS_SERVER) - { /* SERVER side */ - psk_auth_info_t info; - - info = _gnutls_get_auth_info (session); - - /* find the key of this username - */ - ret = _gnutls_psk_pwd_find_entry (session, info->username, &pwd_psk); - if (ret < 0) - { - gnutls_assert (); - return ret; - } - ppsk = &pwd_psk; - } - - if (dh_secret == NULL) dh_secret_size = ppsk->size; else @@ -225,7 +207,7 @@ _gnutls_proc_psk_client_kx (gnutls_session_t session, opaque * data, { ssize_t data_size = _data_size; int ret; - gnutls_datum_t username; + gnutls_datum_t username, psk_key; gnutls_psk_server_credentials_t cred; psk_auth_info_t info; @@ -267,7 +249,11 @@ _gnutls_proc_psk_client_kx (gnutls_session_t session, opaque * data, memcpy (info->username, username.data, username.size); info->username[username.size] = 0; - ret = _gnutls_set_psk_session_key (session, NULL, NULL); + ret = _gnutls_psk_pwd_find_entry(session, info->username, &psk_key); + if (ret < 0) + return gnutls_assert_val(ret); + + ret = _gnutls_set_psk_session_key (session, &psk_key, NULL); if (ret < 0) { gnutls_assert (); |