diff options
author | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2014-09-29 16:00:16 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2014-10-08 14:22:17 +0200 |
commit | 2b85e5bd1dabf1be2807df0c11292201ff72fd4b (patch) | |
tree | 507dbe9de0d7bea88ce5a523ed631825a5a1d869 | |
parent | 105b694ef48402f5285eda3f95e2e64e3571610e (diff) | |
download | gnutls-2b85e5bd1dabf1be2807df0c11292201ff72fd4b.tar.gz |
tests: check whether the extended master secret is negotiated by default
-rw-r--r-- | tests/mini-x509.c | 12 | ||||
-rw-r--r-- | tests/resume.c | 6 |
2 files changed, 18 insertions, 0 deletions
diff --git a/tests/mini-x509.c b/tests/mini-x509.c index c4240fdb7c..ba578f145a 100644 --- a/tests/mini-x509.c +++ b/tests/mini-x509.c @@ -250,6 +250,18 @@ void doit(void) } } + ret = gnutls_session_ext_master_secret_status(client); + if (ret != 1) { + fprintf(stderr, "Extended master secret wasn't negotiated by default (client ret: %d)\n", ret); + exit(1); + } + + ret = gnutls_session_ext_master_secret_status(server); + if (ret != 1) { + fprintf(stderr, "Extended master secret wasn't negotiated by default (server ret: %d)\n", ret); + exit(1); + } + gnutls_bye(client, GNUTLS_SHUT_RDWR); gnutls_bye(server, GNUTLS_SHUT_RDWR); diff --git a/tests/resume.c b/tests/resume.c index 3579e88681..05f1361e31 100644 --- a/tests/resume.c +++ b/tests/resume.c @@ -159,6 +159,12 @@ static void client(int sds[], struct params_res *params) } if (t == 0) { /* the first time we connect */ + /* check whether using NO_EXTENSIONS had any effect */ + ret = gnutls_session_ext_master_secret_status(session); + if (ret != 0) { + fail("Extended master secret should have not been negotiated by default (ret: %d)\n", ret); + } + /* get the session data size */ ret = gnutls_session_get_data2(session, |