]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
tests: verify the presence of GNUTLS_SFLAGS_RFC7919 flag in server and client mode
authorNikos Mavrogiannopoulos <nmav@redhat.com>
Fri, 18 Aug 2017 09:44:55 +0000 (11:44 +0200)
committerNikos Mavrogiannopoulos <nmav@redhat.com>
Fri, 18 Aug 2017 10:50:49 +0000 (12:50 +0200)
Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
tests/tls12-ffdhe.c

index 4cec9ef1ca87ef6524aea69b8e09b501204171b9..cfedf2701f5c8655d8ee458fcfd308ec45a7d11c 100644 (file)
@@ -150,6 +150,18 @@ static void try(test_case_st *test)
                fail("%s: group doesn't match the expected\n", test->name);
        }
 
+       if (test->group) {
+               if (test->group == GNUTLS_GROUP_FFDHE2048 || test->group == GNUTLS_GROUP_FFDHE3072 ||
+                   test->group == GNUTLS_GROUP_FFDHE4096 || test->group == GNUTLS_GROUP_FFDHE8192) {
+                       if (!(gnutls_session_get_flags(client) & GNUTLS_SFLAGS_RFC7919)) {
+                               fail("%s: gnutls_session_get_flags(client) reports that no RFC7919 negotiation was performed!\n", test->name);
+                       }
+
+                       if (!(gnutls_session_get_flags(server) & GNUTLS_SFLAGS_RFC7919)) {
+                               fail("%s: gnutls_session_get_flags(server) reports that no RFC7919 negotiation was performed!\n", test->name);
+                       }
+               }
+       }
        gnutls_deinit(server);
        gnutls_deinit(client);
        gnutls_anon_free_client_credentials(c_anon_cred);