From nobody Fri May 06 21:04:59 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 0341D1ACC4F2; Fri, 6 May 2022 21:05:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Kw33v6gKbz3hRK; Fri, 6 May 2022 21:04:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1651871099; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oK2/o1PXjTecpSbv1j7jqfXfgBmQviaLIkN66uVQZ90=; b=nQ7TzdZo6Ra/+eGYwTPSN9BgfZSCZblugdkqWILeucf1c4pH5czVMmvYMMj6wK2Ltqd9+L KvB0v7bqWQWMRy6cHJDPOh+eNPn8II5244YrDeVYOTZTRqGhw2cEOZ7TbDwSLTjbkm6DUH B+l/IyXLFBxTUDYMCSWOQhoIs83c1JBVi23ulUjf4dgc0u9BD3kmWHVfTrZImXrYsdbHXD QsWzRhWmYMHnN1JWh/rjok55JSsX3N/JAA+5uelf9rULvMcYDHufUEkblQYfXXTNLy0Q9K xXIfHLs8oJYbWA43UNHbgvq/mZKnFxEpk8CgfPt31iTx1FOkV9RhnVGQ6mxNdg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C0C5B231CF; Fri, 6 May 2022 21:04:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 246L4x96083907; Fri, 6 May 2022 21:04:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 246L4xOE083906; Fri, 6 May 2022 21:04:59 GMT (envelope-from git) Date: Fri, 6 May 2022 21:04:59 GMT Message-Id: <202205062104.246L4xOE083906@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem Subject: git: d71c9f14682f - main - rpc.tlsservd: Add logging of TLS version and cipher used List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d71c9f14682fee73f3694426fb47e66aab721835 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1651871099; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oK2/o1PXjTecpSbv1j7jqfXfgBmQviaLIkN66uVQZ90=; b=Y06AkZKJvlOAyyVnoeXqxZwWU5VVLohXx6Fk62WOAGCkS9WccZmx42grra4Dg5uxJ2DWI3 BS4dU6DwiF1qYviubp4SK0vH/kNqZ9pTOiRQCHU823fpgQf6VXzVgvXvHDiOsh8jXXVfHG k9ooGgvNC8Wp6mTtxFLIh0b76gMos3b4ZpdIgeNsXWTq9Z6Q55z+UAE6Ae7DprsDZXXDmZ DFdXM2LhU/yDeq49pJB0/imIAlTbAYi67t7GoFW71Ou1X6ij1nYWmIRq4W9LzKm1Q+mfQs GP7PoH5d/MkKdlNE0oVWrqRfJX2cCAFrQSqj+uGn+im9cc7ZewlcygWKtZRFbA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1651871099; a=rsa-sha256; cv=none; b=p+yb3XmOidseSoy+wuGA4lB+AMDjmhp1xzoZKae4sKAroysftzZStdLAVoST4K8eUi7Xa7 /uaYtIfuqyQRmlDs6vnie8kMprd865UkWEcjKH+ZPowFDJYXMrTdLOHXZJoxWX2+DFfNXg KJrofLIU0lWZxz0NEWUMCZSWpKszP3Do23pa3yGG3hkkS3J3K5bj0KqFS9ywpj3QUQS9Ki OJtJ2u18upFbKwFyp/oFUr14m48M29pA8PtQJ3s28EISvD5jw8s7efIE/TgkmTo7S5Zhhv S77JBNEKMUxtMw5zdT0A6nD6U0RYHTFnsLT0wHUu2FDIyCbJyXWAUR6X7saC3A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=d71c9f14682fee73f3694426fb47e66aab721835 commit d71c9f14682fee73f3694426fb47e66aab721835 Author: Rick Macklem AuthorDate: 2022-05-06 21:03:43 +0000 Commit: Rick Macklem CommitDate: 2022-05-06 21:03:43 +0000 rpc.tlsservd: Add logging of TLS version and cipher used This patch adds logging of the version of TLS and cipher negotiated successfully by the TLS handshake for each client, if the "-v" command line option has been specified. This information may be useful for monitoring and debugging NFS-over-TLS mounts. MFC after: 2 weeks --- usr.sbin/rpc.tlsservd/rpc.tlsservd.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/usr.sbin/rpc.tlsservd/rpc.tlsservd.c b/usr.sbin/rpc.tlsservd/rpc.tlsservd.c index e6cfbe6faf88..ca0d329078aa 100644 --- a/usr.sbin/rpc.tlsservd/rpc.tlsservd.c +++ b/usr.sbin/rpc.tlsservd/rpc.tlsservd.c @@ -687,13 +687,23 @@ rpctls_server(SSL_CTX *ctx, int s, uint32_t *flags, uint32_t *uidp, return (NULL); } *flags |= RPCTLS_FLAGS_HANDSHAKE; + if (rpctls_verbose) { + gethostret = rpctls_gethost(s, sad, hostnam, sizeof(hostnam)); + if (gethostret == 0) + hostnam[0] = '\0'; + rpctls_verbose_out("rpctls_server: SSL handshake ok for host %s" + " <%s %s>\n", hostnam, SSL_get_version(ssl), + SSL_get_cipher(ssl)); + } if (rpctls_do_mutual) { cert = SSL_get_peer_certificate(ssl); if (cert != NULL) { - gethostret = rpctls_gethost(s, sad, hostnam, - sizeof(hostnam)); - if (gethostret == 0) - hostnam[0] = '\0'; + if (!rpctls_verbose) { + gethostret = rpctls_gethost(s, sad, hostnam, + sizeof(hostnam)); + if (gethostret == 0) + hostnam[0] = '\0'; + } cp2 = X509_NAME_oneline( X509_get_subject_name(cert), NULL, 0); *flags |= RPCTLS_FLAGS_GOTCERT;