summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDaiki Ueno <dueno@redhat.com>2020-03-27 09:53:38 +0100
committerDaiki Ueno <dueno@redhat.com>2020-04-21 16:56:42 +0200
commit5bba569b44b85b5aa126c1c56a549c9575856a9f (patch)
tree8b9f85fd64e8845f6766acacfcef1857717ba88c /tests
parent6e2e00257ac495d46ebe67e59fc48b67f8701fb3 (diff)
downloadgnutls-5bba569b44b85b5aa126c1c56a549c9575856a9f.tar.gz
gnutls_session_ext_register: keep track of extension nametmp-ext-name
Previously it discarded the name argument, and that was making the debug output awkward, e.g., running tests/tls-session-ext-register -v: client|<4>| EXT[0x9cdc20]: Preparing extension ((null)/242) for 'client hello' client|<4>| EXT[0x9cdc20]: Preparing extension ((null)/241) for 'client hello' client|<4>| EXT[0x9cdc20]: Sending extension (null)/241 (2 bytes) Signed-off-by: Daiki Ueno <dueno@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/tls-session-ext-register.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/tls-session-ext-register.c b/tests/tls-session-ext-register.c
index 7e907f5e96..6e44b9e60e 100644
--- a/tests/tls-session-ext-register.c
+++ b/tests/tls-session-ext-register.c
@@ -152,6 +152,7 @@ static void client(int sd, const char *name, const char *prio, unsigned flags, u
int ret;
gnutls_session_t session;
gnutls_certificate_credentials_t clientx509cred;
+ const char *ext_name;
void *p;
side = "client";
@@ -179,6 +180,14 @@ static void client(int sd, const char *name, const char *prio, unsigned flags, u
if (ret < 0)
myfail("client: register extension\n");
+ ext_name = gnutls_ext_get_name2(session, TLSEXT_TYPE_IGN, GNUTLS_EXT_ANY);
+ if (ext_name == NULL || strcmp(ext_name, "ext_ign"))
+ myfail("client: retrieve name of extension %u\n", TLSEXT_TYPE_IGN);
+
+ ext_name = gnutls_ext_get_name2(session, TLSEXT_TYPE_IGN, GNUTLS_EXT_APPLICATION);
+ if (ext_name)
+ myfail("client: retrieve name of extension %u (expected none)\n", TLSEXT_TYPE_IGN);
+
ret = gnutls_session_ext_register(session, "ext_client", TLSEXT_TYPE_SAMPLE, GNUTLS_EXT_TLS, ext_recv_client_params, ext_send_client_params, NULL, NULL, NULL, flags);
if (ret < 0)
myfail("client: register extension\n");