Commit Graph

13236 Commits

Author SHA1 Message Date
Tobias Brunner 8eea28063d leak-detective: Use hashtable to cache ignored/whitelisted backtraces
Checking for whitelisted functions in every backtrace is not very
efficient.  And because OpenSSL 1.1 does no proper cleanup anymore until
the process is terminated there are now a lot more "leaks" to ignore.
For instance, in the openssl-ikev2/rw-cert scenario, just starting and
stopping the daemon (test vectors are checked) now causes 3594 whitelisted
leaks compared to the 849 before.  This prolonged the shutdown of the
daemon on each guest in every scenario, amounting to multiple seconds of
additional runtime for every affected scenario.  But even with this
patch there is still some overhead, compared to running the scenarios on
jessie.
2018-11-06 12:27:16 +01:00
Tobias Brunner 0f7055b22c leak-detective: Whitelist additional OpenSSL functions used by libcurl 2018-11-06 12:27:01 +01:00
Tobias Brunner 8b4c2a1d8e openssl: Fix some const issues with OpenSSL 1.1.0 2018-10-31 15:50:36 +01:00
Tobias Brunner fd3947d9e5 openssl: Don't use functions deprecated with OpenSSL 1.1.0 2018-10-31 15:50:36 +01:00
Andreas Steffen 9be6dee6a4 botan: SHA-3 support 2018-10-30 16:06:15 +01:00
Tobias Brunner ce381883a1 dhcp: Ignore DHCP OFFER messages without assigned address
FreeRADIUS seems to respond that way if it can't allocate an address to
the client.
2018-10-26 11:26:50 +02:00
Tobias Brunner 6e9cfe9751 vici: Properly handle absence of peer ID on mediation connections
Fixes #2794.
2018-10-26 11:25:31 +02:00
Tobias Brunner 46bea1add9 task-manager-v2: Reject requests for incomplete IKE_SAs as initiator
Based on a patch by Thomas Egerer.
2018-10-26 11:22:08 +02:00
Tobias Brunner a61b1a6ee4 mysql: Don't release the connection if transactions are still using it
Fixes #2779.
2018-10-26 11:18:43 +02:00
Tobias Brunner 147363c169 botan: Fix build without specific asymmetric crypto 2018-10-26 11:06:45 +02:00
Tobias Brunner 37ae912271 botan: Fix build without AES and its modes 2018-10-26 11:06:45 +02:00
Tobias Brunner 3f960e38a1 botan: Add support for AES-CCM 2018-10-26 11:06:45 +02:00
Tobias Brunner b1ab9782e2 test-vectors: Add another ChaCha20/Poly1305 test vector from RFC 7539 2018-10-26 11:06:45 +02:00
Tobias Brunner cb7b83017d botan: Add support for ChaCha20/Poly1305 AEAD algorithm 2018-10-26 11:06:45 +02:00
Tobias Brunner 4bcc4bacd4 botan: Add support for Ed25519 keys 2018-10-26 11:06:45 +02:00
Tobias Brunner 5cd24d26e2 botan: Add helper function for signature verification 2018-10-26 11:06:45 +02:00
Tobias Brunner 8f23e64ee5 agent: Support signatures with Ed25519/Ed448 keys 2018-10-26 11:01:10 +02:00
Tobias Brunner 87dd08b139 sshkey: Support encoding Ed25519/Ed448 SSH public keys 2018-10-26 11:01:10 +02:00
Tobias Brunner 7de0729357 sshkey: Add support for parsing Ed25519/Ed448 SSH keys 2018-10-26 11:01:10 +02:00
Tobias Brunner 20f74adbae curve25519: Support loading Ed25519 public keys from simple blobs 2018-10-26 11:01:10 +02:00
Tobias Brunner b982473a86 charon-cmd: Print plugin list before parsing arguments
Helps debugging e.g. failures to load certs/keys.
2018-10-26 11:01:10 +02:00
Tobias Brunner 153eb8199a agent: Enumerate only the supported signature schemes for RSA keys
SHA-384 is not supported but is selected by signature_schemes_for_key()
for keys between 3072 and 7680 bits.

