From nobody Tue May 24 01:03:25 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 AD0FB1B397B1; Tue, 24 May 2022 01:03:25 +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 4L6bY94VLvz3GHf; Tue, 24 May 2022 01:03:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1653354205; 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=O2VaDR5R62faBdUM2+qZ9aNA8mMn9va5t9/Smm1y+sg=; b=X7xY1YL7EW+ikXUeBJCn50rRbD2d5elsEWBwnfI+ViKAVr+CCX4hi4Jx/x0m1kO7aH02kX PKK52kH8ScB2Uyv5iKg1ixAs06qBUDcgxvpEPjntYZfNapuUFfUJsIReuY8/Jz+yAAukfs t5aPVrUQxU+lwi8pxYSqrPY7qe33jeE4KE+vCul1tPzgso93Cp6ac2a+6XnWwvH/HcG4gt /rWHaqFGcbiXR4SUiReYSQEGzTV2QLyrp4LhZKrs3FJugUlnyw64LyMV+5ZP3epEnJTu67 r3hcx27UcnfB9Dd5FJ4Mgb16gWVArUkVnn1zsKo3uKxgb+WS/zHC+dH2bTVRUw== 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 7A9831ABDD; Tue, 24 May 2022 01:03:25 +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 24O13P1w027648; Tue, 24 May 2022 01:03:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 24O13PaR027647; Tue, 24 May 2022 01:03:25 GMT (envelope-from git) Date: Tue, 24 May 2022 01:03:25 GMT Message-Id: <202205240103.24O13PaR027647@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: 74c4cb9cc376 - stable/13 - 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 74c4cb9cc3763b536f3e9843b976b8bc42535512 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1653354205; 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=O2VaDR5R62faBdUM2+qZ9aNA8mMn9va5t9/Smm1y+sg=; b=rrRVUklCDXRCN/8si69zAKuLljk75MaDjkKhGFicWo47TLFQqWTCNtrlawmokK/n9mTMfT vsEOW2B6V6Iz4inWRUVYlgu34tP87iJjxX7FNjMZuWRTkiyM9Sfzte10/p523nZnYrqzGC QVWStqrZJyJlBQPEIPz6h3zvU+PPGLhWHgtNIXMIDIsXW6SoN5+5gTh3y85CEN5jNYvuuz FDME6q+/tdx5AWxyg3kuY8iI4AIg4IsKm+VwwVjBmii/XfsN71I7MeKddlyfnmgm2Rfwm/ dt/KzzhrfyOb25qYWow5rmPytImf5Tnk9vhX0A5rBli97Wk3RQ9PQ0mT1PbkOg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1653354205; a=rsa-sha256; cv=none; b=Q3Fucf7A8ZUvsYH9O6sBgexPT/D6qb1FoJVPrGYvdDXpObJFFS50HOy2JC4Yhgvd88nEMP Kt9jY98iPgNPjRI6IjpspvlclYfLcxiC3TwAncqBlvJssZ1W7AfepCSOJy2rwpAqtNafG6 aWV4Zw9isHroG3xBHMO3rfhCEYyawr7QAyabkI6I+VI9mp4LLi8SruwY4TSfjWZqhX9Kx9 XhZYylZlFnSRn4oHXj3hnikfqRMYOfxJfEJLIr0nwK2aKD84LFGGfYAxHaERRociKoCwN1 8w9QfvEIwrKX78tvVEUvLT2vju5CCaXsQtX9CatlbDGUvA2Az3jsIsPa01at8A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=74c4cb9cc3763b536f3e9843b976b8bc42535512 commit 74c4cb9cc3763b536f3e9843b976b8bc42535512 Author: Rick Macklem AuthorDate: 2022-05-06 21:03:43 +0000 Commit: Rick Macklem CommitDate: 2022-05-24 01:02:18 +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. (cherry picked from commit d71c9f14682fee73f3694426fb47e66aab721835) --- 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 71787b162acd..16dd3e9c2d8b 100644 --- a/usr.sbin/rpc.tlsservd/rpc.tlsservd.c +++ b/usr.sbin/rpc.tlsservd/rpc.tlsservd.c @@ -679,13 +679,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;