]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
When an application calls gnutls_server_name_set() with a name of zero size disable...
authorNikos Mavrogiannopoulos <nmav@redhat.com>
Thu, 26 Mar 2015 10:04:37 +0000 (11:04 +0100)
committerNikos Mavrogiannopoulos <nmav@redhat.com>
Thu, 26 Mar 2015 10:05:03 +0000 (11:05 +0100)
Resolves #2

lib/ext/server_name.c

index 43550688c9c8f70bdfde9a7852fd31a50b76fd2c..f661231b9347b1695d0d8673c22ce5d73db5e06e 100644 (file)
@@ -400,6 +400,11 @@ gnutls_server_name_set(gnutls_session_t session,
                goto cleanup;
        }
 
+       if (name_length == 0) { /* unset extension */
+               _gnutls_ext_unset_session_data(session, GNUTLS_EXTENSION_SERVER_NAME);
+               return 0;
+       }
+
        ret =
            _gnutls_ext_get_session_data(session,
                                         GNUTLS_EXTENSION_SERVER_NAME,