diff options
-rw-r--r-- | README | 5 | ||||
-rw-r--r-- | configure.in | 2 | ||||
-rw-r--r-- | doc/API | 3 | ||||
-rw-r--r-- | lib/gnutls.c | 2 | ||||
-rw-r--r-- | lib/gnutls_errors.c | 1 | ||||
-rw-r--r-- | lib/gnutls_errors_int.h | 1 | ||||
-rw-r--r-- | lib/gnutls_handshake.c | 5 | ||||
-rw-r--r-- | src/cli.c | 15 |
8 files changed, 20 insertions, 14 deletions
@@ -1,5 +1,5 @@ This is the GNU TLS library. More up to date information can be found -at http://gnutls.hellug.gr +at http://www.gnu.org/software/gnutls It is a TLS implementation for the GNU project. It is currently under heavy development. (and still not ready for @@ -12,5 +12,6 @@ the needed configure, makefiles etc. using Automake, Autoconf, and libtool. BUGS: -If you find any report it to bug-gnutls@gnu.org +There should be plenty, but if you find any +report it to bug-gnutls@gnu.org diff --git a/configure.in b/configure.in index 116ce35f30..3cb70c80e9 100644 --- a/configure.in +++ b/configure.in @@ -22,7 +22,7 @@ AM_CONFIG_HEADER(config.h) GNUTLS_MOST_RECENT_INTERFACE=$GNUTLS_MINOR_VERSION GNUTLS_CURRENT_INTERFACE_IMPLEMENTATION_NUMBER=$GNUTLS_MICRO_VERSION -GNUTLS_OLDEST_INTERFACE=1 +GNUTLS_OLDEST_INTERFACE=0 AM_PATH_LIBGCRYPT(1.1.2,, AC_MSG_ERROR([[ @@ -87,8 +87,7 @@ ssize_t gnutls_recv(int cd, GNUTLS_STATE state, void* data, int sizeofdata, int difference is that is accepts a GNUTLS state. However the only acceptable flag is currently MSG_DONTWAIT. In that case, if the socket is set to non blocking IO it will return GNUTLS_E_AGAIN, - if there no data in the socket. In some rare cases it may return 0, - thus you may need to call this function again. + if there no data in the socket. ssize_t gnutls_send(int cd, GNUTLS_STATE state, void* data, int sizeofdata, int flags); This function has the same semantics as send() has. The only diff --git a/lib/gnutls.c b/lib/gnutls.c index ef404b966f..10a0cf2dd9 100644 --- a/lib/gnutls.c +++ b/lib/gnutls.c @@ -848,6 +848,8 @@ ssize_t gnutls_recv_int(int cd, GNUTLS_STATE state, ContentType type, char *data /* we may get a hello request */ ret = _gnutls_recv_hello_request( cd, state, tmpdata, tmplen); if (ret < 0) gnutls_assert(); + else /* inform the caller */ + return GNUTLS_E_GOT_HELLO_REQUEST; } else if (recv_type != GNUTLS_APPLICATION_DATA) { gnutls_assert(); diff --git a/lib/gnutls_errors.c b/lib/gnutls_errors.c index f4894efb16..10e3a77869 100644 --- a/lib/gnutls_errors.c +++ b/lib/gnutls_errors.c @@ -70,6 +70,7 @@ static gnutls_error_entry error_algorithms[] = { GNUTLS_ERROR_ENTRY( GNUTLS_E_PARSING_ERROR, 1), GNUTLS_ERROR_ENTRY( GNUTLS_E_AUTH_FAILED, 1), GNUTLS_ERROR_ENTRY( GNUTLS_E_AGAIN, 0), + GNUTLS_ERROR_ENTRY( GNUTLS_E_GOT_HELLO_REQUEST, 0), GNUTLS_ERROR_ENTRY( GNUTLS_E_DB_ERROR, 1), {0} }; diff --git a/lib/gnutls_errors_int.h b/lib/gnutls_errors_int.h index 969df449f6..b4cd6a75ea 100644 --- a/lib/gnutls_errors_int.h +++ b/lib/gnutls_errors_int.h @@ -34,4 +34,5 @@ #define GNUTLS_E_PARSING_ERROR -34 #define GNUTLS_E_MPI_PRINT_FAILED -35 #define GNUTLS_E_AUTH_FAILED -36 +#define GNUTLS_E_GOT_HELLO_REQUEST -37 #define GNUTLS_E_UNIMPLEMENTED_FEATURE -50 diff --git a/lib/gnutls_handshake.c b/lib/gnutls_handshake.c index 8754615561..01db695055 100644 --- a/lib/gnutls_handshake.c +++ b/lib/gnutls_handshake.c @@ -804,10 +804,11 @@ static int _gnutls_read_server_hello( GNUTLS_STATE state, char *data, int datale resumed_security_parameters.client_random, state->security_parameters.client_random, 32); - state->gnutls_internals.resumed = RESUME_TRUE; /* we are resuming */ + state->gnutls_internals.resumed = RESUME_TRUE; /* we are resuming */ + return 0; } else { - /* keep the session id */ + /* keep the new session id */ state->gnutls_internals.resumed = RESUME_FALSE; /* we are not resuming */ state->security_parameters.session_id_size = session_id_len; @@ -218,14 +218,15 @@ int main() } else { if (ret==GNUTLS_E_WARNING_ALERT_RECEIVED || ret==GNUTLS_E_FATAL_ALERT_RECEIVED) printf("* Received alert [%d]\n", gnutls_get_last_alert(state)); - else { - if (ret > 0) { - printf("- Received[%d]: ", ret); - for (ii=0;ii<ret;ii++) { - fputc(buffer[ii], stdout); - } - fputs("\n", stdout); + if (ret==GNUTLS_E_GOT_HELLO_REQUEST) + printf("* Received HelloRequest message\n"); + + if (ret > 0) { + printf("- Received[%d]: ", ret); + for (ii=0;ii<ret;ii++) { + fputc(buffer[ii], stdout); } + fputs("\n", stdout); } } if (user_term!=0) break; |