diff options
author | Ander Juaristi <a@juaristi.eus> | 2018-03-22 08:59:56 +0100 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2018-04-06 13:28:55 +0200 |
commit | 921cee23b4c7ee5d4e4537431e7fb1e9411be2d6 (patch) | |
tree | 3b1b423ea33220f41c49d7d5322fd505c4dfb55d /lib/auth/psk.c | |
parent | a046665a384a728253ad94122dfcbd25a52478c2 (diff) | |
download | gnutls-921cee23b4c7ee5d4e4537431e7fb1e9411be2d6.tar.gz |
Added support for out-of-band Pre-shared keys under TLS1.3
That adds support for pre-shared keys with and without Diffie-Hellman
key exchange. That's a modified version of initial Ander's patch.
Resolves #414
Resolves #125
Signed-off-by: Ander Juaristi <a@juaristi.eus>
Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.org>
Diffstat (limited to 'lib/auth/psk.c')
-rw-r--r-- | lib/auth/psk.c | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/lib/auth/psk.c b/lib/auth/psk.c index e9bb701f33..a2e7d9d9ea 100644 --- a/lib/auth/psk.c +++ b/lib/auth/psk.c @@ -111,40 +111,6 @@ _gnutls_set_psk_session_key(gnutls_session_t session, return ret; } -/* returns the username and they key for the PSK session. - * Free is non (0) if they have to be freed. - */ -int _gnutls_find_psk_key(gnutls_session_t session, - gnutls_psk_client_credentials_t cred, - gnutls_datum_t * username, gnutls_datum_t * key, - int *free) -{ - char *user_p; - int ret; - - *free = 0; - - if (cred->username.data != NULL && cred->key.data != NULL) { - username->data = cred->username.data; - username->size = cred->username.size; - key->data = cred->key.data; - key->size = cred->key.size; - } else if (cred->get_function != NULL) { - ret = cred->get_function(session, &user_p, key); - if (ret) - return gnutls_assert_val(ret); - - username->data = (uint8_t *) user_p; - username->size = strlen(user_p); - - *free = 1; - } else - return - gnutls_assert_val(GNUTLS_E_INSUFFICIENT_CREDENTIALS); - - return 0; -} - /* Generates the PSK client key exchange * |