OpenBSD CVS

CVS log for src/sbin/iked/config.c


[BACK] Up to [local] / src / sbin / iked

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.97 / (download) - annotate - [select for diffs], Thu Feb 15 19:11:00 2024 UTC (3 months, 3 weeks ago) by tobhe
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, HEAD
Changes since 1.96: +15 -2 lines
Diff to previous 1.96 (colored)

Delay enabling sockets until ikev2 process is ready.

from markus@

Revision 1.96 / (download) - annotate - [select for diffs], Tue Feb 13 12:25:11 2024 UTC (3 months, 3 weeks ago) by tobhe
Branch: MAIN
Changes since 1.95: +8 -2 lines
Diff to previous 1.95 (colored)

Control startup of PROC_CERT and PROC_IKEV2.
Currenly PROC_PARENT sends the configuration to both PROC_CERT and
PROC_IKEV2 and finishes by sending IMSG_CTL_ACTIVE to PROC_IKEV2.

However, when PROC_IKEV2 receives IMSG_CTL_ACTIVE it does not know
the state of PROC_CERT: PROC_CERT might not have processed the
initial configuration while PROC_IKEV2 already sends requests to
PROC_CERT, causing failed requests, or even crashes (NULL deref of
ca_certs).

In order to make sure that PROC_CERT is ready before
IMSG_CTL_ACTIVE is sent to PROC_IKEV2 that startup protocol
is changed as follows:

(1) PROC_PARENT sends configuration to both PROC_CERT and PROC_IKEV2
(2) PROC_PARENT sends IMSG_CTL_ACTIVE to PROC_CERT
(3) PROC_CERT acks IMSG_CTL_ACTIVE by sending it back to PROC_PARENT
(4) PROC_PARENT now knows that PROC_CERT is ready and has processed
    all messages from step (1)
(5) PROC_PARENT sends IMSG_CTL_ACTIVE to PROC_IKEV2 and knows that
    IMSG_CTL_ACTIVE will be processed by PROC_IKEV2 after all
    messages from step (1)
(6) PROC_IKEV2 can now assume that PROC_CERT is ready because it has
    already processed IMSG_CTL_ACTIVE

from markus@

Revision 1.95 / (download) - annotate - [select for diffs], Wed Jan 17 08:25:02 2024 UTC (4 months, 3 weeks ago) by claudio
Branch: MAIN
Changes since 1.94: +8 -6 lines
Diff to previous 1.94 (colored)

Convert to use imsg_get_fd()

proc_forward_imsg() does not need to forward file descriptors so just use
-1 there. In other places shuffle debug messages around or use a helper
variable since imsg_get_fd() can only be called once.

OK tb@ tobhe@

Revision 1.94 / (download) - annotate - [select for diffs], Mon Jan 15 15:29:00 2024 UTC (4 months, 3 weeks ago) by tobhe
Branch: MAIN
Changes since 1.93: +3 -23 lines
Diff to previous 1.93 (colored)

Include cert_partial_chain in iked_static instead of sending a separate
message.

from markus@

