Commit Graph

12948 Commits

Author SHA1 Message Date
Tobias Brunner 3c36c95539 kernel-netlink: Fix compilation on old kernels not defining IFA_F_NODAD
Fixes #2490.
2017-12-22 10:28:05 +01:00
Tobias Brunner 381f6d982c kernel-pfkey: Fix extended replay configuration on FreeBSD 11.1
Fixes: 88a8fba1c7 ("kernel-pfkey: Support anti-replay windows > 2k")
Fixes #2501.
2017-12-22 10:19:49 +01:00
Tobias Brunner 6d98bb926e swanctl: Allow dots in authority/shared secret/pool names
Use argument evaluation provided by settings_t instead of using strings
to enumerate key/values.

If section names contain dots the latter causes the names to get split
and interpreted as non-existing sections and subsections.

This currently doesn't work for connections and their subsections due to
the recursion.
2017-12-22 10:11:21 +01:00
Tobias Brunner a7f613ca2e vici: Document NTLM secrets in README.md
Fixes #2481.
2017-12-22 10:09:26 +01:00
Tobias Brunner 859d645c44 vici: Accept XAUTH as shared key type too
Fixes #2481.
2017-12-22 10:09:22 +01:00
Lubomir Rintel 9a71b7219c charon-nm: Port to libnm
libnm-glib is deprecated for several years and reaching the end of its
life. Let's switch to the more up-to-date library.

Closes strongswan/strongswan#85.
2017-12-22 10:05:10 +01:00
Andreas Steffen 0fb293fc91 tpm_extendpcr: Extend digests into a TPM PCR 2017-12-13 07:10:28 +01:00
Andreas Steffen ee402a22a3 asn1: Added tlsfeature OID 2017-12-10 19:56:14 +01:00
Andreas Steffen 3e7a19bfa9 pki: Extend pki --print with --keyid parameter 2017-12-10 19:31:10 +01:00
Andreas Steffen acfd590ab6 imc-os: Derive device ID from private key bound to smartcard or TPM 2017-12-10 11:51:50 +01:00
Eyal Birger 2389168388 ipsec-types: Don't mask the mark value if it is one of the 'unique' values
Support for mark=%unique/%unique-dir is implemented by using designated
magic mark values.

Use of masks is orthogonal to the 'unique' feature, as it is useful to be
able to designate portions of the packet mark for other purposes, while
still using different marks for different connections.

When these magic values are masked, their magic meaning is lost.

Perform masking only on explicit mark values.

Closes strongswan/strongswan#87.
2017-12-07 09:36:53 +01:00
Lubomir Rintel ee22e8080f nm: Allow disabling libnm-glib
The distros are eventually going to drop it, allow omitting it.

Closes strongswan/strongswan#86.
2017-12-06 11:13:03 +01:00
Andreas Steffen 71cf3d709a pt-tls-client: Load certificates via handle from smartcard or TPM 2017-12-05 21:31:31 +01:00
Andreas Steffen e850d000b8 libtpmtss: Load X.509 certificates from TPM 2.0 NV RAM 2017-12-05 21:31:31 +01:00
Andreas Steffen fb1cf320a2 libtpmtss: Extend TPM 2.0 capability info 2017-12-05 21:31:31 +01:00
Tobias Brunner 0729be1bfe Merge branch 'android-proposals'
Makes IKE and ESP proposals configurable.
2017-11-28 16:23:41 +01:00
Tobias Brunner 4a79434b11 android: Remove modp1024 from the ESP proposals 2017-11-28 16:19:08 +01:00
Tobias Brunner 5a6f687bdf android: New release after adding configurable proposals 2017-11-17 18:11:43 +01:00
Tobias Brunner b03713add4 android: Validate proposal strings when importing profiles 2017-11-17 18:11:43 +01:00
Tobias Brunner 9f962f6c19 android: Validate proposal strings in the GUI 2017-11-17 18:11:43 +01:00
Tobias Brunner 836a943804 android: Add utility JNI function to validate proposal strings 2017-11-17 18:11:39 +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 92c1b52487 android: Load JNI libraries in Application class
This way they are also loaded when we don't use CharonVpnService.
2017-11-17 18:05:35 +01:00
Tobias Brunner 2d1f65feb3 android: Make IKE/ESP proposals configurable in the GUI 2017-11-17 18:05:35 +01:00
Tobias Brunner 6403ad5457 android: Import IKE/ESP proposals
We currently don't validate them here, only when used later will they
get parsed (which includes some checks).
2017-11-17 14:31:06 +01:00
Tobias Brunner a7c43544dd android: Use optional custom proposals for IKE and ESP
If the proposal is invalid we fall back to the defaults.
2017-11-17 14:31:06 +01:00
Tobias Brunner 24c22a3fa8 android: Add properties for IKE and ESP proposals 2017-11-17 14:31:06 +01:00
Tobias Brunner 8b6c23342c android: Free settings string passed via JNI 2017-11-17 14:31:06 +01:00
Tobias Brunner f7a73fe0f7 hashers: Change names of SHA2 hash algorithms
Keep the lower case names as they are as we use them internally (parsing
and e.g. in OpenSSL as identifier).
2017-11-17 09:32:47 +01:00
Tobias Brunner 36ae037b81 ikev2: Add hash algorithm used for RSASSA-PSS signature to log message 2017-11-17 09:30:53 +01:00
Tobias Brunner dfd5f090fb hasher: Add uppercase short names for hash algorithms 2017-11-17 09:30:53 +01:00
Tobias Brunner 7a659c0f99 x509: Initialize signature params when parsing attribute certificates 2017-11-15 14:41:56 +01:00
Tobias Brunner 26d18f4efb sw-collector: Unmap history file on failure to instantiate extractor 2017-11-15 14:40:10 +01:00
Tobias Brunner 42353849cb charon: Explicitly check return value of fileno()
This is mainly for Coverity because fchown() can't take a negative
value, which the -1 check implies is possible.
2017-11-15 14:37:43 +01:00
Tobias Brunner be79839ea7 pkcs8: Add explicit comment for RSASSA-PSS fall-through 2017-11-15 14:33:05 +01:00
Tobias Brunner 7f1d944bc9 The pacman tool got replaced by the sec-updater tool 2017-11-15 12:18:17 +01:00
Tobias Brunner 527b3f0ca5 Fixed some typos, courtesy of codespell 2017-11-15 10:21:13 +01:00
Tobias Brunner c87b16d256 swanctl: Add check for conflicting short options 2017-11-13 10:09:41 +01:00
Tobias Brunner f0c7cbd1d7 swanctl: Properly register --counters commmand
Use C instead of c, which is already used for --load-conns.
2017-11-13 09:45:14 +01:00
Andreas Steffen 7df35af7cc libimcv: Updated imv database 2017-11-11 16:41:16 +01:00
Andreas Steffen 0d63255513 libtpmtss: Added missing argument in hasher_from_signature_scheme() 2017-11-10 11:47:27 +01:00
Tobias Brunner 291b02262d charon-tkm: Unlink PID file after deinit
Same change as for charon in the previous commit.

