Commit Graph
18058 Commits
Author SHA1 Message Date
Tobias Brunner 88e7654c6c libtls: Shutdown server socket in test teardown function
If a test fails and the server thread is blocked reading on the socket,
it would stay stuck.
2021-12-08 11:32:55 +01:00
Tobias Brunner d95381ec7a tls-socket: Handle sending fatal errors better
In particular as server, the previous code might cause it to hang in
recv() if this case wasn't triggered by a close notify (followed by a
shutdown of the socket) but it e.g. failed processing a ServerHello and
responded with a fatal alert.

Fixes: 09fbaad6bd ("tls-socket: Don't fail reading if sending data failed")
2021-12-08 11:32:50 +01:00
Andreas Steffen 01485770fd gcrypt: Support of AES-CFB encryption 2021-12-06 13:43:45 +01:00
Andreas Steffen 2d1a1cc907 botan: Support of AES-CFB encryption 2021-12-06 13:28:31 +01:00
Andreas Steffen 54d7e39d40 wolfssl: Support of AES-CFB encryption 2021-12-06 12:53:11 +01:00
Andreas Steffen 695a04d146 openssl: Support of AES-CFB encryption 2021-12-06 12:52:37 +01:00
Tobias Brunner dcaf9b38f3 child-rekey: Uninstall old outbound SA earlier on initiator/winner
This is useful for kernel implementations where the ordering of SAs
is unpredictable and the new SA might otherwise not be used until the
DELETE response has been received, which is not ideal as the responder
might not keep the old SA around that long.  On Linux, it makes no
difference as we switch to the new outbound SA immediately because the
updated outbound policy references its SPI.
2021-12-01 11:00:40 +01:00
Tobias Brunner e9ba195910 github: Run charon-tkm tests
Use a Debian-based Docker container to run the unit tests for charon-tkm,
once without and once with TKM running.  The container can also be used
locally to run the tests (see comments in the Dockerfile).
2021-11-29 15:30:43 +01:00
Tobias Brunner 66fd0c4db7 charon-tkm: Make only tests requiring TKM optional
This way we can run many unit tests without having to run the TKM in the
background and as regular user.  To run the other tests, TESTS_TKM can
optionally be defined when running `make check`.
2021-11-29 15:29:22 +01:00
Tobias Brunner 43927e60a7 Revert "testing: Don't run tests when building tkm"
This reverts commit e74bca9e19.
2021-11-29 15:06:57 +01:00
Tobias Brunner 6b9c8a674f Revert "testing: Don't run tests when building tkm-rpc"
Let's try that again on current systems.

This reverts commit 9c2aba2735.
2021-11-29 15:06:57 +01:00
zhangxiaojun df0999ec93 android: Improved simplified Chinese translation / 完善了简体中文翻译
Closes strongswan/strongswan#779
2021-11-26 15:45:53 +01:00
Tobias Brunner e43052893d vici: Fix check before applying identity to public keys 2021-11-23 16:15:41 +01:00
Tobias Brunner deb288ddc1 testing: Increase memory of winnetou
Looks like named requires a lot more memory than previously so that
Apache seems to struggle serving the test results sometimes.
2021-11-19 15:27:58 +01:00
Andreas Steffen 4124b1d376 Version bump to 5.9.5dr2 2021-11-18 22:06:09 +01:00
Tobias Brunner 11b10bc2b0 farp: Fix incompatible function types warning 2021-11-17 18:21:30 +01:00
Tobias Brunner cceca1a3c4 eap-radius: Fix incompatible function types warnings 2021-11-17 18:18:09 +01:00
Tobias Brunner 9b2e9a943c processor: Fix incompatible function types warnings 2021-11-17 18:06:20 +01:00
Tobias Brunner 0917edb468 blocking-queue: Fix incompatible function types warning 2021-11-17 17:46:27 +01:00
Andreas Steffen fe5399d287 Merge branch 'rsa-oaep-encryption' 2021-11-11 10:03:17 +01:00
Andreas Steffen 519db56f2f testing: Added RSA PKCS1 encryption tests 2021-11-10 21:06:10 +01:00
Andreas Steffen 6bb5c4f2bb testing: Added RSA OAEP encryption tests 2021-11-10 21:06:10 +01:00
Andreas Steffen 93bf894cd2 gcrypt: Support RSA OAEP SHA1 encryption/decryption 2021-11-10 21:06:10 +01:00
Andreas Steffen b50e8a88ff gcrypt: Enable RSA PKCS1 encryption/decryption 2021-11-10 20:17:49 +01:00
Andreas Steffen be52ad7c6d botan: RSA OAEP labels are not supported 2021-11-10 20:03:22 +01:00
Andreas Steffen 9cfdc32597 wolfssl: Support OAEP labels 2021-11-10 20:03:22 +01:00
Andreas Steffen 6adb543341 openssl: Implemented RSA OAEP encryption/decryption with optional labels 2021-11-10 20:03:22 +01:00
Andreas Steffen 4abb29f639 credentials: Added void *params to public_key encrypt() and private_key decrypt() methods 2021-11-09 17:58:28 +01:00
Andreas Steffen c8341fca61 botan: Fully enable RSA OAEP decryption 2021-11-09 17:58:28 +01:00
Tobias Brunner f4bfdec21f kernel-pfroute: Set lower MTU on TUN devices
The default MTU of 1500 is too high if kernel-libipsec is used (considering
the overhead of UDP-encapsulated ESP), but might also have an effect if
a TUN device is only used to install a virtual IP (the route points to it,
so the system might use its MTU and 1500 would still be too high).