Revision 1.93 / (download) - annotate - [select for diffs], Fri Aug 4 19:06:25 2023 UTC (10 months, 1 week ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_7_4_BASE, OPENBSD_7_4
Changes since 1.92: +3 -3 lines
Diff to previous 1.92 (colored)

Convert calls to ibuf_length() where it is clear that the ibuf is not
NULL to ibuf_size(). In some cases it is clear that the ibuf pointer
should just be checked for NULL since afterwards a new ibuf is allocated
in its place.
OK tb@

Revision 1.92 / (download) - annotate - [select for diffs], Tue May 23 13:12:19 2023 UTC (12 months, 2 weeks ago) by claudio
Branch: MAIN
Changes since 1.91: +32 -32 lines
Diff to previous 1.91 (colored)

Replace ibuf_release() with ibuf_free() since the former just calls the latter
OK kn@ tb@

Revision 1.91 / (download) - annotate - [select for diffs], Sat Dec 3 22:34:35 2022 UTC (18 months, 1 week ago) by tobhe
Branch: MAIN
CVS Tags: OPENBSD_7_3_BASE, OPENBSD_7_3
Changes since 1.90: +4 -4 lines
Diff to previous 1.90 (colored)

Consistently use uintXX_t from <stdint.h> instead of u_intXX_t.

Revision 1.90 / (download) - annotate - [select for diffs], Fri Nov 18 18:56:39 2022 UTC (18 months, 3 weeks ago) by mbuhl
Branch: MAIN
Changes since 1.89: +7 -10 lines
Diff to previous 1.89 (colored)

Revert my last two changes.
If csa_bundled is set, exactly two csas exist and they point to
each other. Therefore childsa_free already sets the bundled csa
pointer to NULL and it shouldn't be done after calling childsa_free.
ok tobhe@

Revision 1.89 / (download) - annotate - [select for diffs], Sun Nov 13 21:19:40 2022 UTC (18 months, 3 weeks ago) by mbuhl
Branch: MAIN
Changes since 1.88: +10 -7 lines
Diff to previous 1.88 (colored)

Make sure csa->csa_bundled is NULL after freeing to prevent a
possible use after free.
ok tobhe@

Revision 1.88 / (download) - annotate - [select for diffs], Mon Oct 10 11:33:55 2022 UTC (20 months ago) by tobhe
Branch: MAIN
Changes since 1.87: +7 -2 lines
Diff to previous 1.87 (colored)

Move enabling the policy refcounting from policy_ref() to config_free_policy().
In config_free_policy() the refcounting is unchanged and each SA linked to the
policy will trigger a call to policy_ref() and increase the references as
before the change.  This allows unconditional calls to policy_ref() and
policy_unref() and the callers no longer have to check if IKED_POLICY_REFCNT
is set.

From and ok markus@

Revision 1.87 / (download) - annotate - [select for diffs], Mon Sep 19 20:54:02 2022 UTC (20 months, 3 weeks ago) by tobhe
Branch: MAIN
CVS Tags: OPENBSD_7_2_BASE, OPENBSD_7_2
Changes since 1.86: +8 -1 lines
Diff to previous 1.86 (colored)

Add iked connection statistics for successful and failed connections, common
error types and other events that help analyze errors in larger setups.
The counters can be printed with 'ikectl show stats'.

ok bluhm@ patrick@
from and ok markus@

Revision 1.86 / (download) - annotate - [select for diffs], Fri Jul 8 19:51:11 2022 UTC (23 months ago) by tobhe
Branch: MAIN
Changes since 1.85: +5 -1 lines
Diff to previous 1.85 (colored)

Support sending certificate chains with intermediate CAs in multiple CERT
payloads.  Local certificate chains as required with LetsEncrypt certs will
work between iked and other IKEv2 implementations,  iked to iked connections
won't work yet because of missing support to receive multiple CERT
payloads.

from Katsuhiro Ueno
tested by and ok sthen@

Revision 1.85 / (download) - annotate - [select for diffs], Sun May 8 20:26:31 2022 UTC (2 years, 1 month ago) by tobhe
Branch: MAIN
Changes since 1.84: +3 -3 lines
Diff to previous 1.84 (colored)

Move ikev2_reset_alive_timer() to a place where it makes more sense.  The idea
is to renew the timer every time sc_alive_timeout is reset after loading a new
config.

ok patrick@

Revision 1.84 / (download) - annotate - [select for diffs], Thu Nov 25 18:28:51 2021 UTC (2 years, 6 months ago) by tobhe
Branch: MAIN
CVS Tags: OPENBSD_7_1_BASE, OPENBSD_7_1
Changes since 1.83: +2 -2 lines
Diff to previous 1.83 (colored)

Silence unitialized variable warnings.

Revision 1.83 / (download) - annotate - [select for diffs], Wed Nov 24 20:48:00 2021 UTC (2 years, 6 months ago) by tobhe
Branch: MAIN
Changes since 1.82: +5 -5 lines
Diff to previous 1.82 (colored)

Pass env to pfkey API. Consistently call pfkey file descriptor fd.

ok bluhm@

Revision 1.82 / (download) - annotate - [select for diffs], Tue Oct 12 09:27:21 2021 UTC (2 years, 7 months ago) by tobhe
Branch: MAIN
Changes since 1.81: +8 -6 lines
Diff to previous 1.81 (colored)

Make sure all copies of MSCHAPv2 passphrase are zeroed after use.

ok patrick@

Revision 1.81 / (download) - annotate - [select for diffs], Sat Sep 18 16:45:07 2021 UTC (2 years, 8 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_7_0_BASE, OPENBSD_7_0
Changes since 1.80: +2 -2 lines
Diff to previous 1.80 (colored)

freezero() instead of free(), because the object may contain a password
ok tobhe

Revision 1.80 / (download) - annotate - [select for diffs], Wed Sep 1 15:30:06 2021 UTC (2 years, 9 months ago) by tobhe
Branch: MAIN
Changes since 1.79: +2 -1 lines
Diff to previous 1.79 (colored)

Add client side support for DNS configuration. Use RTM_PROPOSAL_STATIC
route messages to propose the name server to resolvd(8).
For now, iked will only propose a single name server from the first
established connection.

Automatic name server configuration is enabled by default for policies using
the 'iface' option.

discussed with deraadt@
ok for the DNS parts florian@
ok for the rest patrick@

Revision 1.79 / (download) - annotate - [select for diffs], Thu May 13 15:20:48 2021 UTC (3 years ago) by tobhe
Branch: MAIN
Changes since 1.78: +14 -10 lines
Diff to previous 1.78 (colored)

Refactor iked process shutdown and cleanup. Remember configured
addresses and routes in iked_vroute_sc to not depend on ikev2
process for cleanup.

This makes sure that all flows, routes and addresses are deleted
no matter which process is killed first.

ok patrick@

Revision 1.78 / (download) - annotate - [select for diffs], Mon Feb 22 21:58:12 2021 UTC (3 years, 3 months ago) by tobhe
Branch: MAIN
CVS Tags: OPENBSD_6_9_BASE, OPENBSD_6_9
Changes since 1.77: +3 -3 lines
Diff to previous 1.77 (colored)

Don't pass 'id' as argument to make function signature match similar
functions.  config_setpfkey() is always called with id PROC_IKEV2.

Revision 1.77 / (download) - annotate - [select for diffs], Sat Feb 13 16:14:12 2021 UTC (3 years, 3 months ago) by tobhe
Branch: MAIN
Changes since 1.76: +2 -1 lines
Diff to previous 1.76 (colored)

Add dynamic address configuration for roadwarrior clients.
The new 'iface' config option can be used to specify an interface
for the virtual addresses received from the peer.
Routes are automatically added based on the configured flows.

Input from sthen@ and claudio@
ok patrick@

Revision 1.76 / (download) - annotate - [select for diffs], Mon Feb 8 16:13:58 2021 UTC (3 years, 4 months ago) by tobhe
Branch: MAIN
Changes since 1.75: +7 -4 lines
Diff to previous 1.75 (colored)

Clean up kernel IPsec flows and security associations on shutdown.

Discussed with sthen@
ok patrick@

Revision 1.75 / (download) - annotate - [select for diffs], Thu Jan 21 16:46:47 2021 UTC (3 years, 4 months ago) by tobhe
Branch: MAIN
Changes since 1.74: +14 -6 lines
Diff to previous 1.74 (colored)

Add support for INVALID_KE_PAYLOAD in CREATE_CHILD_SA
exchange.  In the case of an invalid KE error, retry
CREATE_CHILD_SA exchange with different group instead
of restarting the full IKE handshake.

ok markus@

Revision 1.74 / (download) - annotate - [select for diffs], Sun Nov 29 21:00:43 2020 UTC (3 years, 6 months ago) by tobhe
Branch: MAIN
Changes since 1.73: +3 -1 lines
Diff to previous 1.73 (colored)

Add 'set stickyaddress' option.  If this option is enabled, iked will try
to assign the same 'config address' when an IKESA is negotiated with the
DSTID of an existing IKESA.  The original IKESA will be closed and the
address will be transferred to the new IKESA.

ok patrick@

Revision 1.73 / (download) - annotate - [select for diffs], Wed Nov 25 22:17:13 2020 UTC (3 years, 6 months ago) by tobhe
Branch: MAIN
Changes since 1.72: +17 -11 lines
Diff to previous 1.72 (colored)

Fix proposal error handling.  If a proposal contains an unknown transform
type or id, ignore the proposal instead of failing the exchange.

ok patrick@

Revision 1.72 / (download) - annotate - [select for diffs], Thu Oct 29 21:49:58 2020 UTC (3 years, 7 months ago) by tobhe
Branch: MAIN
Changes since 1.71: +4 -1 lines
Diff to previous 1.71 (colored)

Add initial support to request IP addresses as IKEv2 initiator.
At the moment the address is only negotiated and printed to the
log.  If 'request addr 0.0.0.0' is configured, any address will
be accepted.

ok patrick@

Revision 1.71 / (download) - annotate - [select for diffs], Wed Oct 21 17:47:36 2020 UTC (3 years, 7 months ago) by tobhe
Branch: MAIN
Changes since 1.70: +3 -1 lines
Diff to previous 1.70 (colored)

Remove SAs from ike_dstid_sas on 'ikectl reset sa' to prevent use after free.

Found by csszep <csszep (at) gmail (dot) com>
ok patrick@

Revision 1.70 / (download) - annotate - [select for diffs], Fri Oct 9 08:59:15 2020 UTC (3 years, 8 months ago) by tobhe
Branch: MAIN
Changes since 1.69: +1 -2 lines
Diff to previous 1.69 (colored)

More unused headers.

Revision 1.69 / (download) - annotate - [select for diffs], Fri Oct 9 08:54:24 2020 UTC (3 years, 8 months ago) by tobhe
Branch: MAIN
Changes since 1.68: +1 -2 lines
Diff to previous 1.68 (colored)

Remove unused "wait.h" includes.

Revision 1.68 / (download) - annotate - [select for diffs], Wed Sep 30 16:52:08 2020 UTC (3 years, 8 months ago) by tobhe
Branch: MAIN
Changes since 1.67: +2 -1 lines
Diff to previous 1.67 (colored)

Don't leak sa->sa_peerauth.id_buf.

ok patrick@

Revision 1.67 / (download) - annotate - [select for diffs], Fri Sep 25 10:38:05 2020 UTC (3 years, 8 months ago) by tobhe
Branch: MAIN
CVS Tags: OPENBSD_6_8_BASE, OPENBSD_6_8
Changes since 1.66: +7 -12 lines
Diff to previous 1.66 (colored)

Simplify RB_TREE cleanup loops.

ok markus@

Revision 1.66 / (download) - annotate - [select for diffs], Wed Sep 23 14:25:55 2020 UTC (3 years, 8 months ago) by tobhe
Branch: MAIN
Changes since 1.65: +23 -1 lines
Diff to previous 1.65 (colored)

Add new 'set cert_partial_chain' config option to allow verification of
partial certificate chains if a trusted intermediate CA is found in
/etc/iked/ca/.

ok patrick@

Revision 1.65 / (download) - annotate - [select for diffs], Wed Aug 26 14:49:48 2020 UTC (3 years, 9 months ago) by tobhe
Branch: MAIN
Changes since 1.64: +3 -1 lines
Diff to previous 1.64 (colored)

Allow disabling DPD liveness checks by setting dpd_check_interval to 0.

ok patrick@

Revision 1.64 / (download) - annotate - [select for diffs], Tue Aug 25 15:08:07 2020 UTC (3 years, 9 months ago) by tobhe
Branch: MAIN
Changes since 1.63: +2 -1 lines
Diff to previous 1.63 (colored)

Add dpd_check_interval configuration option.  If for any IKE SA no IPsec
or IKE message has been received within the specified time interval,
iked will start sending DPD messages.

ok patrick@

Revision 1.63 / (download) - annotate - [select for diffs], Mon Aug 24 21:00:21 2020 UTC (3 years, 9 months ago) by tobhe
Branch: MAIN
Changes since 1.62: +11 -81 lines
Diff to previous 1.62 (colored)

Reduce the amount of boilerplate code and imsgs for config options by
grouping fixed-size values in 'struct iked_static' which is sent in
a single message.

ok patrick@

Revision 1.62 / (download) - annotate - [select for diffs], Sun Aug 23 19:16:07 2020 UTC (3 years, 9 months ago) by tobhe
Branch: MAIN
Changes since 1.61: +25 -1 lines
Diff to previous 1.61 (colored)

Add a new configuration option to limit the number of connections for
each peer (identified by their 'dstid').  When 'set enforcesingleikesa'
is enabled, each peer can only have one active IKE SA at a time.
On successful authentication of a new connection, the old IKE SA is
automatically deleted.

ok patrick@

Revision 1.61 / (download) - annotate - [select for diffs], Tue Aug 18 21:02:49 2020 UTC (3 years, 9 months ago) by tobhe
Branch: MAIN
Changes since 1.60: +45 -9 lines
Diff to previous 1.60 (colored)

Add optional time-stamp validaten for ocsp.  The new optional 'tolerate'
parameter specifies how many seconds leeway are allowed in the check.
The optional maxage parameter indicates the allowed maximum age of
the `thisUpdate' OCSP attribute value.

ok patrick@

Revision 1.60 / (download) - annotate - [select for diffs], Sun Aug 16 09:09:17 2020 UTC (3 years, 9 months ago) by tobhe
Branch: MAIN
Changes since 1.59: +2 -2 lines
Diff to previous 1.59 (colored)

Clean up unused parameters.

Revision 1.59 / (download) - annotate - [select for diffs], Fri Aug 14 21:13:15 2020 UTC (3 years, 9 months ago) by tobhe
Branch: MAIN
Changes since 1.58: +4 -4 lines
Diff to previous 1.58 (colored)

Clean up unused variables.

Revision 1.58 / (download) - annotate - [select for diffs], Thu Jul 23 22:01:08 2020 UTC (3 years, 10 months ago) by tobhe
Branch: MAIN
Changes since 1.57: +2 -1 lines
Diff to previous 1.57 (colored)

Fix ibuf leak in sa_localauth when SA is freed.

ok patrick@

Revision 1.57 / (download) - annotate - [select for diffs], Mon Apr 13 19:10:32 2020 UTC (4 years, 1 month ago) by tobhe
Branch: MAIN
CVS Tags: OPENBSD_6_7_BASE, OPENBSD_6_7
Changes since 1.56: +7 -3 lines
Diff to previous 1.56 (colored)

Try to send a DELETE message if the SA is reset with 'ikectl reset id'.
This way the peer can delete its SAs and eventually reestablish the
connection without having to wait for a timeout.

ok markus@

Revision 1.56 / (download) - annotate - [select for diffs], Thu Apr 9 19:55:19 2020 UTC (4 years, 2 months ago) by tobhe
Branch: MAIN
Changes since 1.55: +18 -13 lines
Diff to previous 1.55 (colored)

Simplify socket creation logic. Normally iked needs two sockets, one
for normal operation (UDP port 500) and one for NAT traversal (UDP 4500).
There are several command line options resulting in only one of the sockets
being created (-T, -t and -p).  Add a new 'enum natt_mode' to make the
logic for those somewhat less complicated as well as some comments where
it makes sense.

From Wataru Ashihara <wataash (at) wataash (dot) com>
ok patrick@

Revision 1.55 / (download) - annotate - [select for diffs], Tue Mar 24 13:32:36 2020 UTC (4 years, 2 months ago) by tobhe
Branch: MAIN
Changes since 1.54: +2 -2 lines
Diff to previous 1.54 (colored)

Fix user database corruption from 'ikectl reload'. Copy only the new password
instead of the full iked_user struct to preserve the RB_TREE pointers.

From Bernardo Cunha Vieira <bernardo (dot) vieira (at) almg (dot) gov (dot) br>
ok patrick@

Revision 1.54 / (download) - annotate - [select for diffs], Mon Mar 9 11:50:43 2020 UTC (4 years, 3 months ago) by tobhe
Branch: MAIN
Changes since 1.53: +7 -13 lines
Diff to previous 1.53 (colored)

Use TAILQ_FOREACH_SAFE instead of hand rolled loops.

From Wataru <wataash at wataash dot com>
ok patrick@

Revision 1.53 / (download) - annotate - [select for diffs], Thu Jan 16 20:05:00 2020 UTC (4 years, 4 months ago) by tobhe
Branch: MAIN
Changes since 1.52: +24 -1 lines
Diff to previous 1.52 (colored)

Add '-p' command line option which allows to configure
the UDP encapsulation port, similar to isakmpd's '-N' flag.
Being able to change the UDP encapsulation port is useful in cases
where ESP and UDP ports 500 and 4500 are blocked or rate limited.

ok sthen@

Revision 1.52 / (download) - annotate - [select for diffs], Tue Jan 7 15:08:28 2020 UTC (4 years, 5 months ago) by tobhe
Branch: MAIN
Changes since 1.51: +8 -2 lines
Diff to previous 1.51 (colored)

Link ESP-SA and IPcomp-SA using GRPSPIS instead of using a self-built
solution for multi-SA flows. As a result we only need a single
outgoing IPCOMP flow and can get rid of the two extra transport mode flows
for ESP.

ok bluhm@

Revision 1.51 / (download) - annotate - [select for diffs], Tue Dec 3 12:38:34 2019 UTC (4 years, 6 months ago) by tobhe
Branch: MAIN
Changes since 1.50: +14 -1 lines
Diff to previous 1.50 (colored)

Correctly represent flows as traffic selectors as described in RFC 7296. This
allows us to deduplicate the network ranges sent in the TS payload and saves
some bytes on the wire.

ok patrick@

Revision 1.50 / (download) - annotate - [select for diffs], Sat May 11 16:30:23 2019 UTC (5 years, 1 month ago) by patrick
Branch: MAIN
CVS Tags: OPENBSD_6_6_BASE, OPENBSD_6_6
Changes since 1.49: +42 -1 lines
Diff to previous 1.49 (colored)

Add support for IKEv2 Message Fragmentation as defined in RFC 7383.

ok sthen@

Revision 1.49 / (download) - annotate - [select for diffs], Mon Nov 27 18:39:35 2017 UTC (6 years, 6 months ago) by patrick
Branch: MAIN
CVS Tags: OPENBSD_6_5_BASE, OPENBSD_6_5, OPENBSD_6_4_BASE, OPENBSD_6_4, OPENBSD_6_3_BASE, OPENBSD_6_3
Changes since 1.48: +24 -1 lines
Diff to previous 1.48 (colored)

Implement MOBIKE (RFC 4555) support in iked(8), with us acting as
responder.  In practice this support means that clients like iPhones
can roam in different networks (LTE, WiFi) and change their external
addresses without having to re-do the whole handshake.  It allows the
client to choose how and when to change the external tunnel endpoint
addresses on demand, depending on which network is better or even is
connected at all.

ok sthen@
tweaks from jmc@
tested by a handful

Revision 1.48 / (download) - annotate - [select for diffs], Thu Apr 13 07:04:09 2017 UTC (7 years, 2 months ago) by patrick
Branch: MAIN
CVS Tags: OPENBSD_6_2_BASE, OPENBSD_6_2
Changes since 1.47: +2 -1 lines
Diff to previous 1.47 (colored)

Add a NAT-T keepalive timer in case we are behind a NAT gateway.

See RFC 5996, section 2.23, NAT Traversal:
  In the case of a mismatching NAT_DETECTION_DESTINATION_IP hash, it
  means that the system receiving the NAT_DETECTION_DESTINATION_IP
  payload is behind a NAT and that system SHOULD start sending
  keepalive packets as defined in [UDPENCAPS].

With markus@, ok reyk@

Revision 1.47 / (download) - annotate - [select for diffs], Mon Mar 27 10:43:53 2017 UTC (7 years, 2 months ago) by mikeb
Branch: MAIN
CVS Tags: OPENBSD_6_1_BASE, OPENBSD_6_1
Changes since 1.46: +74 -26 lines
Diff to previous 1.46 (colored)

Factor out flows into separate configuration messages

We reach an imsg payload limit with just a few traffic selectors
so in order to load more we need to split them up and send separately.

Suggested and OK reyk

Revision 1.46 / (download) - annotate - [select for diffs], Mon Mar 27 10:29:02 2017 UTC (7 years, 2 months ago) by reyk
Branch: MAIN
Changes since 1.45: +1 -2 lines
Diff to previous 1.45 (colored)

spacing

Revision 1.45 / (download) - annotate - [select for diffs], Mon Mar 27 10:24:36 2017 UTC (7 years, 2 months ago) by reyk
Branch: MAIN
Changes since 1.44: +3 -1 lines
Diff to previous 1.44 (colored)

Fix another iked leak of SAs in pfkey_sa(), copy tags correctly.

Diff from markus@
OK mikeb@ patrick@

Revision 1.44 / (download) - annotate - [select for diffs], Mon Mar 13 18:49:20 2017 UTC (7 years, 3 months ago) by mikeb
Branch: MAIN
Changes since 1.43: +3 -1 lines
Diff to previous 1.43 (colored)

Resolve simultaneous Child SA rekeying

From and OK markus, OK reyk

Revision 1.43 / (download) - annotate - [select for diffs], Tue Jan 3 17:51:38 2017 UTC (7 years, 5 months ago) by reyk
Branch: MAIN
Changes since 1.42: +90 -1 lines
Diff to previous 1.42 (colored)

Fix pledge of the ca process by calling the right function on startup.
As a related change, load the local.pub and local.key keys after
privsep and reload them on SIGHUP/reload.

OK mikeb@

Revision 1.42 / (download) - annotate - [select for diffs], Wed Jun 1 11:16:41 2016 UTC (8 years ago) by patrick
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0
Changes since 1.41: +5 -1 lines
Diff to previous 1.41 (colored)

Implement a second address pool specifically for IPv6, so that
clients can be given an IPv4 and IPv6 address at the same time,
thus enabling dual stack usage.

ok markus@ mikeb@

Revision 1.41 / (download) - annotate - [select for diffs], Mon Dec 7 12:46:37 2015 UTC (8 years, 6 months ago) by reyk
Branch: MAIN
CVS Tags: OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.40: +11 -15 lines
Diff to previous 1.40 (colored)

Sync proc.c, use shorter proc_compose[v]()

Revision 1.40 / (download) - annotate - [select for diffs], Wed Nov 18 16:46:30 2015 UTC (8 years, 6 months ago) by reyk
Branch: MAIN
Changes since 1.39: +4 -6 lines
Diff to previous 1.39 (colored)

pledge exposed a simple bug: the unprivileged child tried to print the
policy after receiving it from the parent.  print_policy ->
print_proto -> getprotobynumber -> pledge abort because it tried to
access /etc/protocols without rpath.  It was just a debugging message
that can be moved to the parent (printing the policy on the sender
side and not the receiver side).  The parent has rpath and dns.

Issue found by sthen@ with "proto etherip"
OK sthen@ benno@

Revision 1.39 / (download) - annotate - [select for diffs], Mon Oct 19 11:25:35 2015 UTC (8 years, 7 months ago) by reyk
Branch: MAIN
Changes since 1.38: +1 -3 lines
Diff to previous 1.38 (colored)

Remove the ikev1 stub - Since I started iked, it has an empty privsep
process for ISAKMP+IKEv1.  I kept it to let somebody either contribute
the old protocol one day, I never intended to implement IKEv1 myself,
or to add a new kind of pipe to isakmpd to hand off IKEv1 messages.
As IKEv2 is widely supported by all major OS and networking vendors
now, I'm happy to scrap the idea of supporting ISAKMP+IKEv1.  It is
still possible to use isakmpd for legacy VPNs.

OK mikeb@

Revision 1.38 / (download) - annotate - [select for diffs], Thu Oct 15 18:40:38 2015 UTC (8 years, 7 months ago) by mmcc
Branch: MAIN
Changes since 1.37: +3 -5 lines
Diff to previous 1.37 (colored)

Remove some unnecessary NULL-checks before free(). Change two bzero()
calls on pf data to explicit_bzero().

ok mikeb@

Revision 1.37 / (download) - annotate - [select for diffs], Fri Aug 21 11:59:27 2015 UTC (8 years, 9 months ago) by reyk
Branch: MAIN
Changes since 1.36: +24 -23 lines
Diff to previous 1.36 (colored)

Switch iked to C99-style fixed-width integer types.

OK mikeb@

Revision 1.36 / (download) - annotate - [select for diffs], Tue Jul 7 19:13:31 2015 UTC (8 years, 11 months ago) by markus
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8
Changes since 1.35: +11 -5 lines
Diff to previous 1.35 (colored)

repair policy-ikesa-linking by replacing the broken RB_TREE w/TAILQ
(e.g. the policy might be used-after-free on 'ikectl reconfig')
ok mikeb@

Revision 1.35 / (download) - annotate - [select for diffs], Fri Feb 6 10:39:01 2015 UTC (9 years, 4 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.34: +1 -2 lines
Diff to previous 1.34 (colored)

unneeded getopt.h

Revision 1.34 / (download) - annotate - [select for diffs], Fri Jan 16 06:39:58 2015 UTC (9 years, 4 months ago) by deraadt
Branch: MAIN
Changes since 1.33: +1 -2 lines
Diff to previous 1.33 (colored)

Replace <sys/param.h> with <limits.h> and other less dirty headers where
possible.  Annotate <sys/param.h> lines with their current reasons.  Switch
to PATH_MAX, NGROUPS_MAX, HOST_NAME_MAX+1, LOGIN_NAME_MAX, etc.  Change
MIN() and MAX() to local definitions of MINIMUM() and MAXIMUM() where
sensible to avoid pulling in the pollution.  These are the files confirmed
through binary verification.
ok guenther, millert, doug (helped with the verification protocol)

Revision 1.33 / (download) - annotate - [select for diffs], Wed Dec 3 23:18:21 2014 UTC (9 years, 6 months ago) by deraadt
Branch: MAIN
Changes since 1.32: +4 -4 lines
Diff to previous 1.32 (colored)

Init SPI using arc4random_buf, rather than (r << 32) | r
ok matthew

Revision 1.32 / (download) - annotate - [select for diffs], Wed Oct 8 05:47:03 2014 UTC (9 years, 8 months ago) by deraadt
Branch: MAIN
Changes since 1.31: +3 -3 lines
Diff to previous 1.31 (colored)

trivial use of reallocarray()

Revision 1.31 / (download) - annotate - [select for diffs], Tue May 6 14:10:53 2014 UTC (10 years, 1 month ago) by markus
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6
Changes since 1.30: +18 -1 lines
Diff to previous 1.30 (colored)

change the create-child-sa responder code, so it does not store any
state in the ikesa structure. this way we can initiate a create-child-sa
and process requests for the peer at the same time. ok mikeb@

Revision 1.30 / (download) - annotate - [select for diffs], Tue May 6 10:24:22 2014 UTC (10 years, 1 month ago) by markus
Branch: MAIN
Changes since 1.29: +2 -1 lines
Diff to previous 1.29 (colored)

initiate ike sa rekeying (ikesalifetime keyword), re-queue pfkey
events while we are busy initiating child-SAs; ok mikeb@

Revision 1.29 / (download) - annotate - [select for diffs], Tue May 6 09:48:40 2014 UTC (10 years, 1 month ago) by markus
Branch: MAIN
Changes since 1.28: +2 -3 lines
Diff to previous 1.28 (colored)

cleanup IKE-SA tree handling (fixes repeated-insert & double-remove)

sa_new() always re-inserts an SA into the SA tree. in case of a key
collision it would try to free the new SA. While doing that it would
accidentially free the existing SA, since config_free_sa() does
RB_REMOVE() uncoditionally.  This change fixes this by:
a) moving the responsibility for RB_REMOVE() to CALLER of config_free_sa() and
b) by calling config_free_sa() instead of sa_free() from sa_new()
It also changes to code to NEVER re-add an SA to the tree. So
RB_INSERT() is ONLY called once per SA. The code also makes sure
that there is always a KEY defined for this tree (ispi).

ok mikeb@

Revision 1.28 / (download) - annotate - [select for diffs], Tue May 6 07:24:37 2014 UTC (10 years, 1 month ago) by markus
Branch: MAIN
Changes since 1.27: +6 -2 lines
Diff to previous 1.27 (colored)

initial support for PFS; ok reyk@

Revision 1.27 / (download) - annotate - [select for diffs], Tue Apr 22 12:00:03 2014 UTC (10 years, 1 month ago) by reyk
Branch: MAIN
Changes since 1.26: +19 -14 lines
Diff to previous 1.26 (colored)

Update iked to use the same proc.c that relayd uses.
Less differences, less code to audit.

ok mikeb@

Revision 1.26 / (download) - annotate - [select for diffs], Mon Feb 17 15:53:46 2014 UTC (10 years, 3 months ago) by markus
Branch: MAIN
CVS Tags: OPENBSD_5_5_BASE, OPENBSD_5_5
Changes since 1.25: +6 -1 lines
Diff to previous 1.25 (colored)

interpret 'config address net/prefix' as a pool of addresses and
randomly choose the address for CFG_REQUEST. this address will be used
to replace 0.0.0.0/32 in the specified flow. e.g.
> ikev2 passive esp from 192.168.1.0/24 to 0.0.0.0 \
>     config address 192.168.10.200/24
will assign an address between 192.168.10.200 and 192.168.10.254
and replace 0.0.0.0 with this address.
ok mikeb@ on older version of this diff.

Revision 1.25 / (download) - annotate - [select for diffs], Mon Feb 17 15:07:23 2014 UTC (10 years, 3 months ago) by markus
Branch: MAIN
Changes since 1.24: +26 -1 lines
Diff to previous 1.24 (colored)

basic OCSP support. enable with 'set ocsp "http://10.0.0.10:8888/"'
ok mikeb@

Revision 1.24 / (download) - annotate - [select for diffs], Fri Jan 24 05:58:52 2014 UTC (10 years, 4 months ago) by mikeb
Branch: MAIN
Changes since 1.23: +2 -2 lines
Diff to previous 1.23 (colored)

use a bit saner timer api

Revision 1.23 / (download) - annotate - [select for diffs], Tue Dec 3 13:55:39 2013 UTC (10 years, 6 months ago) by markus
Branch: MAIN
Changes since 1.22: +3 -2 lines
Diff to previous 1.22 (colored)

never cast to sockaddr_storage, always cast to the abstract 'class' sockaddr
this fixes an out-of-bounds-memcpy in pfkey_process(); ok mikeb@

Revision 1.22 / (download) - annotate - [select for diffs], Thu Nov 28 20:28:34 2013 UTC (10 years, 6 months ago) by markus
Branch: MAIN
Changes since 1.21: +3 -2 lines
Diff to previous 1.21 (colored)

don't leak duplicate flows; ok mikeb@

Revision 1.21 / (download) - annotate - [select for diffs], Thu Oct 24 02:55:50 2013 UTC (10 years, 7 months ago) by deraadt
Branch: MAIN
Changes since 1.20: +1 -8 lines
Diff to previous 1.20 (colored)

no need for netinet/ip_var.h (and friends)

Revision 1.20 / (download) - annotate - [select for diffs], Thu Mar 21 04:30:14 2013 UTC (11 years, 2 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_4_BASE, OPENBSD_5_4
Changes since 1.19: +1 -2 lines
Diff to previous 1.19 (colored)

remove excessive includes

Revision 1.19 / (download) - annotate - [select for diffs], Tue Jan 8 10:38:19 2013 UTC (11 years, 5 months ago) by reyk
Branch: MAIN
CVS Tags: OPENBSD_5_3_BASE, OPENBSD_5_3
Changes since 1.18: +2 -3 lines
Diff to previous 1.18 (colored)

Remove private CVS tag from an obsolete repository and bump copyright
to 2013 while I'm here... this is my way of saying "happy new year!".

Revision 1.18 / (download) - annotate - [select for diffs], Sat Dec 15 23:20:17 2012 UTC (11 years, 5 months ago) by reyk
Branch: MAIN
Changes since 1.17: +1 -2 lines
Diff to previous 1.17 (colored)

Remove unused variables.

Revision 1.17 / (download) - annotate - [select for diffs], Mon Oct 22 10:25:17 2012 UTC (11 years, 7 months ago) by reyk
Branch: MAIN
Changes since 1.16: +9 -4 lines
Diff to previous 1.16 (colored)

Fix NAT-T support in iked, both on the initiator and the responder
side.  Also add a new command line option -t to optionally enforce
NAT-T with UDP encapsulation on port 4500.

Tested by mikeb@ and me
ok mikeb@

Revision 1.16 / (download) - annotate - [select for diffs], Tue Sep 18 12:07:59 2012 UTC (11 years, 8 months ago) by reyk
Branch: MAIN
Changes since 1.15: +2 -2 lines
Diff to previous 1.15 (colored)

update email addresses to match reality.
sure jsg@ mikeb@

Revision 1.15 / (download) - annotate - [select for diffs], Mon Jul 2 13:03:24 2012 UTC (11 years, 11 months ago) by mikeb
Branch: MAIN
CVS Tags: OPENBSD_5_2_BASE, OPENBSD_5_2
Changes since 1.14: +3 -1 lines
Diff to previous 1.14 (colored)

Don't close IKE SA immediately after creating a new one when rekeying.
Instead set a timeout that will shut it down in case we don't get an SA
delete notification.

Revision 1.14 / (download) - annotate - [select for diffs], Fri Jun 22 16:28:20 2012 UTC (11 years, 11 months ago) by mikeb
Branch: MAIN
Changes since 1.13: +6 -1 lines
Diff to previous 1.13 (colored)

Add initial support for retransmition timeouts and response retries.
This should still be considered an experimental work in progress.

Revision 1.13 / (download) - annotate - [select for diffs], Tue Jul 5 19:59:00 2011 UTC (12 years, 11 months ago) by tedu
Branch: MAIN
CVS Tags: OPENBSD_5_1_BASE, OPENBSD_5_1, OPENBSD_5_0_BASE, OPENBSD_5_0
Changes since 1.12: +2 -2 lines
Diff to previous 1.12 (colored)

fix memcpy sizeof.  found by jsg.  ok deraadt krw mikeb

Revision 1.12 / (download) - annotate - [select for diffs], Mon May 9 11:15:18 2011 UTC (13 years, 1 month ago) by reyk
Branch: MAIN
Changes since 1.11: +11 -11 lines
Diff to previous 1.11 (colored)

rename functions in proc.c to proc_* and move some code from imsg_util.c to
proc.c.  this is the first sync to what i did for relayd but does not include
the multi-instance handling - so no functional change.

Revision 1.11 / (download) - annotate - [select for diffs], Thu May 5 12:17:10 2011 UTC (13 years, 1 month ago) by reyk
Branch: MAIN
Changes since 1.10: +7 -7 lines
Diff to previous 1.10 (colored)

rename iked_proc* to privsep_proc*.  no functional change.

Revision 1.10 / (download) - annotate - [select for diffs], Mon Apr 18 08:45:43 2011 UTC (13 years, 1 month ago) by reyk
Branch: MAIN
Changes since 1.9: +8 -13 lines
Diff to previous 1.9 (colored)

When the kernel wants to acquire an SA for an unknown flow, lookup a
matching policy and init a new IKE SA.  This adds support for "acquire mode"
from static flows.

ok mikeb@

Revision 1.9 / (download) - annotate - [select for diffs], Wed Jan 26 16:59:23 2011 UTC (13 years, 4 months ago) by mikeb
Branch: MAIN
CVS Tags: OPENBSD_4_9_BASE, OPENBSD_4_9
Changes since 1.8: +4 -2 lines
Diff to previous 1.8 (colored)

get rid of acquire flows completely, as they tend to pass traffic
when there's no sa established (as pointed out by reyk).  instead
use require mode feature to send acquires from the kernel.  this
allows us to get rid of the code that changes flow mode to acquire
and keep all installed flows in the tree and save up on some code
that deals with renegotiation.  also several entities were renamed
(iked_acqflows -> iked_activeflows, iked_ipsecsas -> iked_activesas,
ikev2_acquire -> ikev2_acquire_sa).   ok reyk

Revision 1.8 / (download) - annotate - [select for diffs], Fri Jan 21 11:56:00 2011 UTC (13 years, 4 months ago) by reyk
Branch: MAIN
Changes since 1.7: +34 -15 lines
Diff to previous 1.7 (colored)

Reimplement the iked(8) policy evaluation for incoming connections to
use the last matching semantics of PF.  The previous rbtree-based
implementation was broken and tried to do a longest prefix match.  But
instead of prefix match and using radix-trees to fix it I decided with
mikeb@ to implement it as last matching policy evaluation.  The last
matching policy wins; the "quick" keyword can enforce first matching;
additional keywords like "skip" are specific to iked(8).  See
iked.conf(5) for more details.

The implementation also uses skip steps based on PF's code.  It
significantly speeds up the evaluation of many policies but also adds
a little delay when loading them (only noticeable with thousands of
policies).  This allows iked(8) to scale well with thousands of
configured policies but I also liked the fact to have skip steps in
another piece of code.

ok dhartmei@ for using his skip step code under the ISC license in policy.c
ok mikeb@, jmc@

Revision 1.7 / (download) - annotate - [select for diffs], Fri Jan 21 11:37:02 2011 UTC (13 years, 4 months ago) by reyk
Branch: MAIN
Changes since 1.6: +4 -8 lines
Diff to previous 1.6 (colored)

split pfkey initialization into a privileged and unprivileged part to
prevent a possible crash.

ok mikeb@

Revision 1.6 / (download) - annotate - [select for diffs], Wed Jan 12 14:35:45 2011 UTC (13 years, 5 months ago) by mikeb
Branch: MAIN
Changes since 1.5: +2 -2 lines
Diff to previous 1.5 (colored)

postpone processing of pfkey messages received in pfkey_reply instead of
just dropping them;  ok reyk

Revision 1.5 / (download) - annotate - [select for diffs], Wed Dec 22 16:22:27 2010 UTC (13 years, 5 months ago) by mikeb
Branch: MAIN
Changes since 1.4: +13 -10 lines
Diff to previous 1.4 (colored)

child sa rekeying revamp plus numerous bugfixes;
with suggestions and OK from reyk

Revision 1.4 / (download) - annotate - [select for diffs], Mon Jun 14 08:10:32 2010 UTC (14 years ago) by reyk
Branch: MAIN
CVS Tags: OPENBSD_4_8_BASE, OPENBSD_4_8
Changes since 1.3: +17 -2 lines
Diff to previous 1.3 (colored)

More code for initiator mode (not finished yet)

Revision 1.3 / (download) - annotate - [select for diffs], Thu Jun 10 14:08:37 2010 UTC (14 years ago) by reyk
Branch: MAIN
Changes since 1.2: +50 -1 lines
Diff to previous 1.2 (colored)

add new commands: the couple/decouple commands will set loading of the
learned flows and SAs to the kernel which is useful for testing and
debugging. the active/passive commands are required to use iked
with sasyncd(8);  sasyncd just needs to call "ikectl active/passive" or
send the appropriate imsg to support iked but this is not implemented yet.

Revision 1.2 / (download) - annotate - [select for diffs], Thu Jun 10 12:06:34 2010 UTC (14 years ago) by reyk
Branch: MAIN
Changes since 1.1: +8 -4 lines
Diff to previous 1.1 (colored)

Add another tree to lookup policy SAs by peer address.

Revision 1.1 / (download) - annotate - [select for diffs], Thu Jun 3 16:41:12 2010 UTC (14 years ago) by reyk
Branch: MAIN

Import iked, a new implementation of the IKEv2 protocol.

iked(8) is an automatic keying daemon for IPsec, like isakmpd(8), that
IPsec creates flows and SAs automatically.  Unlike isakmpd, iked(8)
implements the newer IKEv2 protocol instead of IKEv1/ISAKMP.  The
daemon is still work-in-progress and not enabled in the builds, but is
already able to establish IKEv2 sessions with some other IKEv2
implementations as a responder.

with lots of help and debugging by jsg@
ok deraadt@

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.