Tobias Brunner
1e1dd2976d
message: Drop fragments with total fragment count lower than before
...
The RFC only allows that the number of fragments increases (if the
sender reduces the MTU).
Not enforcing this before could cause early reassembly as the trigger was
that the number of received fragments matches the total count of the
current packet (which was a bit weird anyway). Only an active MITM could
trigger this as individual fragments are encrypted and authenticated.
2026-04-02 08:17:04 +02:00
Tobias Brunner
6ed63be612
peer-cfg: Use flags for boolean options
...
Makes it potentially easier to add new flags.
The mediation flag is not converted as the #ifdefs make it awkward.
2025-04-10 08:31:09 +02:00
Tobias Brunner
515b9303de
message: Store original encrypted payload when generating fragments
...
If we don't do this, get_plain() will fail after generating the message
fragmented unless it was generated non-fragmented previously.
2024-08-07 16:20:18 +02:00
Tobias Brunner
b9c69f9080
message: Add method to generate data to authenticate IKE_INTERMEDIATE exchanges
2024-08-07 16:20:18 +02:00
Tobias Brunner
5c439bb8a3
generator: Make pointer to length field optional
...
Only useful if we generate an IKE header.
2024-08-07 16:20:18 +02:00
Tobias Brunner
b8358936aa
message: Add rules for IKE_FOLLOWUP_KE exchanges
2024-08-07 16:20:18 +02:00
Tobias Brunner
25f2cdfc56
message: Add rules for IKE_INTERMEDIATE exchanges
2024-08-07 16:20:18 +02:00
Thomas Egerer
84bd011752
ike-sa: Add address family specific configuration of fragment size
...
Signed-off-by: Thomas Egerer <[email protected] >
2024-08-07 14:19:41 +02:00
Tobias Brunner
79d49ea05b
message: Fix build with DEBUG__LEVEL < 1
2023-05-08 17:32:17 +02:00
Tobias Brunner
9efd7d7e90
eap: Print vendor (PEN) names for vendor-specific EAP methods
2022-09-21 13:53:44 +02:00
Tobias Brunner
f6e6fcd2f6
eap: Use pen_t instead of uint32_t for vendor ID
2022-09-21 13:53:44 +02:00
Tobias Brunner
c1987aefbe
message: Fix payload type in last unprotected payload of a fragmented message
2022-06-29 10:28:50 +02:00
Tobias Brunner
19ef2aec15
Update copyright headers after acquisition by secunet
2022-06-28 10:22:56 +02:00
Tobias Brunner
6867050d47
message: Add getter/setter for metadata handling
2022-01-14 10:13:21 +01:00
Josh Soref
b3ab7a48cc
Spelling fixes
...
* accumulating
* acquire
* alignment
* appropriate
* argument
* assign
* attribute
* authenticate
* authentication
* authenticator
* authority
* auxiliary
* brackets
* callback
* camellia
* can't
* cancelability
* certificate
* choinyambuu
* chunk
* collector
* collision
* communicating
* compares
* compatibility
* compressed
* confidentiality
* configuration
* connection
* consistency
* constraint
* construction
* constructor
* database
* decapsulated
* declaration
* decrypt
* derivative
* destination
* destroyed
* details
* devised
* dynamic
* ecapsulation
* encoded
* encoding
* encrypted
* enforcing
* enumerator
* establishment
* excluded
* exclusively
* exited
* expecting
* expire
* extension
* filter
* firewall
* foundation
* fulfillment
* gateways
* hashing
* hashtable
* heartbeats
* identifier
* identifiers
* identities
* identity
* implementers
* indicating
* initialize
* initiate
* initiation
* initiator
* inner
* instantiate
* legitimate
* libraries
* libstrongswan
* logger
* malloc
* manager
* manually
* measurement
* mechanism
* message
* network
* nonexistent
* object
* occurrence
* optional
* outgoing
* packages
* packets
* padding
* particular
* passphrase
* payload
* periodically
* policies
* possible
* previously
* priority
* proposal
* protocol
* provide
* provider
* pseudo
* pseudonym
* public
* qualifier
* quantum
* quintuplets
* reached
* reading
* recommendation to
* recommendation
* recursive
* reestablish
* referencing
* registered
* rekeying
* reliable
* replacing
* representing
* represents
* request
* request
* resolver
* result
* resulting
* resynchronization
* retriable
* revocation
* right
* rollback
* rule
* rules
* runtime
* scenario
* scheduled
* security
* segment
* service
* setting
* signature
* specific
* specified
* speed
* started
* steffen
* strongswan
* subjectaltname
* supported
* threadsafe
* traffic
* tremendously
* treshold
* unique
* uniqueness
* unknown
* until
* upper
* using
* validator
* verification
* version
* version
* warrior
Closes strongswan/strongswan#164 .
2020-02-11 18:23:07 +01:00
Tobias Brunner
7b2236526c
message: Enforce encryption except for INFORMATIONALs
...
The only messages that are generally sent encrypted but could be sent
unencrypted are INFORMATIONALs (currently only used for IKEv1 and ME
connectivity checks). This should prevent issues if the keymat_t behaves
incorrectly and does not return an aead_t when it actually should.
2019-04-15 14:01:02 +02:00
Tobias Brunner
9403320fca
message: Report the size of the complete reassembled IKE message
...
This way we see the same size on both ends, namely that of the complete
IKE message as if it was sent in a single packet (excluding UDP/IP headers).
2018-07-09 17:49:07 +02:00
Tobias Brunner
b68a0adace
ike: Include length of reassembled IKE message in log message
...
Also simplify wording a bit when fragmenting.
2018-07-02 12:19:00 +02:00
Tobias Brunner
1b67166921
Unify format of HSR copyright statements
2018-05-23 16:32:53 +02:00
Tobias Brunner
626e8a31d0
ikev1: Properly handle fragmented Quick Mode messages
2018-02-09 10:46:00 +01:00
Tobias Brunner
08b19dd02a
ikev1: Send NAT-D payloads after HASH payloads in Aggressive Mode requests
...
Some implementations seem to have problems if the third AM message
contains NAT-D payloads before the HASH payload.
Fixes #2314 .
2017-05-19 15:29:37 +02:00
Tobias Brunner
22b839e6e9
ikev1: Accept more than one certificate payload in aggressive mode
...
Fixes #2085 .
2016-08-17 10:30:39 +02:00
Andreas Steffen
b12c53ce77
Use standard unsigned integer types
2016-03-24 18:52:48 +01:00
Tobias Brunner
fab4c845ec
ikev1: Send NAT-D payloads after vendor ID payloads in Aggressive Mode messages
...
Some implementations might otherwise not recognize the NAT-D payload
type. Also moves SIG and HASH payloads last in these messages.
Fixes #1239 .
2016-03-07 14:13:12 +01:00
Tobias Brunner
541543dbfe
message: Log message if unknown/disallowed payload received
2015-06-01 09:42:11 +02:00
Tobias Brunner
e67161fe9e
message: Log original message type of unknown payloads
2015-06-01 09:42:11 +02:00
Tobias Brunner
1507647434
unknown-payload: Use a new private payload type and make original type available
...
This fixes a DoS and potential remote code execution vulnerability that was
caused because the original payload type that was returned previously was
used to cast such payload objects to payloads of the indicated type (e.g.
when logging notify payloads with a payload type for the wrong IKE version).
Fixes CVE-2015-3991.
2015-06-01 09:42:11 +02:00
Martin Willi
823a8a9b46
message: Show the fragmentation numbers in message stringification
2015-06-01 09:42:10 +02:00
Martin Willi
161a015782
utils: Use chunk_equals_const() for all cryptographic purposes
2015-04-14 12:02:51 +02:00
Tobias Brunner
42e0a317c6
ike: Only parse payloads valid for the current IKE version
2014-12-05 15:41:47 +01:00
Tobias Brunner
fac310a467
ike: Make check for known payloads depend on IKE version
2014-12-05 15:41:46 +01:00
Tobias Brunner
b089169752
message: Include encrypted fragment payload in payload (order) rules
...
Otherwise fragmented CREATE_CHILD_SA exchanges won't get accepted
because they don't contain an SA payload.
It also prevents a warning when ordering payloads.
Fixes #752 .
2014-10-29 15:51:38 +01:00
Tobias Brunner
8dbe128c8c
message: Limit maximum number of IKEv2 fragments
...
The maximum for IKEv1 is already 255 due to the 8-bit fragment number.
With an overhead of 17 bytes (x64) per fragment and a default maximum
of 10000 bytes per packet the maximum memory required is 14 kB
for a fragmented message.
2014-10-10 09:32:42 +02:00
Tobias Brunner
f00a9c1715
packet: Define a global default maximum size for IKE packets
2014-10-10 09:32:42 +02:00
Tobias Brunner
03512c47bf
message: Ensure a minimum fragment length
2014-10-10 09:32:41 +02:00
Tobias Brunner
c0f4936a23
message: Fragment and reassemble IKEv2 messages
2014-10-10 09:32:41 +02:00
Tobias Brunner
e8ffb256b3
message: Handle encrypted fragment payload similar to the encrypted payload
2014-10-10 09:32:41 +02:00
Tobias Brunner
41751a70d9
message: Split generate() in multiple functions
2014-10-10 09:31:16 +02:00
Tobias Brunner
70e0be072b
ikev1: Move defragmentation to message_t
2014-10-10 09:30:26 +02:00
Tobias Brunner
2e7a2c06a1
message: fragment() generates message and fragments and caches them
2014-10-10 09:30:26 +02:00
Tobias Brunner
e0b35142c1
message: Make packet argument optional in generate()
2014-10-10 09:30:26 +02:00
Tobias Brunner
127a98dc90
ikev1: Move fragment generation to message_t
2014-10-10 09:30:26 +02:00
Tobias Brunner
147fe503af
ike: Rename encryption_payload to encrypted_payload
2014-10-10 09:30:25 +02:00
Tobias Brunner
8a6b01dd2a
ikev1: Don't cache last block of INFORMATIONAL messages as IV
...
We don't expect a response with the same MID, but apparently some
devices (e.g. FRITZ!Box) do that for DPDs, while still treating the
response as a new exchange. By storing the last message block as IV
we can't decrypt the first block of such a response.
Fixes #661 .
2014-09-12 13:56:18 +02:00
Martin Willi
3ecfc83c6b
payload: Use common prefixes for all payload type identifiers
...
The old identifiers did not use a proper namespace and often clashed with
other defines.
2014-06-04 15:53:03 +02:00
Martin Willi
c4c9d291d2
ikev1: Add an option to accept unencrypted ID/HASH payloads
...
Even in Main Mode, some Sonicwall boxes seem to send ID/HASH payloads in
unencrypted form, probably to allow PSK lookup based on the ID payloads. We
by default reject that, but accept it if the
charon.accept_unencrypted_mainmode_messages option is set in strongswan.conf.
Initial patch courtesy of Paul Stewart.
2014-04-17 08:52:28 +02:00
Tobias Brunner
e8229ad558
iv_gen: Provide external sequence number (IKE, ESP)
...
This prevents duplicate sequential IVs in case of a HA failover.
2013-10-11 15:55:40 +02:00
Martin Willi
d489e75579
ikev1: Accept more than two certificate payloads
2013-10-11 10:15:21 +02:00
Martin Willi
61b0079881
message: print type of configuration payload
2013-09-03 16:26:19 +02:00
Martin Willi
8e4b258030
message: print attributes for IKEv1 configuration payloads as well
2013-09-03 16:26:19 +02:00