UTF8: Cert namechecks always use a-label
authorJeremy Harris <jgh146exb@wizmail.org>
Wed, 22 Apr 2015 19:26:56 +0000 (20:26 +0100)
committerJeremy Harris <jgh146exb@wizmail.org>
Wed, 22 Apr 2015 19:26:56 +0000 (20:26 +0100)
doc/doc-txt/experimental-spec.txt
src/src/tls-gnu.c
src/src/tls-openssl.c

index f0490b0..d446f6b 100644 (file)
@@ -1299,6 +1299,9 @@ the appendfile transport, will have utf8 name.
 Helo names sent by the smtp transport will have any utf8
 components expanded to a-label form.
 
+Any certificate name checks will be done using the a-label
+form of the name.
+
 Log lines and Received-by: header lines will aquire a "utf8"
 prefix on the protocol element, eg. utf8esmtp.
 
index 6162cfa..6db7e4a 100644 (file)
@@ -1785,7 +1785,12 @@ tls_client_setup_hostname_checks(host_item * host, exim_gnutls_state_st * state,
 {
 if (verify_check_given_host(&ob->tls_verify_cert_hostnames, host) == OK)
   {
-  state->exp_tls_verify_cert_hostnames = host->name;
+  state->exp_tls_verify_cert_hostnames =
+#ifdef EXPERIMENTAL_INTERNATIONAL
+    string_domain_utf8_to_alabel(host->name, NULL);
+#else
+    host->name;
+#endif
   DEBUG(D_tls)
     debug_printf("TLS: server cert verification includes hostname: \"%s\".\n",
                    state->exp_tls_verify_cert_hostnames);
index 65d6089..530266d 100644 (file)
@@ -1725,7 +1725,12 @@ if ((rc = setup_certs(ctx, ob->tls_verify_certificates,
 
 if (verify_check_given_host(&ob->tls_verify_cert_hostnames, host) == OK)
   {
-  cbinfo->verify_cert_hostnames = host->name;
+  cbinfo->verify_cert_hostnames =
+#ifdef EXPERIMENTAL_INTERNATIONAL
+    string_domain_utf8_to_alabel(host->name, NULL);
+#else
+    host->name;
+#endif
   DEBUG(D_tls) debug_printf("Cert hostname to check: \"%s\"\n",
                    cbinfo->verify_cert_hostnames);
   }