References #2460.
2017-11-10 10:56:13 +01:00
Tobias Brunner 1b4d97dbb7 charon: Unlink PID file after daemon deinit (i.e. after unloading plugins etc.)
Make sure, though, that we only remove the file if we actually
created it (e.g. not for --help or --version).  And do so before
deinitializing libstrongswan due to leak detective.

Fixes #2460.
2017-11-10 10:55:43 +01:00
Thomas Egerer 9cc61baaf5 unit-tests: Rename targets for libstrongswan and kernel-netlink
libstrongswan and kernel-netlink are the only two components which do
not adhere to the naming scheme used for all other tests. If the tests
are run by an external application this imposes problems due to clashing
names.

Signed-off-by: Thomas Egerer <thomas.egerer@secunet.com>
2017-11-09 09:11:42 +01:00
Tobias Brunner fde0c763b6 auth-cfg: Add RSA/PSS schemes for pubkey and rsa if enabled in strongswan.conf
Also document the rsa/pss prefix.
2017-11-08 16:48:10 +01:00
Tobias Brunner 27a79326c7 pki: Enable PSS padding if enabled in strongswan.conf 2017-11-08 16:48:10 +01:00
Tobias Brunner d57af8dde0 pki: Optionally generate RSA/PSS signatures 2017-11-08 16:48:10 +01:00
Tobias Brunner 9b828ee85f pki: Indent usage lines properly automatically 2017-11-08 16:48:10 +01:00
Tobias Brunner 364395d2de Treat RSASSA-PSS keys like rsaEncryption RSA keys
In theory we should treat any parameters and the identifier itself as
restriction to only use the key to create signatures accordingly (e.g.
only use RSA with PSS padding or even use specific hash algorithms).
But that's currently tricky as we'd have to store and pass this information
along with our private keys (i.e. use PKCS#8 to store them and change the
builder calls to pass along the identifier and parameters). That would
require quite some work.
2017-11-08 16:48:10 +01:00
Tobias Brunner fb63012e0c openssl: Add support for signature schemes with parameters 2017-11-08 16:48:10 +01:00
Tobias Brunner dc83bc147e pki: Properly forward digest to attribute certificate builder 2017-11-08 16:48:10 +01:00
Tobias Brunner bbfe39f597 x509: Add support for signature schemes with parameters
Also adds support for specifying the hash algorithm for attribute
certificate signatures.
2017-11-08 16:48:10 +01:00
Tobias Brunner 0c23a5693c builder: Add builder option to pass signature scheme and params 2017-11-08 16:48:10 +01:00
Tobias Brunner 3fc66e5743 ikev2: Use helpers to build signature auth data 2017-11-08 16:48:10 +01:00
Tobias Brunner eae80fdedc signature-params: Add helpers to parse/build ASN.1 algorithmIdentifier for signature schemes 2017-11-08 16:48:10 +01:00
Tobias Brunner 6f97c0d50b ikev2: Enumerate RSA/PSS schemes and use them if enabled 2017-11-08 16:48:10 +01:00
Tobias Brunner 24b2ede283 ikev2: Support signing with RSASSA-PSS via RFC 7427 signature auth 2017-11-08 16:48:10 +01:00
Tobias Brunner a4aaef7477 signature-params: Use helper to build MGF1 algorithmIdentifier 2017-11-08 16:48:10 +01:00
Tobias Brunner f89348d035 asn1: Add helper function to create algorithmIdentifier with parameters 2017-11-08 16:48:10 +01:00
Tobias Brunner 5f7be58177 ikev2: Verify RSASSA-PSS signatures via RFC 7427 signature auth 2017-11-08 16:48:10 +01:00
Tobias Brunner 84b1c06d0e keymat_v2: Pass/receive signature schemes as signature_param_t objects 2017-11-08 16:48:10 +01:00
Tobias Brunner 634c6ba8ce auth-cfg: Parse rsa/pss auth tokens 2017-11-08 16:48:10 +01:00
Tobias Brunner 54f8d09261 auth-cfg: Store signature schemes as signature_params_t objects
Due to circular references the hasher_from_signature_scheme() helper
does not take a signature_params_t object.
2017-11-08 16:48:10 +01:00
Tobias Brunner 024b979522 certificate: Return signature scheme and parameters from issued_by() method
This also required some include restructuring (avoid including library.h
in headers) to avoid unresolvable circular dependencies.
2017-11-08 16:48:10 +01:00
Tobias Brunner c2935b03c4 signature-params: Add helper struct for signature scheme and parameters 2017-11-08 16:48:10 +01:00
Tobias Brunner 72b7c0ffd8 android: Add support for creating RSASSA-PSS signatures via JNI 2017-11-08 16:48:10 +01:00
Tobias Brunner 414f255561 unit-tests: Add RSA-PSS signature tests with specific salts 2017-11-08 16:48:10 +01:00
Tobias Brunner 37efb9787b gcrypt: Add support for static salts when signing with RSA-PSS 2017-11-08 16:48:10 +01:00
Tobias Brunner f241a981aa gmp: Add support for static salts when signing with RSA-PSS 2017-11-08 16:48:10 +01:00
Tobias Brunner c380608a89 signature-params: Optionally pass a specific salt value when signing 2017-11-08 16:48:10 +01:00
Tobias Brunner fa7f5e2d0c unit-tests: Warn if we skip RSA tests due to dependencies 2017-11-08 16:48:10 +01:00
Tobias Brunner 4c5dd39aa3 unit-tests: Add ability to issue a warning message for a test case
This way we can warn if we e.g. skipped actually doing something due to
dependencies (otherwise the test case would just appear to have succeeded).
2017-11-08 16:48:10 +01:00
Tobias Brunner 90a3bc5075 mgf1: Add support for SHA-224/384 based MGF1 2017-11-08 16:48:10 +01:00
Tobias Brunner 720a76c229 xof: Add identifiers for MGF1 XOFs based on SHA-224/384 2017-11-08 16:48:10 +01:00
Tobias Brunner 126fd8af09 gmp: Use helper to determine XOF type 2017-11-08 16:48:10 +01:00
Tobias Brunner 883e7fcd65 xof: Add helper to determine MGF1 XOF type from hash algorithm 2017-11-08 16:48:10 +01:00
Tobias Brunner 3ce8b0556a gcrypt: Add support for RSA-PSS signatures
For salt lengths other than 20 this requires 0bd8137e68c2 ("cipher:
Add option to specify salt length for PSS verification."), which was
included in libgcrypt 1.7.0 (for Ubuntu requires 17.04).  As that makes
it pretty much useless for us (SHA-1 is a MUST NOT), we require that version
to even provide the feature.
2017-11-08 16:48:10 +01:00
Tobias Brunner 89c3987baf gcrypt: Register supported RSA signature/verification schemes 2017-11-08 16:48:10 +01:00
Tobias Brunner 7d6b81648b gmp: Add support for RSASSA-PSS signature verification 2017-11-08 16:48:10 +01:00
Tobias Brunner 154ee7f66a gmp: Add support for RSASSA-PSS signature creation 2017-11-08 16:48:10 +01:00
Tobias Brunner 00d161f2db unit-tests: Add FIPS 186-4 RSASSA-PSS test vectors
Since not all implementations allow setting a specific salt value when
generating signatures (e.g. OpenSSL doesn't), we are often limited to
only using the test vectors with salt length of 0.

We also exclude test vectors with SHA-1, SHA-224 and SHA-384.
2017-11-08 16:48:10 +01:00
Tobias Brunner 89015dff9e unit-tests: Create and verify some RSA PSS signatures 2017-11-08 16:48:10 +01:00
Tobias Brunner 2f95d7195d openssl: Add support for verifying RSASSA-PSS signatures 2017-11-08 16:48:10 +01:00
Tobias Brunner 51dd2fd2db openssl: Add support for creating RSASSA-PSS signatures 2017-11-08 16:48:10 +01:00
Tobias Brunner 5ae3f5cea8 openssl: Add helper to determine EVP_MD from hash_algorithm_t 2017-11-08 16:48:10 +01:00
Tobias Brunner a994407d50 unit-tests: Add FIPS 186-4 RSA test vectors
Excluding SHA-224 and the stuff from FIPS 186-2 (SHA-1, 1024 bit keys).
2017-11-08 16:48:10 +01:00
Tobias Brunner 183a9108fb gcrypt: Determine missing RSA private key parameters
We only need n, e, and d.  The primes p and q and the coefficient
for the Chinese remainder algorithm can be determined from these.
2017-11-08 16:48:10 +01:00
Tobias Brunner bd4df68a7b gmp: Determine missing RSA private key parameters
We only need n, e, and d.  The parameters for the Chinese remainder
algorithm and even p and q can be determined from these.
2017-11-08 16:48:10 +01:00
Tobias Brunner 03eda5a822 openssl: Add functions to determine missing RSA private key parameters
We only need n, e, and d.  The parameters for the Chinese remainder
algorithm and even p and q can be determined from these.
2017-11-08 16:48:10 +01:00
Tobias Brunner a22316520b signature-params: Add functions to parse/build ASN.1 RSASSA-PSS params 2017-11-08 16:48:10 +01:00
Tobias Brunner c2b878cd61 hasher: Add function to determine length of hashes 2017-11-08 16:48:10 +01:00
Tobias Brunner ffd0eeecf0 asn1: Add function to generate an ASN.1 integer from an uint64_t 2017-11-08 16:48:10 +01:00
Tobias Brunner bfe1cb3a94 asn1: Add OID for MGF1 2017-11-08 16:48:10 +01:00
Tobias Brunner d03c5b7994 signature-params: Add struct for RSASSA-PSS parameters 2017-11-08 16:48:10 +01:00
Tobias Brunner de280c2e03 private-key: Add optional parameters argument to sign() method 2017-11-08 16:48:10 +01:00
Tobias Brunner a413571f3b public-key: Add optional parameters argument to verify() method 2017-11-08 16:48:10 +01:00
Tobias Brunner 677072accc public-key: Add RSASSA-PSS signature scheme identifier 2017-11-08 16:48:10 +01:00
Tobias Brunner 69502f5afd asn1: Add OID for RSASSA-PSS 2017-11-08 16:48:10 +01:00
Tobias Brunner 43b59d1323 ikev2: Don't use SHA-1 for RFC 7427 signature authentication
RFC 8247 demoted it to MUST NOT.

References #2427.
2017-11-08 16:47:24 +01:00
Tobias Brunner 76c58498ef proposal: Remove MODP-1024 from default IKE proposal
RFC 8247 demoted it to SHOULD NOT. This might break connections with
Windows clients unless they are configured to use a stronger group or
matching weak proposals are configured explicitly on the server.

References #2427.
2017-11-08 16:47:16 +01:00
Tobias Brunner 10da451fc3 proposal: Remove MD5 from default IKE proposal
RFC 8247 demoted MD5 to MUST NOT.

References #2427.
2017-11-08 16:47:04 +01:00
Tobias Brunner 2294606aa5 proposal: Remove deprecated algorithms from default ESP and AH proposals
This removes algorithms that were deprecated by RFC 8221 (3DES, BF, MD5)
from the default proposals for ESP and AH.

References #8247.
2017-11-08 16:46:51 +01:00
Tobias Brunner 0a6fbe8f7e pool: Destroy enumerator before deleting existing pool
The MySQL client doesn't like overlapping queries on the same
connection, so we make sure to destroy the enumerator used to check for
an existing pool before deleting it when --replace is used.
2017-11-08 16:40:14 +01:00
Tobias Brunner 88a8fba1c7 kernel-pfkey: Support anti-replay windows > 2k
FreeBSD 11.1 supports a new extension to configure larger anti-replay
windows, now configured as number of packets.

Fixes #2461.
2017-11-08 16:35:38 +01:00
Tobias Brunner 21a500a092 kernel-pfkey: Don't include keys in SADB_UPDATE message to update IPs on FreeBSD
The FreeBSD kernel explicitly rejects messages containing keys for mature SAs.

Fixes #2457.
2017-11-08 16:34:12 +01:00
Tobias Brunner 052bccfac4 swanctl: Add --counters command 2017-11-08 16:28:28 +01:00
Tobias Brunner fdf33b0f1c vici: Add 'get|reset-counters' commands 2017-11-08 16:28:28 +01:00
Tobias Brunner 6f74b8748a counters: Move IKE event counter collection from stroke to a separate plugin 2017-11-08 16:28:28 +01:00
Tobias Brunner c81b87ac26 systime-fix: Add timeout option to stop waiting for valid system time
A certificate check is forced once the timeout is reached even if the
system time appears to be invalid.
2017-11-08 16:20:35 +01:00
Tobias Brunner 1fe71a50f1 android: Add log message if failed to retrieve user certificate encoding 2017-11-02 12:19:36 +01:00
Tobias Brunner 6ebf852c3f shunt-mananger: Make outbound FWD shunt policies optional 2017-11-02 10:47:53 +01:00
Thomas Egerer 2dad293647 ike: Do not send initial contact only for UNIQUE_NEVER
Signed-off-by: Thomas Egerer <thomas.egerer@secunet.com>
2017-11-02 10:17:24 +01:00
Tobias Brunner 6ce7ae24a4 pkcs11: Call C_Finalize() to cancel jobs waiting in C_WaitForSlotEvent()
This is not ideal as the call to C_Finalize() should be the last one via
the PKCS#11 API.  Since the order in which jobs are canceled is undefined
we can't be sure there is no other thread still using the library (it could
even be the canceled job that still handles a previous slot event).
According to PKCS#11 the behavior of C_Finalize() is undefined while other
threads still make calls over the API.

However, canceling the thread, as done previously, could also be problematic
as PKCS#11 libraries could hold locks while in the C_WaitForSlotEvent() call,
which might not get released properly when the thread is just canceled,
and which then might cause later calls to other API functions to block.

Fixes #2437.
2017-11-02 10:15:32 +01:00
Tobias Brunner bf23ca09cb pool: Make pool timeout configurable in other units than hours 2017-11-02 10:04:03 +01:00
Tobias Brunner b93ebb4ea9 utils: Add helper function to parse time spans from strings 2017-11-02 10:04:03 +01:00
Tobias Brunner c782d367c6 asn1: Add additional OIDs seen in certificate DNs 2017-11-02 10:02:26 +01:00
Tobias Brunner 2d244f178f vici: Make setting mark on inbound SA configurable 2017-11-02 09:59:38 +01:00
Tobias Brunner ea43f8ffe5 child-cfg: Optionally set mark on inbound SA 2017-11-02 09:59:38 +01:00
Tobias Brunner 655924074b eap-radius: Optionally send Class attributes in RADIUS accounting messages
If enabled, add the RADIUS Class attributes received in Access-Accept messages
to RADIUS accounting messages as suggested by RFC 2865 section 5.25.

Fixes #2451.
2017-11-02 09:57:05 +01:00
Tobias Brunner 26bda4e904 ikev2: Abort make-before-break reauth if we don't find children to recreate
We do something similar in reestablish() for break-before-make reauth.
If we don't abort we'd be sending an IKE_AUTH without any TS payloads.

References #2430.
2017-11-02 09:48:56 +01:00
Tobias Brunner b2266280ef openssl: Also load EC keys from an ENGINE 2017-11-02 09:42:52 +01:00
Andreas Steffen 7f86b0f639 libcharon: Added Cisco FlexVPN Supported VID 2017-10-27 20:14:57 +02:00
Tobias Brunner 7a708b5ccd unit-tests: Fix "using integer constants in boolean context" warning
This warning has been seen in GCC 7.x with -Wall, however, because == has
higher precedence than ?: the code was actually not correct.
2017-10-23 15:13:10 +02:00
Tobias Brunner d889f20ca1 streams: Remove registered systemd stream service
Fixes: 59db98fb94 ("stream: Add basic stream service for systemd sockets")
2017-10-18 09:25:15 +02:00
Tobias Brunner 23e76d250f streams: Named systemd sockets are only supported since systemd v227 2017-10-13 10:17:37 +02:00
Tobias Brunner a97de61e78 starter: Add the correct keywords header file to EXTRA_DIST
The fix for gperf in 0ae19f0ced added the generated header to
EXTRA_DIST but that's already added to the distribution because it is
contained in *_SOURCES, what was not added, though, was the .h.in file.

Also fixes the reference to the header file in the .c rule here and for
stroke in out-of-tree builds.

Fixes: 0ae19f0ced ("configure: Fix gperf length parameter determination")
2017-10-12 09:09:12 +02:00
Tobias Brunner 0d08959a04 watcher: Don't notify watcher if removed FD was not found
This can happen if a stream is used blocking exclusively (the FD is
never registered with watcher, but is removed in the stream's destructor
just in case it ever was - doing this conditionally would require an
additional flag in streams).  There may be no thread reading from
the read end of the notify pipe (e.g. in starter), causing the write
to the notify pipe to block after it's full.  Anyway, doing a relatively
expensive FD update is unnecessary if there were no changes.

Fixes #1453.
2017-10-10 11:13:53 +02:00
aszlig 59db98fb94 stream: Add basic stream service for systemd sockets
This allows systemd socket activation by passing URIs such as systemd://foo
to plugins such as VICI.

For example setting charon.plugins.vici.socket = systemd://vici, a
systemd socket file descriptor with the name "vici" will be picked up.

So these would be the corresponding unit options:

  [Socket]
  FileDescriptorName=vici
  Service=strongswan.service

  ListenStream=/run/charon.vici

The implementation currently is very basic and right now only the first
file descriptor for a particular identifier is picked up if there are
multiple socket units with the same FileDescriptorName.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>

Closes strongswan/strongswan#79.
2017-10-10 11:11:11 +02:00
Tobias Brunner ea613d5d27 starter: Don't define any hard-coded proposal strings
Just rely on the default proposals by charon if nothing is defined. The
hard-coded IKE proposal used curve25519, which depends on an optional
plugin (while enabled by default it might still not be loaded, or, like
on Debian, shipped in an optional package). With charon's default
proposal only loaded algorithms are proposed for IKE avoiding this issue.
2017-10-10 11:04:17 +02:00
Tobias Brunner 78acaba6a1 openssl: Fix call of X509_CRL_get0_signature() with OpenSSL 1.1.0
The order of arguments in X509_CRL_get0_signature() is not the same as that
of X509_get0_signature().

Fixes: 989ba4b6cd ("openssl: Update CRL API to OpenSSL 1.1.0")
2017-10-10 10:09:08 +02:00
Tobias Brunner e1803a208a kernel-netlink: Add strings for newer XFRM attribute types 2017-10-06 16:41:09 +02:00
Tobias Brunner 0ae19f0ced configure: Fix gperf length parameter determination
gperf is not actually a build dependency as the generated files are
shipped in the tarball.  So the type depends on the gperf version on
the host that ran gperf and created the tarball, which might not be
the same as that on the actual build host, and gperf might not even
be installed there, leaving the type undetermined.

Fixes: e0e4322973 ("configure: Detect type of length parameter for gperf generated function")
2017-10-02 17:21:42 +02:00
Andreas Steffen 7dd29ab4ed libimcv: Renamed SW Request to SWIMA Request 2017-09-27 10:01:56 +02:00
Andreas Steffen be7020dace SWIMA attribute name changes
draft-ietf-sacm-nea-swima-patnc-01 changes some SWIMA attribute
names.
2017-09-26 20:35:39 +02:00
Tobias Brunner 039b85dd43 kernel-pfroute: Delay call to if_indextoname(3) when handling RTM_IFINFO
It seems that there is a race, at least in 10.13, that lets
if_indextoname() fail for the new TUN device. So we delay the call a bit,
which seems to "fix" the issue. It's strange anyway that the previous
delay was only applied when an iface entry was already found.
2017-09-26 09:33:46 +02:00
Tobias Brunner ab7d5e32d3 controller: Consider any IKE_SA destruction as success when terminating 2017-09-25 18:40:55 +02:00
Tobias Brunner e0e4322973 configure: Detect type of length parameter for gperf generated function
Since 3.1 gperf uses size_t for the length parameter instead of an
unsigned int.
2017-09-19 13:24:43 +02:00
Tobias Brunner d4593353c9 utils: Include stdint.h
Recent releases of glibc don't include the full stdint.h header in some
network headers included by utils.h.  So uintptr_t might not be defined.
Since we use fixed width integers, including the latter, all over the place
we make sure the complete file is included.

Fixes #2425.
2017-09-19 13:24:39 +02:00
Tobias Brunner c21fff303a sec-updater: Make sure `success` is initialized 2017-09-18 12:16:54 +02:00
Tobias Brunner e433d512f4 dhcp: Fix warning regarding unaligned pointer value due to packed struct
We don't need to access this as uint32_t so just cast it to a char*.
2017-09-18 12:16:54 +02:00
Tobias Brunner 787cc3a4e5 dhcp: Don't use signed char for DHCP options
The value of DHCP_OPTEND is 255.  When it is assigned this result in a
sign change as the positive int constant is cast to a signed char and -1
results. Clang 4.0 complains about this.
2017-09-18 12:16:54 +02:00
Tobias Brunner d04deff4df imv-agent: Fix get_attribute() call for preferred language 2017-09-18 12:16:54 +02:00
Tobias Brunner 7e7800e0a3 bliss: Fix compile error of unit tests due to uninitialized variable 2017-09-18 12:16:54 +02:00
Tobias Brunner 7cecc98e8a settings: Fix possible undefined behavior with va_start() and bool
This fixes compilation with -Werror when using Clang 4.0 (but not 3.9)
and possibly prevents undefined behavior.

According to the C standard the following applies to the second
parameter of the va_start() macro (subclause 7.16.1.4, paragraph 4):

  The parameter parmN is the identifier of the rightmost parameter
  in the variable parameter list in the function definition (the
  one just before the ...). If the parameter parmN is declared with
  the register storage class, with a function or array type, or with
  a type that is not compatible with the type that results after
  application of the default argument promotions, the behavior is
  undefined.

Because bool is usually just 1 byte and therefore smaller than int (i.e.
the result of default argument promotion) its use as last argument before
... might result in undefined behavior.  This theoretically can also
apply to enums as a compiler may use a smaller base type than int.

Since Clang 3.9 (currently in use on Travis by default) a warning is
issued about this, however, that version did not yet compare the actual
size of the argument's type, causing warnings where they are not
warranted (basically for all cases where enum types are used for the
last argument).  This was apparently fixed with Clang 4.0, which only
warns about this use of bool with va_start(), which makes sense.
2017-09-18 12:07:26 +02:00
Tobias Brunner 46a62f0126 Define MODP_CUSTOM constructors as variadic functions
They now match the dh_constructor_t signature.  This is a follow up for
the changes merged with b668bf3f9e and should fix use of MODP_CUSTOM on
Apple's ARM64 platform.
2017-09-18 12:07:26 +02:00
Tobias Brunner f871b341d7 libtnccs: Correctly read dlopen_use_rtld_now option
Fixes: 50e4aeb22f ("libtnccs: Optionally use RTLD_NOW to load IMC/IMVs with dlopen()")
2017-09-18 12:07:26 +02:00
Tobias Brunner ddfb5dd44a plugin-loader: Correctly read dlopen_use_rtld_now option
Fixes: 305c4aa82c ("plugin-loader: Optionally use RTLD_NOW with dlopen()")
2017-09-18 12:07:26 +02:00
Tobias Brunner d3e1beaad5 android: New release after adding delta CRL support and some bug fixes 2017-09-18 11:04:46 +02:00
Tobias Brunner 66b7a08884 android: Ignore IllegalArgumentException for multicast addresses
Some Android versions seem to reject routes that use multicast addresses.

Fixes #2420.
2017-09-18 11:00:58 +02:00
Tobias Brunner 86c10a958f openssl: Add support for delta CRLs 2017-09-18 10:54:31 +02:00
Tobias Brunner 4e7b7db62f certificates: Use shared destructor for x509_cdp_t 2017-09-18 10:54:19 +02:00
Tobias Brunner e7276f78aa child-create: Don't consider a DH group mismatch as failure as responder
This causes problems e.g. on Android where we handle the alert (and
reestablish the IKE_SA) even though it usually is no problem if the
peer retries with the requested group.  We don't consider it as a
failure on the initiator either.
2017-09-18 10:51:39 +02:00
Tobias Brunner 6e861947a0 libipsec: Make sure to expire the right SA
If an IPsec SA is actually replaced with a rekeying its entry in the
manager is freed. That means that when the hard expire is triggered a
new entry might be found at the cached pointer location.  So we have
to make sure we trigger the expire only if we found the right SA.

We could use SPI and addresses for the lookup, but this here requires
a bit less memory and is just a small change. Another option would be to
somehow cancel the queued job, but our scheduler doesn't allow that at
the moment.

Fixes #2399.
2017-09-18 10:51:39 +02:00
Tobias Brunner bdcaca76c5 ip-packet: Correctly determine protocol in fragmented IPv6 packets
We don't attempt to parse the transport headers for fragments, not even
for the initial fragment (it's not guaranteed they contain the header,
depending on the number and type of extension headers).
2017-09-18 10:28:54 +02:00
Tobias Brunner b3cc46381d ip-packet: Fix "packet too short" error when parsing fragmented IPv4 packets
Only attempt to parse the transport header of an IPv4 packet if it's
not fragmented or the first fragment.
2017-09-18 10:28:54 +02:00
Adrian-Ken Rueegsegger fc08e6af8a charon-tkm: Reset ESA on child SA create failure
Since we are also releasing the ESA ID we have to make sure that the ESA
context is reset and in a clean state in order for it to be actually
reusable.
2017-09-15 12:16:57 +02:00
Adrian-Ken Rueegsegger 59e7298ff9 charon-tkm: Check for error when acquiring ESA ID 2017-09-15 12:16:57 +02:00
Adrian-Ken Rueegsegger 8e823bb8b1 charon-tkm: Fix AE context life-cycle handling
Use new reference counting feature of ID manager for AE contexts and
only perform reset if count is zero. Also, do not pass on AE ID as every
IKE SA must decrement AE ID count once it is not used any longer.
2017-09-15 12:16:57 +02:00
Adrian-Ken Rueegsegger c198ddcb3f charon-tkm: Return current refcount when releasing ID 2017-09-15 12:16:57 +02:00
Adrian-Ken Rueegsegger 1b2a8d963a charon-tkm: Add acquire_ref method to ID manager
The function acquires a reference to the given context reference id for
a specific context kind.
2017-09-15 12:16:57 +02:00
Adrian-Ken Rueegsegger fcde9686f6 charon-tkm: Store context ids as int instead of bool
This is in preparation of making context ids refcountable.
2017-09-15 12:16:57 +02:00
Adrian-Ken Rueegsegger d35ebfbce1 charon-tkm: Add missing whitespace log message 2017-09-15 12:16:57 +02:00
Tobias Brunner da479ae2c9 child-delete: Only let SAs expire naturally if they not already did 2017-09-15 12:16:45 +02:00
Andreas Steffen 8aad7ffb11 sec-updater: Import SWID tags of updated packages
sec-updater downloads the deb package files from security updates from
a given linux repository and uses the swid_generator command to
derive a SWID tag. The SWID tag is then imported into strongTNC
using the manage.py importswid command.
2017-09-09 20:23:19 +02:00
Andreas Steffen 33a729fac2 libimcv: Corrected caption 2017-09-09 13:10:45 +02:00
Andreas Steffen 165d28174d pt-tls-client: Introduced --options as a synonym for --optionsfrom 2017-09-09 10:31:02 +02:00
Andreas Steffen 94bdd463d8 sec-updater: Write to log only if at least one update is found. 2017-09-07 14:54:41 +02:00
Tobias Brunner 311d931aef android: New release after adding OCSP, CRL cache and some other stuff 2017-09-04 11:27:40 +02:00
Tobias Brunner c353996191 ike: Reset local SPI if retrying to connect in state IKE_CONNECTING
In case we send retransmits for an IKE_SA_INIT where we propose a DH
group the responder will reject we might later receive delayed responses
that either contain INVALID_KE_PAYLOAD notifies with the group we already
use or, if we retransmitted an IKE_SA_INIT with the requested group but
then had to restart again, a KE payload with a group different from the
one we proposed.  So far we didn't change the initiator SPI when
restarting the connection, i.e. these delayed responses were processed
and might have caused fatal errors due to a failed DH negotiation or
because of the internal retry counter in the ike-init task.  Changing
the initiator SPI avoids that as we won't process the delayed responses
anymore that caused this confusion.
2017-09-04 11:16:00 +02:00
Tobias Brunner eaedcf8c00 ike-sa-manager: Add method to change the initiator SPI of an IKE_SA 2017-09-04 11:16:00 +02:00
Tobias Brunner bd371590ab ike-init: Fail if DH group in KE payload does not match proposed group 2017-09-04 11:02:55 +02:00
Tobias Brunner 1926efadde android: Add disconnect button to dialog if already connected to profile 2017-09-04 10:41:30 +02:00
Tobias Brunner 037b353d2c android: Load x509 plugin to generate OCSP requests and parse responses
BoringSSL does not support OpenSSL's OCSP API.
2017-09-04 10:41:29 +02:00
Tobias Brunner 829cc56a53 android: Add support to POST data via SimpleFetcher
That's required for OCSP verification.
2017-09-04 10:41:29 +02:00
Tobias Brunner 6e39240a3e android: Add option to clear cached CRLs 2017-09-04 10:41:29 +02:00
Tobias Brunner 0bebbae9e3 android: Cache CRLs in app directory
Fixes #2405.
2017-09-04 10:41:25 +02:00
Tobias Brunner 3fe9a436ee android: Pass absolute path to the app's data directory via JNI 2017-09-04 10:41:25 +02:00
Tobias Brunner 98ab757284 android: Hide app selection in profile editor on Android < 5 2017-09-04 10:41:25 +02:00
Tobias Brunner 0b4f7d646b android: Only apply app filter on Android 5 and newer 2017-09-04 10:41:24 +02:00
Tobias Brunner ac3189f792 android: Catch OutOfMemoryError when importing profiles
Not sure if this is actually caused because e.g. the file is too large
or due to some encoding issue.
2017-09-04 10:41:24 +02:00
Tobias Brunner 1a9261a923 android: Catch NullPointerException when parsing invalid certificates 2017-09-04 10:41:24 +02:00
Tobias Brunner e59b78254a android: Catch NullPointerException when calling VpnService.prepare()
According to the Play Console this occurs occasionally.
2017-09-04 10:41:24 +02:00
Andreas Steffen fc373b64a6 imv-os: Updated security update evaluation 2017-09-01 12:42:24 +02:00
Andreas Steffen 7b75c18696 libimcv: Updated database scheme 2017-09-01 11:19:40 +02:00
Andreas Steffen b84817375d sec-updater: Checks for security updates
sec-updater checks for security updates and backports in Debian/
Ubuntu repositories and sets the security flags in the strongTNC
policy database accordingly.
2017-09-01 11:19:40 +02:00
Andreas Steffen 076aac7069 imv-attestation: Fixed file hash measurements
The introduction of file versions broke file hash measurements.
This has been fixed by using a generic product versions having an
empty package name.
2017-09-01 10:51:15 +02:00
Tobias Brunner 66805c7b32 ike-cfg: Fix memory leak when checking for configured address 2017-08-29 16:25:42 +02:00
Andreas Steffen d2a89e9407 sw-collector.8: Some cleanups 2017-08-25 11:28:06 +02:00
Tobias Brunner 062a34e722 kernel-netlink: Set usable state whenever an interface appears
If an interface is renamed we already have an entry (based on the
ifindex) allocated but previously only set the usable state once
based on the original name.

Fixes #2403.
2017-08-23 12:10:39 +02:00
Tobias Brunner b7ad5f777f libimcv: Updated Android.mk after move of swid-gen(-info) 2017-08-21 12:17:02 +02:00
Tobias Brunner 9cf2920512 traffic-selector: Use single buffer for both address families
The generic field of size 0 in the union that was used previously
triggered index-out-of-bounds errors with the UBSAN sanitizer that's
used on OSS-Fuzz.  Since the two family specific union members don't
really provide any advantage, we can just use a single buffer for both
families to avoid the errors.
2017-08-17 12:34:40 +02:00
Tobias Brunner ed13c60c4f plugin-loader: Move indent variables into !USE_FUZZING block
This avoids compile errors on Travis.
2017-08-15 10:35:20 +02:00
Adrian-Ken Rueegsegger c15dbfaf08 charon-tkm: Build fix for kernel SAD tests
Commit 7729577... added a flag to the get_esa_id function but the unit
tests were not adjusted.
2017-08-14 18:35:37 +02:00
Tobias Brunner ef5c37fcdf gmp: Fix RSA signature verification for m >= n
By definition, m must be <= n-1, we didn't enforce that and because
mpz_export() returns NULL if the passed value is zero a crash could have
been triggered with m == n.

Fixes CVE-2017-11185.
2017-08-14 08:49:33 +02:00
Andreas Steffen e658fd475a sw-collector: Moved info class to libimcv 2017-08-09 13:28:00 +02:00
Tobias Brunner eb3239b921 libimcv: Cast chunk length to int when printing as string 2017-08-08 15:32:08 +02:00
Tobias Brunner cbade9b6b9 sw-collector: Cast chunk length to int when printing as string 2017-08-08 15:31:56 +02:00
Tobias Brunner 0392f76804 sw-collector: Fix memory leak after failing to open DB 2017-08-08 15:30:44 +02:00
Tobias Brunner d093488b96 sw-collector: Use correct variable to report failure to open history file 2017-08-08 15:29:41 +02:00
Andreas Steffen 3295b35c6a imv-database: Improve performance by creating file_hashes index 2017-08-07 17:43:54 +02:00