This also works around an issue on macOS 12 where no RTM_IFINFO event
is sent for the newly created TUN device (neither for the creation,
setting it "up", nor adding the address).  Changing the MTU, however,
triggers such an event and we can detect the virtual IP.

Closes strongswan/strongswan#707
2021-11-09 09:43:01 +01:00
Tobias Brunner eb19699a7a ike: Fix length of vendor ID Cisco VPN 3000 client
The actual length of the data is 16 bytes.

Fixes: 6c49ddfbca ("ike: Add additional Vendor IDs for third-party implementations")
2021-11-03 11:01:09 +01:00
Volker Rümelin 9747376c69 ike: Fix prefix length and data of vendor ID Cisco VPN Concentrator
Currently the length of vendor ID Cisco VPN Concentrator is 16
bytes but the string has only 13+1 bytes. The actual vendor
ID has 16 bytes with a prefix length of 14 bytes and two version
bytes.

Fixes: 6c49ddfbca ("ike: Add additional Vendor IDs for third-party implementations")
2021-11-03 11:01:09 +01:00
Volker Rümelin 865a387c6c ikev1: Fix prefix length of vendor ID Cisco Unity
Before commit 6c49ddfbca ("ike: Add additional Vendor IDs for
third-party implementations") the prefix length of vendor ID
Cisco Unity was hardcoded to 14. Since we need to know the actual
length of this VID to send it, the length can't be overloaded
with a prefix length. Revert part of commit 6c49ddfbca to
fix this problem.

Fixes: 6c49ddfbca ("ike: Add additional Vendor IDs for third-party implementations")
2021-11-03 11:00:59 +01:00
Volker Rümelin 5e1d1cd30f ikev1: Fix prefix length of vendor ID MS NT5 ISAKMPOAKLEY
Before commit 6c49ddfbca ("ike: Add additional Vendor IDs for
third-party implementations") the prefix length of vendor ID
MS NT5 ISAKMPOAKLEY was hardcoded to 16. Change the prefix length
accordingly.

Fixes: 6c49ddfbca ("ike: Add additional Vendor IDs for third-party implementations")
2021-11-03 10:25:51 +01:00
Tobias Brunner d1278ed926 Use wolfSSL 5.0.0 for tests 2021-11-02 09:41:25 +01:00
Tobias Brunner e19eb070fa Use Botan 2.18.2 for tests 2021-10-29 09:07:38 +02:00
Andreas Steffen bcbf1862d7 Version bump to 5.9.5dr1 2021-10-26 08:04:19 +02:00
Andreas Steffen f0935a63ed testing: Optimized plugin use in pkcs8 scenarios 2021-10-23 11:44:15 +02:00
Andreas Steffen 9c7288d6f1 testing: Minimum required plugins for net2net-pkcs12 scenarios 2021-10-22 11:39:20 +02:00
Tobias Brunner 8c48de739d testing: Use AES and SHA-256 to protect PKCS#12 files
The -aes128 option is used when encrypting private keys read from a
PKCS#12 file, not when generating such a file.
2021-10-18 14:27:14 +02:00
Andreas Steffen 66fa7c959a Version bump to 5.9.4 2021-10-18 11:45:53 +02:00
Andreas Steffen 8cc89b505e testing: Correctly remove pkcs8 key after test case 2021-10-18 11:45:31 +02:00
Tobias Brunner fed5c7e0d4 NEWS: Add news for 5.9.4 2021-10-18 11:27:29 +02:00
Tobias Brunner d6d31fce23 pkcs8: Don't forward NULL parameters when parsing keys
Other plugins don't expect this build part for RSA keys and will fail
parsing the keys further.
2021-10-18 11:24:11 +02:00
Tobias Brunner 02e4f994ec signature-params: Reject schemes other than RSASSA-PSS with parameters
NULL parameters (for classic PKCS#1 signature schemes) are explicitly
allowed (for any schemes for now), but we only expect parameters for
RSASSA-PSS.  Before enforcing this, it was possible to modify the
parameters in the signatureAlgorithm field of the outer X.509 Certificate
structure to something different than the signature field of the signed,
inner tbsCertificate structure, allowing generating infinite versions
of valid certificates with different binary encodings.  Now we accept at
most two (NULL and absent parameters).
2021-10-14 18:59:07 +02:00
Tobias Brunner f061dedcb7 asn1: Return any parameters of algorithmIdentifier structures
Previously, only parameters of type OID, SEQUENCE and OCTET STRING were
returned (so e.g. random integers could be put in parameters and we
wouldn't know about it).

Log output is basically the same as with asn1_parser_t before, except
that parameters are always dumped (if any), that wasn't the case before
because ASN1_RAW (instead of ASN1_OBJ) was used.
2021-10-14 18:59:07 +02:00
Tobias Brunner dceed8e099 cert-cache: Prevent crash due to integer overflow/sign change
random() allocates values in the range [0, RAND_MAX], with RAND_MAX usually
equaling INT_MAX = 2^31-1.  Previously, values between 0 and 31 were added
directly to that offset before applying`% CACHE_SIZE` to get an index into
the cache array.  If the random value was very high, this resulted in an
integer overflow and a negative index value and, therefore, an out-of-bounds
access of the array and in turn dereferencing invalid pointers when trying
to acquire the read lock.  This most likely results in a segmentation fault.

Fixes: 764e8b2211 ("reimplemented certificate cache")
Fixes: CVE-2021-41991
2021-10-14 18:59:07 +02:00
Tobias Brunner 234302a108 gmp: Reject RSASSA-PSS signatures with negative salt length
The `salt_len` field is signed because negative values are used to indicate
automatic salt lengths when generating signatures.  This must never be the
case when validating them.

Not checking this could lead to an integer overflow below.  The value is
assigned to the `len` field of a chunk (`size_t`), which is further used
in calculations to check the padding structure and (if that is passed by
a matching crafted signature value) eventually a memcpy() that will result
in a segmentation fault.

Fixes: 7d6b81648b ("gmp: Add support for RSASSA-PSS signature verification")
Fixes: CVE-2021-41990
2021-10-14 18:59:07 +02:00
Tobias Brunner 03fbceb3f5 signature-params: Reject RSASSA-PSS params that result in negative salt len
The `salt_len` member in the struct is of type `ssize_t` because we use
negative values for special automatic salt lengths when generating
signatures.  This change ensures that `salt_len` will not overflow the
`len` fields of chunks (`size_t`), which could lead to integer overflows
when validating signatures (see the next commit).

Fixes: a22316520b ("signature-params: Add functions to parse/build ASN.1 RSASSA-PSS params")
2021-10-14 18:59:07 +02:00
Tobias Brunner 2403154f95 pki: Use correct enum value to initialize ID type in --keyid command 2021-10-13 15:17:09 +02:00