aboutsummaryrefslogtreecommitdiff
path: root/sbin/setkey
Commit message (Collapse)AuthorAgeFilesLines
* sbin/setkey/setkey.8: cleanup groff mdoc warningsKonstantin Belousov2026-02-121-7/+8
| | | | | | PR: 293072 Sponsored by: NVidia networking MFC after: 3 days
* sbin/setkey: add -Z option to disable receive timeoutsKonstantin Belousov2026-01-271-9/+15
| | | | | Sponsored by: NVidia networking MFC after: 1 week
* setkey(8): document -hwif extensionKonstantin Belousov2024-08-251-1/+6
| | | | Sponsored by: NVidia networking
* setkey(8): add -hwif extension to specify offload interface for SA and SPDKonstantin Belousov2024-07-122-2/+48
| | | | Sponsored by: NVIDIA networking
* setkey(8): add -esn extension option to enable ESNKonstantin Belousov2024-07-123-0/+13
| | | | Sponsored by: NVIDIA networking
* setkey: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0])Elyes Haouas2024-04-291-1/+1
| | | | | Pull Request: https://github.com/freebsd/freebsd-src/pull/888 Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
* setkey(8): Grammar fix: a FQDN -> an FQDNYi-Chen Li2024-02-131-1/+1
| | | | | Event: Advanced UNIX Programming Course (Fall'23) at NTHU. Pull Request: https://github.com/freebsd/freebsd-src/pull/1024
* setkey(8): make the policy specification more readableKonstantin Belousov2023-10-311-7/+37
| | | | | | | by applying markup and highlighting the semantical blocks. Sponsored by: NVidia networking MFC after: 1 week
* Remove $FreeBSD$: two-line nroff patternWarner Losh2023-08-161-2/+0
| | | | Remove /^\.\\"\n\.\\"\s*\$FreeBSD\$$\n/
* Remove $FreeBSD$: one-line sh patternWarner Losh2023-08-164-4/+0
| | | | Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
* Remove $FreeBSD$: one-line .c comment patternWarner Losh2023-08-165-5/+0
| | | | Remove /^/[*/]\s*\$FreeBSD\$.*\n/
* Remove $FreeBSD$: two-line .h patternWarner Losh2023-08-161-2/+0
| | | | Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
* setkey(8): document NAT-T and NAT-T MTU extensions syntaxKonstantin Belousov2023-05-291-2/+17
| | | | | | | | Reviewed by: ae Discussed with: bz Sponsored by: NVidia networking MFC after: 1 week Differential revision: https://reviews.freebsd.org/D40300
* setkey(8): NAT-T manual configuration supportKonstantin Belousov2023-05-292-1/+88
| | | | | | | | | | This is needed for testing of offload capabilities. Reviewed by: ae Discussed with: bz Sponsored by: NVidia networking MFC after: 1 week Differential revision: https://reviews.freebsd.org/D40300
* setkey(8): extract prefixlen calculation info helperKonstantin Belousov2023-05-291-33/+23
| | | | | | | | | | While there, hide AF_INET case under #ifdef INET. Reviewed by: ae Discussed with: bz Sponsored by: NVidia networking MFC after: 1 week Differential revision: https://reviews.freebsd.org/D40300
* Update/fix Makefile.depend for userlandSimon J. Gerraty2023-04-191-3/+0
|
* setkey(8): ansify parserKonstantin Belousov2023-04-032-44/+16
| | | | | Sponsored by: NVidia networking MFC after: 1 week
* setkey(8): remove redundand returnsKonstantin Belousov2023-04-031-4/+0
| | | | | Sponsored by: NVidia networking MFC after: 1 week
* setkey(8): add -e option to take script from the command lineKonstantin Belousov2023-04-032-5/+26
| | | | | | | Reviewed by: ae Sponsored by: Nvidia networking MFC after: 1 week Differential revision: https://reviews.freebsd.org/D39393
* ipsec: add support for CHACHA20POLY1305Kristof Provost2022-11-022-1/+5
| | | | | | | | Based on a patch by ae@. Reviewed by: gbe (man page), pauamma (man page) Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D37180
* setkey.8: Improve direction descriptionsBram Ton2022-09-131-6/+7
| | | | | | | | | | | Be more precise in the definition of policy directions and policy levels. PR: 250177 Reported by: Bram Ton <bram at cbbg dot nl> Reviewed by: gbe, ae MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D26719
* Indicate that racoon.8 is in ports/security/ipsec-tools.Jens Schweikhardt2022-08-141-2/+2
|
* If setkey(8) is used without ipsec.ko loaded beforehand,Eugene Grosbein2022-05-051-0/+15
| | | | | | | | | | | | its attempt to install SA/SPD into the kernel results in cryptic EINVAL error code. Let it be a bit more user-friendly and try to load ipsec.ko automatically if it is not loaded, just like ifconfig(8) does it for modules it needs. PR: 263379 MFC after: 2 weeks
* setkey(8): Clarify language around AEAD ciphers.John Baldwin2022-04-271-26/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | AEAD ciphers for IPsec combine both encryption and authentication. As such, ESP configurations using an AEAD cipher should not use a seperate authentication algorithm via -A. However, this was not apparent from the setkey manpage and 12.x and earlier did not perform sufficient argument validation permitting users to pair an explicit -A such as SHA256-HMAC with AES-GCM. (The result was a non-standard combination of AES-CTR with the specified MAC, but with the wrong initial block counter (and thus different keystream) compared to using AES-CTR as the cipher.) Attempt to clarify this in the manpage by explicitly calling out AEAD ciphers (currently only AES-GCM) and noting that AEAD ciphers should not use -A. While here, explicitly note which authentication algorithms can be used with esp vs esp-old. Also add subsection headings for the different algorithm lists and tidy some language. I did not convert the tables to column lists (Bl -column) though that would probably be more correct than using literal blocks (Bd -literal). PR: 263379 Reviewed by: Pau Amma <pauamma@gundo.com>, markj Differential Revision: https://reviews.freebsd.org/D34947
* update external URLWolfram Schneider2022-02-051-1/+1
|
* setkey: drop an unused argument from postprocMateusz Guzik2021-07-081-3/+3
|
* setkey: fix several warnings popping up when compiling without WARNS=1Mateusz Guzik2021-07-081-12/+12
|
* setkey: ansifyMateusz Guzik2021-07-081-18/+10
|
* Refer to AES-CBC as "aes-cbc" rather than "rijndael-cbc" for IPsec.John Baldwin2020-06-042-3/+4
| | | | | | | | | | | | | | At this point, AES is the more common name for Rijndael128. setkey(8) will still accept the old name, and old constants remain for compatiblity. Reviewed by: cem, bcr (manpages) MFC after: 2 weeks Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D24964 Notes: svn path=/head/; revision=361810
* Add RFC reference for AES-CTR with IPsec.John Baldwin2020-05-041-2/+2
| | | | | | | | MFC after: 1 week Sponsored by: Chelsio Communications Notes: svn path=/head/; revision=360634
* Remove support for IPsec algorithms deprecated in r348205 and r360202.John Baldwin2020-05-024-99/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Examples of depecrated algorithms in manual pages and sample configs are updated where relevant. I removed the one example of combining ESP and AH (vs using a cipher and auth in ESP) as RFC 8221 says this combination is NOT RECOMMENDED. Specifically, this removes support for the following ciphers: - des-cbc - 3des-cbc - blowfish-cbc - cast128-cbc - des-deriv - des-32iv - camellia-cbc This also removes support for the following authentication algorithms: - hmac-md5 - keyed-md5 - keyed-sha1 - hmac-ripemd160 Reviewed by: cem, gnn (older verisons) Relnotes: yes Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D24342 Notes: svn path=/head/; revision=360557
* Remove the link to libl which only contains a stub functionBaptiste Daroussin2020-03-232-2/+2
| | | | | | | | on yywrap, if the flex is told yywrap is not in use, then this linkage becomes unnecessary Notes: svn path=/head/; revision=359241
* Revove useless linking to yaccBaptiste Daroussin2020-03-231-1/+1
| | | | Notes: svn path=/head/; revision=359239
* pkgbase: Create a FreeBSD-utilities package and make it the default oneEmmanuel Vadot2019-09-051-1/+0
| | | | | | | | | | | | | The default package use to be FreeBSD-runtime but it should only contain binaries and libs enough to boot to single user and repair the system, it is also very handy to have a package that can be tranform to a small mfsroot. So create a new package named FreeBSD-utilities and make it the default one. Also move a few binaries and lib into this package when it make sense. Reviewed by: bapt, gjb Differential Revision: https://reviews.freebsd.org/D21506 Notes: svn path=/head/; revision=351858
* General further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-206-6/+18
| | | | | | | | | | | | | | | | | Mainly focus on files that use BSD 3-Clause license. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Special thanks to Wind River for providing access to "The Duke of Highlander" tool: an older (2014) run over FreeBSD tree was useful as a starting point. Notes: svn path=/head/; revision=326025
* DIRDEPS_BUILD: Update dependencies.Bryan Drewery2017-10-311-1/+0
| | | | | | | Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=325188
* Add large replay widow support to setkey(8) and libipsec.Andrey V. Elsukov2017-04-132-2/+31
| | | | | | | | | | | | | | | | | | | | When the replay window size is large than UINT8_MAX, add to the request the SADB_X_EXT_SA_REPLAY extension header that was added in r309144. Also add support of SADB_X_EXT_NAT_T_TYPE, SADB_X_EXT_NAT_T_SPORT, SADB_X_EXT_NAT_T_DPORT, SADB_X_EXT_NAT_T_OAI, SADB_X_EXT_NAT_T_OAR, SADB_X_EXT_SA_REPLAY, SADB_X_EXT_NEW_ADDRESS_SRC, SADB_X_EXT_NEW_ADDRESS_DST extension headers to the key_debug that is used by `setkey -x`. Modify kdebug_sockaddr() to use inet_ntop() for IP addresses formatting. And modify kdebug_sadb_x_policy() to show policy scope and priority. Reviewed by: gnn, Emeric Poupon MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D10375 Notes: svn path=/head/; revision=316759
* Make setkey(8) more clear about anti-replay window size option semantics.Benedict Reuschling2017-04-091-4/+5
| | | | | | | | | | | PR: 172913 Submitted by: john@saltant.com Reviewed by: ae@ MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D10304 Notes: svn path=/head/; revision=316657
* Use unique SPI.Andrey V. Elsukov2017-04-041-1/+1
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=316508
* In the example section show that TCP-MD5 connection needs SA for bothAndrey V. Elsukov2017-04-041-1/+2
| | | | | | | | | | directions. Submitted by: Mike Tancsa <mike at sentex net> MFC after: 1 week Notes: svn path=/head/; revision=316507
* Fix CFLAGS for including netipsec headers #includesEnji Cooper2017-03-131-1/+1
| | | | | | | | | | | | | | | The netipsec headers are referenced via netipsec/..., not ./... . Thus, assuming that the netipsec/... is nested under ${SRCTOP}/sys/netipsec is wrong. This tripped up some individuals building ^/head on systems pre-r314812. MFC after: 1 week Reported by: Roberto Rodriguez Jr <rob.rodz.jr9@gmail.com> Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=315181
* Delete duplicate -I <SRCTOP>/lib/libipsec added in r171135Enji Cooper2017-03-121-1/+1
| | | | | | | | | | | It's already handled earlier on in the Makefile, per the change made in r80029. MFC after: 1 month Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=315094
* Introduce the concept of IPsec security policies scope.Andrey V. Elsukov2017-03-072-22/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently are defined three scopes: global, ifnet, and pcb. Generic security policies that IKE daemon can add via PF_KEY interface or an administrator creates with setkey(8) utility have GLOBAL scope. Such policies can be applied by the kernel to outgoing packets and checked agains inbound packets after IPsec processing. Security policies created by if_ipsec(4) interfaces have IFNET scope. Such policies are applied to packets that are passed through if_ipsec(4) interface. And security policies created by application using setsockopt() IP_IPSEC_POLICY option have PCB scope. Such policies are applied to packets related to specific socket. Currently there is no way to list PCB policies via setkey(8) utility. Modify setkey(8) and libipsec(3) to be able distinguish the scope of security policies in the `setkey -DP` listing. Add two optional flags: '-t' to list only policies related to virtual *tunneling* interfaces, i.e. policies with IFNET scope, and '-g' to list only policies with GLOBAL scope. By default policies from all scopes are listed. To implement this PF_KEY's sadb_x_policy structure was modified. sadb_x_policy_reserved field is used to pass the policy scope from the kernel to userland. SADB_SPDDUMP message extended to support filtering by scope: sadb_msg_satype field is used to specify bit mask of requested scopes. For IFNET policies the sadb_x_policy_priority field of struct sadb_x_policy is used to pass if_ipsec's interface if_index to the userland. For GLOBAL policies sadb_x_policy_priority is used only to manage order of security policies in the SPDB. For IFNET policies it is not used, so it can be used to keep if_index. After this change the output of `setkey -DP` now looks like: # setkey -DPt 0.0.0.0/0[any] 0.0.0.0/0[any] any in ipsec esp/tunnel/87.250.242.144-87.250.242.145/unique:145 spid=7 seq=3 pid=58025 scope=ifnet ifname=ipsec0 refcnt=1 # setkey -DPg ::/0 ::/0 icmp6 135,0 out none spid=5 seq=1 pid=872 scope=global refcnt=1 No objection from: #network Obtained from: Yandex LLC MFC after: 2 weeks Sponsored by: Yandex LLC Differential Revision: https://reviews.freebsd.org/D9805 Notes: svn path=/head/; revision=314812
* sbin: normalize paths using SRCTOP-relative paths or :H when possibleEnji Cooper2017-03-041-3/+3
| | | | | | | | | | This simplifies make logic/output MFC after: 1 month Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=314656
* Document that the size of AH ICV for HMAC-SHA2-NNN should be half ofAndrey V. Elsukov2017-02-271-5/+4
| | | | | | | | | NNN bits as described in RFC4868. PR: 215978 Notes: svn path=/head/; revision=314339
* Merge projects/ipsec into head/.Andrey V. Elsukov2017-02-061-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Small summary ------------- o Almost all IPsec releated code was moved into sys/netipsec. o New kernel modules added: ipsec.ko and tcpmd5.ko. New kernel option IPSEC_SUPPORT added. It enables support for loading and unloading of ipsec.ko and tcpmd5.ko kernel modules. o IPSEC_NAT_T option was removed. Now NAT-T support is enabled by default. The UDP_ENCAP_ESPINUDP_NON_IKE encapsulation type support was removed. Added TCP/UDP checksum handling for inbound packets that were decapsulated by transport mode SAs. setkey(8) modified to show run-time NAT-T configuration of SA. o New network pseudo interface if_ipsec(4) added. For now it is build as part of ipsec.ko module (or with IPSEC kernel). It implements IPsec virtual tunnels to create route-based VPNs. o The network stack now invokes IPsec functions using special methods. The only one header file <netipsec/ipsec_support.h> should be included to declare all the needed things to work with IPsec. o All IPsec protocols handlers (ESP/AH/IPCOMP protosw) were removed. Now these protocols are handled directly via IPsec methods. o TCP_SIGNATURE support was reworked to be more close to RFC. o PF_KEY SADB was reworked: - now all security associations stored in the single SPI namespace, and all SAs MUST have unique SPI. - several hash tables added to speed up lookups in SADB. - SADB now uses rmlock to protect access, and concurrent threads can do SA lookups in the same time. - many PF_KEY message handlers were reworked to reflect changes in SADB. - SADB_UPDATE message was extended to support new PF_KEY headers: SADB_X_EXT_NEW_ADDRESS_SRC and SADB_X_EXT_NEW_ADDRESS_DST. They can be used by IKE daemon to change SA addresses. o ipsecrequest and secpolicy structures were cardinally changed to avoid locking protection for ipsecrequest. Now we support only limited number (4) of bundled SAs, but they are supported for both INET and INET6. o INPCB security policy cache was introduced. Each PCB now caches used security policies to avoid SP lookup for each packet. o For inbound security policies added the mode, when the kernel does check for full history of applied IPsec transforms. o References counting rules for security policies and security associations were changed. The proper SA locking added into xform code. o xform code was also changed. Now it is possible to unregister xforms. tdb_xxx structures were changed and renamed to reflect changes in SADB/SPDB, and changed rules for locking and refcounting. Reviewed by: gnn, wblock Obtained from: Yandex LLC Relnotes: yes Sponsored by: Yandex LLC Differential Revision: https://reviews.freebsd.org/D9352 Notes: svn path=/head/; revision=313330
* setkey appeared in FreeBSD 4.0Sevan Janiyan2016-10-031-1/+3
| | | | | | | | | | PR: 212551 Approved by: bcr (mentor) MFC after: 4 days Differential Revision: https://reviews.freebsd.org/D8105 Notes: svn path=/head/; revision=306616
* Use nitems() from sys/param.h.Marcelo Araujo2016-04-191-1/+1
| | | | | | | MFC after: 2 weeks. Notes: svn path=/head/; revision=298261
* MFHGlen Barber2016-03-021-6/+0
|\ | | | | | | | | | | | | Sponsored by: The FreeBSD Foundation Notes: svn path=/projects/release-pkg/; revision=296318
| * DIRDEPS_BUILD: Regenerate without local dependencies.Bryan Drewery2016-02-241-6/+0
| | | | | | | | | | | | | | | | | | | | | | These are no longer needed after the recent 'beforebuild: depend' changes and hooking DIRDEPS_BUILD into a subset of FAST_DEPEND which supports skipping 'make depend'. Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=295989