-/* $OpenBSD: mta.c,v 1.243 2022/02/18 16:57:36 millert Exp $ */
+/* $OpenBSD: mta.c,v 1.244 2023/05/16 17:48:52 op Exp $ */
/*
* Copyright (c) 2008 Pierre-Yves Ritschard <pyr@openbsd.org>
if (remote->tls_ciphers)
ciphers = remote->tls_ciphers;
if (ciphers && tls_config_set_ciphers(config, ciphers) == -1)
- fatal("%s", tls_config_error(config));
+ fatalx("%s", tls_config_error(config));
if (remote->tls_protocols) {
if (tls_config_parse_protocols(&protos,
remote->tls_protocols) == -1)
- fatal("failed to parse protocols \"%s\"",
+ fatalx("failed to parse protocols \"%s\"",
remote->tls_protocols);
if (tls_config_set_protocols(config, protos) == -1)
- fatal("%s", tls_config_error(config));
+ fatalx("%s", tls_config_error(config));
}
if (remote->pki) {
pki = dict_get(env->sc_pki_dict, remote->pki);
if (pki == NULL)
- fatal("client pki \"%s\" not found ", remote->pki);
+ fatalx("client pki \"%s\" not found", remote->pki);
tls_config_set_dheparams(config, dheparams[pki->pki_dhe]);
tls_config_use_fake_private_key(config);
if (tls_config_set_keypair_mem(config, pki->pki_cert,
pki->pki_cert_len, NULL, 0) == -1)
- fatal("tls_config_set_keypair_mem");
+ fatalx("tls_config_set_keypair_mem: %s",
+ tls_config_error(config));
}
if (remote->ca) {
ca = dict_get(env->sc_ca_dict, remote->ca);
if (tls_config_set_ca_mem(config, ca->ca_cert, ca->ca_cert_len)
== -1)
- fatal("tls_config_set_ca_mem");
+ fatalx("tls_config_set_ca_mem: %s",
+ tls_config_error(config));
}
else if (tls_config_set_ca_file(config, tls_default_ca_cert_file())
== -1)
- fatal("tls_config_set_ca_file");
+ fatalx("tls_config_set_ca_file: %s",
+ tls_config_error(config));
if (remote->tls_verify) {
tls_config_verify(config);
-/* $OpenBSD: smtp.c,v 1.173 2022/02/18 16:57:36 millert Exp $ */
+/* $OpenBSD: smtp.c,v 1.174 2023/05/16 17:48:52 op Exp $ */
/*
* Copyright (c) 2008 Gilles Chehade <gilles@poolp.org>
if (l->tls_ciphers)
ciphers = l->tls_ciphers;
if (ciphers && tls_config_set_ciphers(config, ciphers) == -1)
- fatal("%s", tls_config_error(config));
+ fatalx("%s", tls_config_error(config));
if (l->tls_protocols) {
if (tls_config_parse_protocols(&protos, l->tls_protocols) == -1)
- fatal("failed to parse protocols \"%s\"",
+ fatalx("failed to parse protocols \"%s\"",
l->tls_protocols);
if (tls_config_set_protocols(config, protos) == -1)
- fatal("%s", tls_config_error(config));
+ fatalx("%s", tls_config_error(config));
}
pki = l->pki[0];
fatal("no pki defined");
if (tls_config_set_dheparams(config, dheparams[pki->pki_dhe]) == -1)
- fatal("tls_config_set_dheparams");
+ fatalx("tls_config_set_dheparams: %s",
+ tls_config_error(config));
tls_config_use_fake_private_key(config);
for (i = 0; i < l->pkicount; i++) {
if (i == 0) {
if (tls_config_set_keypair_mem(config, pki->pki_cert,
pki->pki_cert_len, NULL, 0) == -1)
- fatal("tls_config_set_keypair_mem");
+ fatalx("tls_config_set_keypair_mem: %s",
+ tls_config_error(config));
} else {
if (tls_config_add_keypair_mem(config, pki->pki_cert,
pki->pki_cert_len, NULL, 0) == -1)
- fatal("tls_config_add_keypair_mem");
+ fatalx("tls_config_add_keypair_mem: %s",
+ tls_config_error(config));
}
}
free(l->pki);
ca = dict_get(env->sc_ca_dict, l->ca_name);
if (tls_config_set_ca_mem(config, ca->ca_cert, ca->ca_cert_len)
== -1)
- fatal("tls_config_set_ca_mem");
+ fatalx("tls_config_set_ca_mem: %s",
+ tls_config_error(config));
}
else if (tls_config_set_ca_file(config, tls_default_ca_cert_file())
== -1)
if (l->tls == NULL)
fatal("tls_server");
if (tls_configure(l->tls, config) == -1) {
- fatal("tls_configure: %s", tls_error(l->tls));
+ fatalx("tls_configure: %s", tls_error(l->tls));
}
tls_config_free(config);
}
-/* $OpenBSD: smtpc.c,v 1.19 2021/07/14 13:33:57 kn Exp $ */
+/* $OpenBSD: smtpc.c,v 1.20 2023/05/16 17:48:52 op Exp $ */
/*
* Copyright (c) 2018 Eric Faurot <eric@openbsd.org>
if (cafile == NULL)
cafile = tls_default_ca_cert_file();
if (tls_config_set_ca_file(tls_config, cafile) == -1)
- fatal("tls_set_ca_file");
+ fatalx("tls_set_ca_file: %s", tls_config_error(tls_config));
if (!params.tls_verify) {
tls_config_insecure_noverifycert(tls_config);
tls_config_insecure_noverifyname(tls_config);
fatal("tls_client");
if (tls_configure(tls, tls_config) == -1)
- fatal("tls_configure");
+ fatalx("tls_configure: %s", tls_error(tls));
smtp_set_tls(proto, tls);
}