]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
Move call to terminate() until after printing the error message.
authorTim Kosse <tim.kosse@filezilla-project.org>
Fri, 15 Jan 2016 12:48:10 +0000 (13:48 +0100)
committerNikos Mavrogiannopoulos <nmav@redhat.com>
Mon, 30 May 2016 08:15:01 +0000 (10:15 +0200)
tests/sign-md5-rep.c
tests/status-request-ok.c
tests/status-request.c

index 72616dc37db55c86169496fa562625a7cbd3d491..c72d8a11a9ab3ba3a12b34e0863ab33ecbf63a81 100644 (file)
@@ -166,18 +166,16 @@ static void client(int fd)
        }
 
        if (ret < 0) {
-               terminate();
                fail("client: Handshake failed: %s\n", gnutls_strerror(ret));
-               exit(1);
+               terminate();
        } else {
                if (debug)
                        success("client: Handshake was completed\n");
        }
 
        if (gnutls_sign_algorithm_get(session) == GNUTLS_SIGN_RSA_MD5) {
-               terminate();
                fail("client: MD5 was negotiated\n");
-               exit(1);
+               terminate();
        }
        success("client: %s was negotiated\n", gnutls_sign_get_name(gnutls_sign_algorithm_get(session)));
 
@@ -199,9 +197,8 @@ static void client(int fd)
                            ("client: Peer has closed the TLS connection\n");
                goto end;
        } else if (ret < 0) {
-               terminate();
                fail("client: Error: %s\n", gnutls_strerror(ret));
-               exit(1);
+               terminate();
        }
 
        gnutls_bye(session, GNUTLS_SHUT_WR);
index b7d7f4c76e5c70e96d8ec311610d21b870f2c18e..293671dd712490ea86901611cda8c6668226d571 100644 (file)
@@ -180,9 +180,8 @@ static void client(int fd)
        }
 
        if (ret < 0) {
-               terminate();
                fail("client: Handshake failed: %s\n", gnutls_strerror(ret));
-               exit(1);
+               terminate();
        } else {
                if (debug)
                        success("client: Handshake was completed\n");
@@ -194,9 +193,8 @@ static void client(int fd)
                        (gnutls_protocol_get_version(session)));
 
        if (received == 0) {
-               terminate();
                fail("client: didn't receive status request\n");
-               exit(1);
+               terminate();
        }
 
        gnutls_bye(session, GNUTLS_SHUT_WR);
index f0e528cf91317125019b01b1bc19d45b5fd53481..8a4f2691d44d126f715d1721b096fa0b799df8f0 100644 (file)
@@ -174,9 +174,8 @@ static void client(int fd)
        }
 
        if (ret < 0) {
-               terminate();
                fail("client: Handshake failed: %s\n", gnutls_strerror(ret));
-               exit(1);
+               terminate();
        } else {
                if (debug)
                        success("client: Handshake was completed\n");
@@ -200,9 +199,8 @@ static void client(int fd)
                            ("client: Peer has closed the TLS connection\n");
                goto end;
        } else if (ret < 0) {
-               terminate();
                fail("client: Error: %s\n", gnutls_strerror(ret));
-               exit(1);
+               terminate();
        }
 
        gnutls_bye(session, GNUTLS_SHUT_WR);