]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
bugfixes and minor updates
authorNikos Mavrogiannopoulos <nmav@gnutls.org>
Mon, 20 Aug 2001 21:40:19 +0000 (21:40 +0000)
committerNikos Mavrogiannopoulos <nmav@gnutls.org>
Mon, 20 Aug 2001 21:40:19 +0000 (21:40 +0000)
lib/auth_rsa.c
lib/gnutls.h.in
lib/gnutls_int.h
lib/gnutls_record.c
src/cli.c
src/serv.c

index d92ee1d22ae0fb62a85f38b75d44483547671840..c366873e1fcf8454316939eeb5dc9c89d1ab79e9 100644 (file)
@@ -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;
index 7eca6b9bef7f6c8bd021216c22df155d7adb81c0..004824d5c36ea998d4df179aeb4ee959b126c037 100644 (file)
@@ -20,6 +20,8 @@
 
 #define LIBGNUTLS_VERSION "@VERSION@"
 
+#include <sys/types.h>
+
 #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;
 
index 7966766aff49f88eb6e8356d16ee0b51e415f9f0..0c3c962b6306b7aef468c6e33aeb12cdd314ed37 100644 (file)
@@ -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,
index 626189767f5aa8685f1b96e03616828a00a4f09a..14103e984e755fbcf82822f984751bda33b5f82f 100644 (file)
@@ -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);
 
index 4ec0cd998c19aab0a51fe2cd1b74ca6dd73af6cc..8735b7caa0bde7e661a85fb3ccf4f737e41ebce6 100644 (file)
--- 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);
index 7fb20e81e25a1ce3643b2b8df0174f25249cfdbe..f009c9f7fca588eb59c9114a5bc1c3dad4dfdfa6 100644 (file)
@@ -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);