Since this is only called for IKEv2 signature authentication we don't
even provide SHA-1 anymore.  We always provide both schemes, though,
which is what pubkey-authenticator does too for RSA.

Older agents apparently just ignore the flags and always return a SHA-1
signature.  If that's the case, charon.signature_authentication has to
be disabled.
2018-10-26 09:55:08 +02:00
Tobias Brunner 5e03675a19 agent: Add support for RSA signatures with SHA256 and SHA512 2018-10-26 09:55:07 +02:00
Andreas Steffen 1b510c0467 pubkey-authenticator: Append RSAPSS salt length to debug output 2018-10-26 09:55:07 +02:00
Andreas Steffen 3150bd2b81 libtpmtss: Generalize AIK keys to signature keys 2018-10-26 09:55:07 +02:00
Andreas Steffen 526c5abd0f tpm: Check FIPS-140-2 and FIPS-186-4 compliance 2018-10-26 09:55:07 +02:00
Tobias Brunner b158404c5f tpm: Return signature schemes supported by the key if TSS supports it 2018-10-26 09:03:27 +02:00
Tobias Brunner 7ca3b3daee libtpmtss: Add enumeration of supported signature schemes to TSS2 implementations 2018-10-26 09:03:27 +02:00
Tobias Brunner 532cd488e3 libtpmtss: TSS can optionally return signature schemes supported by a key 2018-10-26 09:03:26 +02:00
Tobias Brunner ecfe67550d signature-params: Provide option for maximum RSA/PSS salt length
However, the length now has to be resolved early, so we don't operate on
the negative constant values e.g. when generating the encoding.
2018-10-26 09:03:26 +02:00
Tobias Brunner dd4bd21c5a pki: Query private key for supported signature schemes 2018-10-26 09:03:26 +02:00
Tobias Brunner b88f2b3815 pubkey-authenticator: Query private key for supported signature schemes 2018-10-26 09:03:09 +02:00
Tobias Brunner 1c4738325d private-key: Add optional method that returns supported signature schemes 2018-10-25 17:21:32 +02:00
ambiso 6b3dfe9c38 openssl: Remove extra semicolon 2018-10-24 09:49:25 +02:00
ambiso b9e45b5b4a openssl: Remove arbitrary keyid length check 2018-10-24 09:49:18 +02:00
ambiso b148517c6b openssl: Fix invalid keyid length check
Check was designed for base64 conversion, however a hex conversion is
being performed, which requires more memory.
2018-10-24 09:48:56 +02:00
Andreas Steffen d99e73548e libtpmtss: Fixed inclusion of tcti-tabrmd.h header file 2018-10-19 10:46:08 +02:00
Tobias Brunner f18945dfea libvici: Wrap header in extern "C" to include it from C++
Fixes #2795.
2018-10-18 15:14:23 +02:00
Tobias Brunner 537764ea55 android: New release after fixing DNS leak and some bugs 2018-10-17 12:08:47 +02:00
Tobias Brunner 5442e8a161 android: Force the two line button to be focusable
On newer Android versions (8+) this does not seem to be necessary (adding
the onClick handler also sets "clickable" and that in turn seems to make
it focusable), however, for older releases it is (tested with 7.1.1
keyboard navigation just skips over the button).  This was seen on a
Fire TV stick.
2018-10-17 11:56:30 +02:00
Tobias Brunner 84ee9577e1 android: Avoid DNS leak due to blocking TUN device without DNS servers
It looks like Android 9 incorrectly continues to use the regular DNS
servers after the blocking TUN device is replaced with the actual
interface.  Setting DNS servers prevents that (since all traffic is
blocked, which ones doesn't really matter but local/loopback addresses
are rejected).
Interestingly, if the VPN server later does not assign any DNS servers, there
is no fallback to the non-VPN DNS servers for some reason (that's definitely
not as documented).  This could potentially be a problem as we don't
offer an option to configure DNS servers in the VPN profile.

