From 83943951c6dae4d61bee97fa2d88811fa942a010 Mon Sep 17 00:00:00 2001 From: Nikos Mavrogiannopoulos Date: Sat, 3 Jan 2004 09:07:44 +0000 Subject: Updated gnutls-cli's SRP behaviour. Some other fixes. --- lib/x509/compat.h | 2 -- lib/x509/rfc2818_hostname.c | 1 - src/cli.c | 14 +++++++++++++- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/lib/x509/compat.h b/lib/x509/compat.h index 2e27dd2fb9..4e9a0f5e13 100644 --- a/lib/x509/compat.h +++ b/lib/x509/compat.h @@ -1,4 +1,2 @@ -#include - time_t _gnutls_x509_get_raw_crt_activation_time( const gnutls_datum*); time_t _gnutls_x509_get_raw_crt_expiration_time( const gnutls_datum*); diff --git a/lib/x509/rfc2818_hostname.c b/lib/x509/rfc2818_hostname.c index 4cc66cf0ac..d07b113e9c 100644 --- a/lib/x509/rfc2818_hostname.c +++ b/lib/x509/rfc2818_hostname.c @@ -26,7 +26,6 @@ #include #include #include -#include #include #include diff --git a/src/cli.c b/src/cli.c index d4a676c894..db98a7dc27 100644 --- a/src/cli.c +++ b/src/cli.c @@ -685,7 +685,19 @@ static int srp_username_callback( gnutls_session session, unsigned int times, *password = gnutls_strdup( srp_passwd); return 0; - } + } else + /* At the first time return username and password, if + * the kx_priority[0] is an SRP method. + */ + if (times == 0 && (kx_priority[0] == GNUTLS_KX_SRP || + kx_priority[0] == GNUTLS_KX_SRP_RSA || + kx_priority[0] == GNUTLS_KX_SRP_DSS)) { + + *username = gnutls_strdup( srp_username); + *password = gnutls_strdup( srp_passwd); + + return 0; + } return -1; } -- cgit v1.2.1