Commit Graph

17 Commits

Author SHA1 Message Date
Warner Losh
4d65a7c695 usr.sbin: Automated cleanup of cdefs and other formatting
Apply the following automated changes to try to eliminate
no-longer-needed sys/cdefs.h includes as well as now-empty
blank lines in a row.

Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/
Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/
Remove /\n+#if.*\n#endif.*\n+/
Remove /^#if.*\n#endif.*\n/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/

Sponsored by:		Netflix
2023-11-26 22:24:01 -07:00
Warner Losh
fa9896e082 Remove $FreeBSD$: two-line nroff pattern
Remove /^\.\\"\n\.\\"\s*\$FreeBSD\$$\n/
2023-08-16 11:55:10 -06:00
Warner Losh
d0b2dbfa0e Remove $FreeBSD$: one-line sh pattern
Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
2023-08-16 11:55:03 -06:00
Warner Losh
1d386b48a5 Remove $FreeBSD$: one-line .c pattern
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
2023-08-16 11:54:42 -06:00
Rick Macklem
88ea962879 rpc.tls[serv|clnt]d.c: Clean up code for OpenSSL3
There were several function calls that are deprecated for
OpenSSL1.1.1.  These have been removed.
There was also a function call deprecated for OpenSSL3 and
that one has been #ifdef'd on OPENSSL_VERSION_NUMBER.

Reviewed by:	emaste, ngie
Differential Revision:	https://reviews.freebsd.org/D40275
2023-06-01 13:43:00 -07:00
Warner Losh
4d846d260e spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD
The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch
up to that fact and revert to their recommended match of BSD-2-Clause.

Discussed with:		pfg
MFC After:		3 days
Sponsored by:		Netflix
2023-05-12 10:44:03 -06:00
Vladimir Kotal
9630e237ab report full error string on SSL_connect() failure
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/575
2023-02-27 16:07:30 -07:00
Rick Macklem
3fe0cb6695 rpc.tlsclntd: Check for a tls syscall failure.
Although the tls syscall to set up the upcall should
not normally fail, the daemon should check for such
a failure.  This patch adds a check for that failure.

MFC after:	1 week
2022-12-21 15:12:06 -08:00
Rick Macklem
7652321b79 rpc.tlsclntd.8: Fix the RFC number now that it exists
The RFC for this finally got published and, therefore,
now has a number.  This patch puts this RFC number
in the man page.

This is a content change.

MFC after:	1 week
2022-09-23 16:59:29 -07:00
Rick Macklem
b387a075d9 rpc.tlsclntd: Add the -2 option to the usage line
Commit 72bf76d6b8 added the -2 option to use
TLS 1.2 NFS-over-TLS mounts.  It did not add -2
to the usage message.

This patch adds -2 to the usage message.

MFC after:	2 weeks
2022-05-22 14:41:20 -07:00
Rick Macklem
915fc1afe5 rpc.tlsclntd: Add the -2 option to the man page
Since the KTLS now supports TLS1.3, the daemons default
to version 1.3, since the draft (to be an RFC someday)
requires TLS1.3.

However, since FreeBSD 13,0, 13,1 uses TLS1.2 for
NFS-over-TLS, the "-2" option is added to both daemons
for compatibility with FreeBSD 13.0, 13.1.

This patch updates the man pages for this.

This is a content change.

Reviewed by:	pauamma_gundo.com
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D35290
2022-05-22 14:20:14 -07:00
Rick Macklem
0bf3f379e1 rpc.tlsclntd: Update the man page for the -C option
Commit f5b40aa0de modifies the -C command line option
for rpc.tlsclntd to use the TLS 1.3 SSL_CTX_set_ciphersuites().

This patch updates the man page for this modified command
line option.

This is a content change.

Reviewed by:	jhb, pauamma_gundo.com (same change for rpc.tlsservd.8)
MFC after:	2 weeks
2022-05-22 13:58:59 -07:00
Rick Macklem
f5b40aa0de rpc.tlsclntd: Modify the -C option to use SSL_CTX_set_ciphersuites
Commit 0b4f2ab0e9 fixes the krpc so that it can use TLS
version 1.3 for NFS-over-TLS, as required by
the draft (someday to be an RFC).
This patch replaces SSL_CTX_set_cipher_list() with
SSL_CTX_set_ciphersuites(), since that is the function
that is used for TLS1.3.

The man page will be updated in a separate commit.

MFC after: 	2 weeks
2022-05-22 13:49:08 -07:00
Rick Macklem
72bf76d6b8 rpc.tlsclntd: Add an option to force use of TLS version 1.2
Commit 0b4f2ab0e9 fixes the krpc so that it can use TLS
version 1.3 for NFS-over-TLS, as required by
the draft (someday to be an RFC).
Since FreeBSD 13.0, 13.1 use TLS version 1.2 for
NFS-over-TLS mounts, this command line option
may be used so that NFS-over-TLS mounts to 13.0, 13.1
servers will still work.

Without the command line option, NFS-over-TLS mounts
will use TLS version 1.3.

The man page update will be a separate commit.

MFC after: 	2 weeks
2022-05-20 14:57:42 -07:00
Rick Macklem
15881823b9 rpc.tlsclntd, rpc.tlsservd: Fix getopt_long argument
The "C" option in the argument to getopt_long() was
missing a ":" for both rpc.tlsclntd.c and rpc.tlsservd.c.
This patch fixes this.

MFC after:	2 weeks
2022-05-05 16:22:12 -07:00
John Baldwin
c7bb0f47f7 nfs tls: Update for SSL_OP_ENABLE_KTLS.
Upstream OpenSSL (and the KTLS backport) have switched to an opt-in
option (SSL_OP_ENABLE_KTLS) in place of opt-out modes
(SSL_MODE_NO_KTLS_TX and SSL_MODE_NO_KTLS_RX) for controlling kernel
TLS.

Reviewed by:	rmacklem
Sponsored by:	Netflix
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D31445
2021-08-10 14:18:43 -07:00
Rick Macklem
b9cbc85d72 nfs-over-tls: add user space daemons rpc.tlsclntd and rpc.tlsservd
The kernel changes needed for nfs-over-tls have been committed to main.
However, nfs-over-tls requires user space daemons to handle the
TLS handshake and other non-application data TLS records.
There is one daemon (rpc.tlsclntd) for the client side and one daemon
(rpc.tlsservd) for the server side, although they share a fair amount
of code found in rpc.tlscommon.c and rpc.tlscommon.h.
They use a KTLS enabled OpenSSL to perform the actual work and, as such,
are only built when MK_OPENSSL_KTLS is set.
Communication with the kernel is done via upcall RPCs done on AF_LOCAL
sockets and the custom system call rpctls_syscall.

Reviewed by:	gbe (man pages only), jhb (usr.sbin/Makefile only)
Comments by:	jhb
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D28430
Relnotes:	yes
2021-02-18 14:15:03 -08:00