Commit Graph

362 Commits

Author SHA1 Message Date
Tobias Brunner db93938297 notify-payload: Update reference for notify types for PPKs
draft-ietf-ipsecme-qr-ikev2 was released as RFC 8784 in June of 2020.
2021-05-11 14:30:05 +02:00
Tobias Brunner e0dd36c9c7 ikev1: Get and set the lifetimes of the selected proposal/transform
Previously, we simply used the lifetimes of the first
proposal/transform, which is not correct if the initiator uses different
lifetimes in its proposals/transforms.
2020-03-06 10:31:30 +01:00
Tobias Brunner 1c6b43b8ea proposal-substructure: Start numbering IKEv1 proposals with 1 2020-03-06 10:31:30 +01:00
Tobias Brunner 859f9c8c83 proposal-substructure: Encode transform number of selected IKEv1 proposal 2020-03-06 10:31:30 +01:00
Tobias Brunner 7da3143aac proposal-substructure: Store transform number for IKEv1 proposals 2020-03-06 10:31:30 +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 17c9972252 Fixed some typos, courtesy of codespell 2019-08-28 14:03:41 +02:00
Tobias Brunner 902f38dd3e ikev2: Check the length of received COOKIE notifies
As specified by RFC 7296, section 2.6, the data associated with COOKIE
notifications MUST be between 1 and 64 octets in length (inclusive).

Fixes #3160.
2019-08-28 12:15:27 +02:00
Tobias Brunner 02b348403a Fixed some typos, courtesy of codespell 2019-04-29 15:09:20 +02:00
SophieK de77957eda proposal-substructure: Fix incorrect type for IKEv2 proposals
Luckily, the type is only used once when generating payloads and there it
doesn't matter because the encoding rules are the same.

Closes strongswan/strongswan#135.
2019-04-25 09:40:51 +02: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 333adbc25b generator: Don't print any tainted values in DBG3 messages for U_INT_4
The bits not written to are marked tainted by valgrind, don't print
them in the debug messages.  Also use more specific printf-specifiers
for other values.
2019-03-27 10:00:09 +01:00
Tobias Brunner 0f423dda28 ikev2: Add notify types for Postquantum Preshared Keys 2018-09-10 18:03:00 +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 62721936b1 encrypted-payload: Change how the length for reassembled messages is calculated
If we have an AEAD transform we add the overhead as if the data would have
been transported in a single encrypted payload.
2018-07-09 17:25:02 +02:00
Tobias Brunner cc1f01e009 encrypted-payload: Add getter for the used AEAD transform 2018-07-09 17:15: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 2db6d5b8b3 Fixed some typos, courtesy of codespell 2018-02-13 12:19:54 +01:00
Tobias Brunner 626e8a31d0 ikev1: Properly handle fragmented Quick Mode messages 2018-02-09 10:46:00 +01:00
Tobias Brunner 2307bffe56 proposal: Move proposal_t from libcharon to libstrongswan
This allows us to use it without having to initialize libcharon, which
was required for the logging (we probably could have included debug.h
instead of daemon.h to workaround that but this seems more correct).
2017-11-17 18:09:54 +01:00
Tobias Brunner 527b3f0ca5 Fixed some typos, courtesy of codespell 2017-11-15 10:21:13 +01:00
Tobias Brunner ca280574ba Fixed some typos, courtesy of codespell 2017-08-07 17:22:01 +02:00
Tobias Brunner 5d580ae063 ikev1: Determine transform ID before mapping integrity algorithm ID
Due to the lookup based on the mapped algorithm ID the resulting AH
proposals were invalid.

Fixes #2347.

