]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
serv, cli: ensure that invalid flag is always set
authorDaiki Ueno <ueno@gnu.org>
Wed, 12 Aug 2020 05:29:30 +0000 (07:29 +0200)
committerDaiki Ueno <ueno@gnu.org>
Wed, 12 Aug 2020 05:31:56 +0000 (07:31 +0200)
According to the documentation, the GNUTLS_CERT_INVALID flag must
always be set in case of verification failure, together with the flag
indicating the actual error cause.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
src/common.c

index 753481741bbf973b9d75c42932956e0eebb9a718..2dc54d09bf625007a7bf4f3ad47fd2b5fb853626 100644 (file)
@@ -282,8 +282,11 @@ int cert_verify(gnutls_session_t session, const char *hostname, const char *purp
 
        gnutls_free(out.data);
 
-       if (status)
+       if (status) {
+               if (!(status & GNUTLS_CERT_INVALID))
+                       abort();
                return 0;
+       }
 
        return 1;
 }