Neither issue is seen on older Android versions (only tested on 7.1.1).
2018-10-17 11:56:30 +02:00
Tobias Brunner e89cfe4854 android: Update Gradle plugin 2018-10-17 11:56:30 +02:00
Tobias Brunner 9fb00bf89f android: Make sure we actually have a tile when updating it
Not sure when this happens exactly, in particular because the reported
stack traces look like this

java.lang.NullPointerException:
  at org.strongswan.android.ui.VpnTileService.updateTile (VpnTileService.java:220)
  at org.strongswan.android.ui.VpnTileService.onStartListening (VpnTileService.java:97)
  at android.service.quicksettings.TileService$H.handleMessage (TileService.java:407)

which violates the API documentation for getQsTile(), which states:

  This tile is only valid for updates between onStartListening() and
  onStopListening().

But apparently that's not always the case. There have been two reports
of such a crash, both on Android 8.0 and on Xiaomi Mi 5/6 devices, so
maybe it's a bug in that particular image.
2018-10-17 11:56:30 +02:00
Tobias Brunner 4bd4750131 android: Fix profile selection/edit when the device is rotated
The previous code lost track of the selected profile IDs, but the
widgets maintained their state (i.e. the list item was still selected and the
edit button still enabled).  Clicking the edit button then caused a crash when
trying to get the first item in the set.
2018-10-17 11:56:30 +02:00
Thomas Egerer a160f100fb ikev1: Log traffic selectors for missing child configs
Signed-off-by: Thomas Egerer <thomas.egerer@secunet.com>
2018-10-17 11:55:16 +02:00
Thomas Egerer 8c732b8e21 task-manager-v1: Clear retransmit alert on request retransmit
The task manager for IKEv1 issues a retransmit send alert in the
retransmit_packet() function. The corresponding retransmit cleared alert
however is only issued for exchanges we initiated after processing the
response in process_response().

For quick mode exchanges we may retransmit the second packet if the peer
(the initiator) does not send the third message in a timely manner. In
this case the retransmit send alert may never be cleared.

With this patch the retransmit cleared alert is issued for packets that
were retransmitted also when we are the responding party when we receive
the outstanding response.

Signed-off-by: Thomas Egerer <thomas.egerer@secunet.com>
2018-10-17 11:55:16 +02:00
Andreas Steffen 2d3e20a839 sec-updater.sh: Support of Debian 9.0 and Ubuntu 18.04 2018-10-07 10:14:20 +02:00
Matt Selsky b98db90763 swanctl: Fix typos in usage for swanctl rekey/terminate commands
Closes strongswan/strongswan#113.
2018-10-02 09:30:03 +02:00
Tobias Brunner 129ab919a8 gmp: Fix buffer overflow with very small RSA keys
Because `keylen` is unsigned the subtraction results in an integer
underflow if the key length is < 11 bytes.

This is only a problem when verifying signatures with a public key (for
private keys the plugin enforces a minimum modulus length) and to do so
we usually only use trusted keys.  However, the x509 plugin actually
calls issued_by() on a parsed certificate to check if it is self-signed,
which is the reason this issue was found by OSS-Fuzz in the first place.
So, unfortunately, this can be triggered by sending an invalid client
cert to a peer.

Fixes: 5955db5b12 ("gmp: Don't parse PKCS1 v1.5 RSA signatures to verify them")
Fixes: CVE-2018-17540
2018-09-26 10:10:48 +02:00
Tobias Brunner 5955db5b12 gmp: Don't parse PKCS1 v1.5 RSA signatures to verify them
Instead we generate the expected signature encoding and compare it to the
decrypted value.

Due to the lenient nature of the previous parsing code (minimum padding
length was not enforced, the algorithmIdentifier/OID parser accepts arbitrary
data after OIDs and in the parameters field etc.) it was susceptible to
Daniel Bleichenbacher's low-exponent attack (from 2006!), which allowed
forging signatures for keys that use low public exponents (i.e. e=3).

Since the public exponent is usually set to 0x10001 (65537) since quite a
while, the flaws in the previous code should not have had that much of a
practical impact in recent years.

Fixes: CVE-2018-16151, CVE-2018-16152
2018-09-21 18:51:58 +02:00