From: Nikos Mavrogiannopoulos Date: Mon, 20 Aug 2001 21:40:19 +0000 (+0000) Subject: bugfixes and minor updates X-Git-Tag: gnutls_0_2_2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c2001e02c2146ebee6f06b876f7af4d12ddc06ec;p=thirdparty%2Fgnutls.git bugfixes and minor updates --- diff --git a/lib/auth_rsa.c b/lib/auth_rsa.c index d92ee1d22a..c366873e1f 100644 --- a/lib/auth_rsa.c +++ b/lib/auth_rsa.c @@ -789,7 +789,8 @@ int gen_rsa_client_cert_vrfy(GNUTLS_STATE state, opaque ** data) /* If our certificate supports signing */ - if ( apr_cert_list[0].keyUsage != 0) + if ( apr_cert_list != NULL) + if ( apr_cert_list[0].keyUsage != 0) if ( !(apr_cert_list[0].keyUsage & X509KEY_DIGITAL_SIGNATURE)) { gnutls_assert(); return GNUTLS_E_X509_KEY_USAGE_VIOLATION; diff --git a/lib/gnutls.h.in b/lib/gnutls.h.in index 7eca6b9bef..004824d5c3 100644 --- a/lib/gnutls.h.in +++ b/lib/gnutls.h.in @@ -20,6 +20,8 @@ #define LIBGNUTLS_VERSION "@VERSION@" +#include + #define GNUTLS_AES GNUTLS_RIJNDAEL typedef enum BulkCipherAlgorithm { GNUTLS_NULL_CIPHER=1, GNUTLS_ARCFOUR, GNUTLS_3DES_CBC, GNUTLS_RIJNDAEL_CBC, GNUTLS_TWOFISH_CBC, GNUTLS_RIJNDAEL256_CBC } BulkCipherAlgorithm; @@ -43,7 +45,7 @@ typedef enum AlertDescription { GNUTLS_CLOSE_NOTIFY, GNUTLS_UNEXPECTED_MESSAGE=1 typedef enum CertificateStatus { GNUTLS_CERT_TRUSTED=1, GNUTLS_CERT_NOT_TRUSTED, GNUTLS_CERT_EXPIRED, GNUTLS_CERT_INVALID } CertificateStatus; typedef enum CertificateRequest { GNUTLS_CERT_REQUEST=1, GNUTLS_CERT_REQUIRE } CertificateRequest; -typedef enum CloseRequest { GNUTLS_SHUT_WR=0, GNUTLS_SHUT_W=1 } CloseRequest; +typedef enum CloseRequest { GNUTLS_SHUT_RDWR=0, GNUTLS_SHUT_WR=1 } CloseRequest; typedef enum GNUTLS_Version { GNUTLS_SSL3=1, GNUTLS_TLS1 } GNUTLS_Version; diff --git a/lib/gnutls_int.h b/lib/gnutls_int.h index 7966766aff..0c3c962b63 100644 --- a/lib/gnutls_int.h +++ b/lib/gnutls_int.h @@ -92,7 +92,7 @@ typedef enum AlertDescription { GNUTLS_CLOSE_NOTIFY, GNUTLS_UNEXPECTED_MESSAGE=1 } AlertDescription; typedef enum CertificateStatus { GNUTLS_CERT_TRUSTED=1, GNUTLS_CERT_NOT_TRUSTED, GNUTLS_CERT_EXPIRED, GNUTLS_CERT_INVALID } CertificateStatus; typedef enum CertificateRequest { GNUTLS_CERT_REQUEST=1, GNUTLS_CERT_REQUIRE } CertificateRequest; -typedef enum CloseRequest { GNUTLS_SHUT_WR=0, GNUTLS_SHUT_W=1 } CloseRequest; +typedef enum CloseRequest { GNUTLS_SHUT_RDWR=0, GNUTLS_SHUT_WR=1 } CloseRequest; typedef enum HandshakeType { GNUTLS_HELLO_REQUEST, GNUTLS_CLIENT_HELLO, GNUTLS_SERVER_HELLO, GNUTLS_CERTIFICATE=11, GNUTLS_SERVER_KEY_EXCHANGE, diff --git a/lib/gnutls_record.c b/lib/gnutls_record.c index 626189767f..14103e984e 100644 --- a/lib/gnutls_record.c +++ b/lib/gnutls_record.c @@ -363,13 +363,13 @@ int gnutls_send_alert(SOCKET cd, GNUTLS_STATE state, AlertLevel level, AlertDesc * * Terminates the current TLS/SSL connection. The connection should * have been initiated using gnutls_handshake(). - * 'how' should be one of GNUTLS_SHUT_WR, GNUTLS_SHUT_W. + * 'how' should be one of GNUTLS_SHUT_RDWR, GNUTLS_SHUT_WR. * - * in case of GNUTLS_SHUT_WR then the connection gets terminated and + * in case of GNUTLS_SHUT_RDWR then the connection gets terminated and * further receives and sends will be disallowed. If the return * value is zero you may continue using the TCP connection. * - * in case of GNUTLS_SHUT_W then the connection gets terminated and + * in case of GNUTLS_SHUT_WR then the connection gets terminated and * further sends will be disallowed. In order to reuse the TCP connection * you should wait for an EOF from the peer. * @@ -380,7 +380,7 @@ int gnutls_bye(SOCKET cd, GNUTLS_STATE state, CloseRequest how) ret = gnutls_send_alert(cd, state, GNUTLS_WARNING, GNUTLS_CLOSE_NOTIFY); - if ( how == GNUTLS_SHUT_WR && ret == 0) { + if ( how == GNUTLS_SHUT_RDWR && ret == 0) { ret2 = gnutls_recv_int(cd, state, GNUTLS_ALERT, -1, NULL, 0, 0); state->gnutls_internals.may_read = 1; } @@ -748,7 +748,7 @@ ssize_t gnutls_recv_int(SOCKET cd, GNUTLS_STATE state, ContentType type, Handsha * not call close(). */ if (type != GNUTLS_ALERT) - gnutls_bye( cd, state, GNUTLS_SHUT_W); + gnutls_bye( cd, state, GNUTLS_SHUT_WR); gnutls_free(tmpdata); diff --git a/src/cli.c b/src/cli.c index 4ec0cd998c..8735b7caa0 100644 --- a/src/cli.c +++ b/src/cli.c @@ -211,7 +211,7 @@ int main(int argc, char** argv) print_info( state); printf("- Disconnecting\n"); - gnutls_bye(sd, state, GNUTLS_SHUT_WR); + gnutls_bye(sd, state, GNUTLS_SHUT_RDWR); shutdown( sd, SHUT_WR); close(sd); gnutls_deinit( state); @@ -320,7 +320,7 @@ int main(int argc, char** argv) if (FD_ISSET(fileno(stdin), &rset)) { if( fgets(buffer, MAX_BUF, stdin) == NULL) { - gnutls_bye(sd, state, GNUTLS_SHUT_W); + gnutls_bye(sd, state, GNUTLS_SHUT_WR); user_term = 1; continue; } @@ -329,7 +329,7 @@ int main(int argc, char** argv) } } - if (user_term!=0) gnutls_bye(sd, state, GNUTLS_SHUT_WR); + if (user_term!=0) gnutls_bye(sd, state, GNUTLS_SHUT_RDWR); shutdown( sd, SHUT_RDWR); /* no more receptions */ close(sd); diff --git a/src/serv.c b/src/serv.c index 7fb20e81e2..f009c9f7fc 100644 --- a/src/serv.c +++ b/src/serv.c @@ -457,7 +457,7 @@ int main(int argc, char **argv) } } printf("\n"); - gnutls_bye(sd, state, 1); /* do not wait for + gnutls_bye(sd, state, GNUTLS_SHUT_WR); /* do not wait for * the peer to close the connection. */ close(sd);