9front - general discussion about 9front
 help / color / mirror / Atom feed
From: Joel Fridolin Meyer <sirjofri@googlemail.com>
To: 9front@9front.org
Subject: patch smtp: ignore unrecognized certificates
Date: Sun, 19 Jul 2020 11:43:37 +0200	[thread overview]
Message-ID: <CAF5U_z0x8AGHiKhGR1v-7Kzk5NDTHX=j==Ef4_8J6e7Qkazs8g@mail.gmail.com> (raw)
In-Reply-To: <aee5c8d2-ef2b-4ef2-8594-e6786cbd6e2e@sirjofri.de>

[-- Attachment #1: Type: text/plain, Size: 1533 bytes --]

(This is a duplicate mail, because I'm not sure if the original mail from
my mail server is delivered correctly.)

Hello devs,

this patch adds a new flag -c to upas/smtp command ( smtp(8) ). This flag
removes the need to manually add thumbprints for tls certificates to
/sys/lib/tls/smtp, ignoring unrecognized certificates.

Thumbprints for unrecognized certificates will still be printed to
/sys/log/smtp, the message will still be sent.

If you want to add this to 9front, I'll be happily adjust the usage message
as well as the man page.

diff -r f8f63e944375 sys/src/cmd/upas/smtp/smtp.c
--- a/sys/src/cmd/upas/smtp/smtp.c  Fri Jul 17 16:53:20 2020 +0200
+++ b/sys/src/cmd/upas/smtp/smtp.c  Sun Jul 19 11:00:15 2020 +0200
@@ -46,6 +46,7 @@
int  quitting; /* when error occurs in quit */
int  tryauth;  /* Try to authenticate, if supported */
int  trysecure;  /* Try to use TLS if the other side supports it */
+int nocertcheck; /* ignore unrecognized certs. Still logged */

char *quitrv;  /* deferred return value when in quit */
char ddomain[1024];  /* domain name of destination machine */
@@ -185,6 +186,9 @@
case 'u':
user = EARGF(usage());
break;
+ case 'c':
+   nocertcheck = 1;
+   break;
default:
usage();
break;
@@ -420,7 +424,9 @@
}
if (!okCertificate(c->cert, c->certlen, goodcerts)) {
syslog(0, "smtp", "cert for %s not recognized: %r", ddomain);
-   goto Out;
+   if (!nocertcheck)
+     goto Out;
+   syslog(0, "smtp", "ignoring unrecognized cert");
}
syslog(0, "smtp", "started TLS to %q", ddomain);
err = nil;

[-- Attachment #2: Type: text/html, Size: 2036 bytes --]

       reply	other threads:[~2020-07-19  9:43 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <aee5c8d2-ef2b-4ef2-8594-e6786cbd6e2e@sirjofri.de>
2020-07-19  9:43 ` Joel Fridolin Meyer [this message]
2020-07-20 14:05   ` [9front] " ori
2020-07-20 14:20     ` hiro
2020-07-20 14:26       ` ori
2020-07-20 14:46         ` tlaronde
2020-07-20 14:52           ` ori
2020-07-20 15:05             ` tlaronde
2020-07-20 15:09               ` ori
2020-07-20 15:32                 ` hiro
2020-07-21  6:55           ` cinap_lenrek
2020-07-20 16:18     ` cinap_lenrek
2020-07-20 17:16       ` Joel Fridolin Meyer
2020-07-20 22:00       ` Steffen Nurpmeso
2020-07-20 22:05         ` ori
2020-07-20 22:19           ` Kurt H Maier
2020-07-21 13:02             ` Steffen Nurpmeso
2020-07-20 22:07         ` ori
2020-07-21 13:46           ` Steffen Nurpmeso
2020-07-29  7:32             ` sirjofri+ml-9front
2020-07-29  8:04               ` hiro
2020-08-01 10:01               ` cinap_lenrek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAF5U_z0x8AGHiKhGR1v-7Kzk5NDTHX=j==Ef4_8J6e7Qkazs8g@mail.gmail.com' \
    --to=sirjofri@googlemail.com \
    --cc=9front@9front.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).