Fixes: 8456d6f5a8 ("ikev1: Don't require AH mapping for integrity algorithm when generating proposal")
2017-07-05 10:08:20 +02:00
Tobias Brunner 95a63bf281 Migrate all enumerators to venumerate() interface change 2017-05-26 13:56:44 +02: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
Thomas Egerer 8456d6f5a8 ikev1: Don't require AH mapping for integrity algorithm when generating proposal
Signed-off-by: Thomas Egerer <thomas.egerer@secunet.com>
2016-08-25 13:34:36 +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
Thomas Egerer 40bb4677f7 ikev1: Add support for extended sequence numbers
Signed-off-by: Thomas Egerer <thomas.egerer@secunet.com>
2016-06-29 11:16:48 +02:00
Andreas Steffen b12c53ce77 Use standard unsigned integer types 2016-03-24 18:52:48 +01:00
Tobias Brunner 319b031a8a payloads: Verify P-CSCF configuration attributes like others carrying IP addresses 2016-03-10 11:57:38 +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 91d80298f9 ikev1: Send and verify IPv6 addresses correctly
According to the mode-config draft there is no prefix sent for
IPv6 addresses in IKEv1.  We still accept 17 bytes long addresses for
backwards compatibility with older strongSwan releases.

Fixes #1304.
2016-03-03 17:32:03 +01:00
Tobias Brunner 636b2e9b2a ikev1: Assume a default key length of 128-bit for AES-CBC
Some implementations don't send a Key Length attribute for AES-128.
This was allowed for IKE in early drafts of RFC 3602, however, some
implementations also seem to do it for ESP, where it never was allowed.
And the final version of RFC 3602 demands a Key Length attribute for both
phases so they shouldn't do it anymore anyway.

Fixes #1064.
2015-08-17 17:13:50 +02:00
Tobias Brunner f809e485fb Fixed some typos 2015-08-13 15:12:34 +02: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 62e0abe759 ikev2: Include fragment number into message ID passed to IV gen
When using a cipher with sequential IVs, we never must pass an identical IV
to the IV generator. To avoid it when using IKEv2 fragmentation, use the lower
bits of the 64-bit message ID as the fragment number.
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
Martin Willi 41fc94c924 encoding: Remove DH public value verification from KE payload
This commit reverts 84738b1a and 2ed5f569.

As we have no DH group available in the KE payload for IKEv1, the verification
can't work in that stage. Instead, we now verify DH groups in the DH backends,
which works for any IKE version or any other purpose.
2015-03-23 17:54:03 +01:00
Martin Willi 42431690e0 diffie-hellman: Add a bool return value to get_my_public_value() 2015-03-23 17:54:03 +01:00
Martin Willi 520d58e010 encoding: Allow ke_payload_create_from_diffie_hellman() to fail 2015-03-23 17:54:02 +01:00
Tobias Brunner 8a0cc3f362 encoding: Add getter for IKE SPIs in IKEv1 DELETE payloads 2015-03-23 17:23:57 +01:00
Tobias Brunner 2ed5f5693d encoding: Don't verify length of IKEv1 KE payloads
The verification introduced with 84738b1aed ("encoding: Verify the length
of KE payload data for known groups") can't be done for IKEv1 as the KE
payload does not contain the DH group.
2015-03-20 16:37:59 +01:00
Martin Willi 84738b1aed encoding: Verify the length of KE payload data for known groups
IKE is very strict in the length of KE payloads, and it should be safe to
strictly verify their length. Not doing so is no direct threat, but allows DDoS
amplification by sending short KE payloads for large groups using the target
as the source address.
2015-03-18 13:33:25 +01:00
Tobias Brunner 159b7bec9e ikev2: Add SIGNATURE_HASH_ALGORITHMS notify payload 2015-03-04 13:54:08 +01:00
Tobias Brunner 75dd984e9e ike: Allow creation of internally used payloads
Since 42e0a317c6 ("ike: Only parse payloads valid for the current IKE
version") payload types are checked before creating objects.  This check
failed for internally used payload types (e.g. proposal substructures),
which have a type >= 256, i.e. outside the IKE payload type range.
2014-12-12 13:10:26 +01:00
Tobias Brunner 728f529c42 ikev1: Use same map for AH and ESP authentication algorithms
The transform identifier used in AH transforms is not the same as the
authentication algorithm identifier used in the transform attributes in
AH (and ESP) transforms.
2014-12-09 11:08:14 +01:00