Commit Graph

17510 Commits

Author SHA1 Message Date
Tobias Brunner b2b69f4156 configure: Depend on libip4tc instead of libiptc
The libiptc meta-package apparently will be removed e.g. from Debian.
We currently only need IPv4 support in the connmark and forecast plugins.

Fixes #3338.
2020-02-14 10:07:23 +01:00
Tobias Brunner cb25022197 unit-tests: Increase timeout for test vectors suite
These occasionally fail due to the current timeout on IBM Power on Travis.
2020-02-13 16:42:13 +01:00
Tobias Brunner ead067e775 Revert "travis: Add workaround for a tox/virtualenv/six issue"
This reverts commit d450e926de.

Was fixed by making tox depend on newer versions of six so the package
gets installed/updated automatically now when installing tox.  There is
also some ongoing work that tries to make virtualenv work with older
versions of six.
2020-02-13 16:34:27 +01:00
Tobias Brunner 19b2f870e2 enumerator: Fall back to lstat() if stat() fails when enumerating dirs/files
This happens e.g. if the path is for an invalid symlink.
2020-02-13 11:54:19 +01:00
Tobias Brunner fdce492ed0 cirrus: Remove bashisms from test script to make it compatible with /bin/sh
Bash is not installed on the FreeBSD images here and the location would
be different anyway (`/usr/local/bin/bash`, so we'd have to change the
hashbang to e.g. `/usr/bin/env bash`).
2020-02-13 10:23:30 +01:00
Tobias Brunner d450e926de travis: Add workaround for a tox/virtualenv/six issue
virtualenv is installed as dependency of tox and 20.0.0 added a
dependency on a newer version of six, which is not automatically
installed/updated.
2020-02-12 11:20:02 +01:00
Josh Soref d30498edf1 ikev2: Fix spelling of routability
References strongswan/strongswan#164.
2020-02-11 18:23:34 +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 baf29263d5 pem: Support parsing PEM-encoded Ed448 keys 2020-02-10 13:37:31 +01:00
Tobias Brunner 878afdf90b pki: Add support for Ed448 keys/certificates 2020-02-10 13:37:31 +01:00
Tobias Brunner 85a35fc99d openssl: Support certificates with Ed25519/448 keys 2020-02-10 13:37:31 +01:00
Tobias Brunner 3361f81f1c pkcs1: Support parsing Ed448 public keys 2020-02-10 13:37:31 +01:00
Tobias Brunner 18bee9306a nm: Replace deprecated g_type_class_add_private()
Fixes #2765, #3197.
2020-02-05 10:54:37 +01:00
Tobias Brunner 0f141fb095 soup: Use soup_session_new() to avoid deprecation warning
There are a ton of libsoup/GLib-related "leaks" that we can't whitelist
and with leak detective active there is a delay that interestingly doesn't
happen with soup_session_sync_new(), so tests failed with a timeout (actually
they hung due to the lock in the fetcher manager).
On Travis, the curl plugin is used for the tests, so that's not an issue
there (and without LD the tests complete quickly and successfully).
2020-02-05 10:49:35 +01:00
Tobias Brunner 5833bc4b9c travis: Build soup plugin
We disabled this due to issues with the GLib version shipped with
Ubuntu 12.04 (see ab23a0f86a).
2020-02-05 10:49:20 +01:00
Tobias Brunner f78dfb7e28 vici: Options are optional in get_pools() of Python bindings
Fixes #3319.
2020-02-03 10:52:31 +01:00
Tobias Brunner ef4113a49d libtpmtss: Fix problematic usage of chunk_from_chars() in TSS2 implementations
See 8ea13bbc5c for details.

References #3249.
2020-01-30 18:18:33 +01:00
Tobias Brunner 776433505b x509: Replace problematic calls of chunk_from_chars() for keyUsage extension
As noted in 8ea13bbc5c newer compilers might optimize out the
assignment leading to invalid values in the keyUsage extension (as the
length was still set, the extension was encoded, just not with the
intended values).

Fixes #3249.
2020-01-30 18:18:28 +01:00
Tobias Brunner d16e810778 pki: Remove unnecessary and problematic chunk_from_chars() usage in --signcrl
If the serial is not yet set, the same default value is set just below.

See 8ea13bbc5c for details on chunk_from_chars().

References #3249.
2020-01-30 18:18:14 +01:00
Tobias Brunner d5cf2d1f85 tls-crypto: Fix usage of chunk_from_chars()
See 8ea13bbc5c for details.

References #3249.
2020-01-30 18:18:06 +01:00
Tobias Brunner da9e4fa04b lgtm: Build external dependencies for a more complete analysis
The build system is a bit limited, only the repository directory and
LGTM_WORKSPACE is writable.  sudo doesn't work at all, for others we
don't have enough permission.
2020-01-30 17:12:48 +01:00
Tobias Brunner 2cb4af6696 wolfssl: Use pkg-config to check for wolfSSL
The other checks trigger an automatic install of the old and incompatible
Ubuntu package on LGTM.
2020-01-30 17:12:05 +01:00
Tobias Brunner 04ce39e7c0 libtpmtss: Only check for legacy TSS2 libs if newer are not found
On LGTM, legacy packages are installed automatically otherwise.
2020-01-30 15:37:45 +01:00
Tobias Brunner ed8430630f travis: tpm2-tss switched the default crypto backend to OpenSSL with 2.2.0 2020-01-30 15:37:45 +01:00
Tobias Brunner c9a3430368 travis: Trigger code review on lgtm.com
Only the master (daily) and pull requests are scanned automatically.
2020-01-30 15:37:45 +01:00
Tobias Brunner 48017a2740 conf: Complete ordering functions for ConfigOption class 2020-01-29 13:31:42 +01:00
Tobias Brunner 1147973661 pkcs11: Avoid naming conflict with method parameter 2020-01-28 15:32:43 +01:00
Tobias Brunner 18a3e6d80f systime-fix: Replace asctime() with thread-safe asctime_r()
According to the man page, the buffer should have room for at least
26 characters.
2020-01-28 15:32:43 +01:00
Tobias Brunner 584e8197fe load-tester: Avoid naming conflict with local certificate variables 2020-01-28 15:32:43 +01:00
Tobias Brunner a7126dd47e sw-collector: Avoid naming conflicts with local count variables 2020-01-28 15:32:43 +01:00
Tobias Brunner f168f5782b eap-aka-3gpp2: Fix a bunch of typos 2020-01-28 15:32:43 +01:00
Tobias Brunner 378fe7a4bf eap-aka-3gpp2: Avoid naming conflict with parameters of crypto functions 2020-01-28 15:32:43 +01:00
Tobias Brunner 719cfc7846 eap-aka-3gpp2: Avoid naming conflict with local AMF variable 2020-01-28 15:32:43 +01:00
Tobias Brunner b7019a5c9e pool: Avoid conflict with start/end variables used in many commands 2020-01-28 15:32:43 +01:00
Tobias Brunner 26f20cc258 aesni: Namespace include guard for AES-CMAC
Was the same as in the cmac plugin.
2020-01-28 15:32:43 +01:00
Tobias Brunner e438915e62 tls-prf: Remove unused/undeclared argument in TLS 1.0/1.1 PRF constructor 2020-01-28 15:32:43 +01:00
Tobias Brunner ea1f4cd7a9 pki: Avoid naming conflict with global variables for passed arguments 2020-01-28 15:32:43 +01:00
Tobias Brunner d493dc18d6 scepclient: Avoid name conflict with global PKCS#7 chunk
Use the same name as further down below in the file.

Fixes: 04ff78aa33 ("scepclient: Store received RA certificates, using CA cert name as base.")
2020-01-28 15:32:43 +01:00
Tobias Brunner 42928551ab starter: Avoid hiding global variable when checking PID file 2020-01-28 15:29:40 +01:00
Tobias Brunner cab86465bb copyright: Make strings static const
They are not used anywhere else.
2020-01-28 15:29:40 +01:00
Tobias Brunner 90df054f14 plugin-constructors: Remove unused import for `sys` 2020-01-28 15:29:40 +01:00
Tobias Brunner c584a6b2dc vici: Remove unused import in Python bindings 2020-01-28 15:29:40 +01:00
Tobias Brunner df4274171e vici: Remove unnecessary `pass` statement 2020-01-28 15:29:40 +01:00
Tobias Brunner 7bcbf20b3d array: Avoid overflow in size calculation
While it's unlikely that so many (large) items are allocated, this is
technically more correct.  The result previously could overflow an
unsigned int (the conversion to size_t happened afterwards).
2020-01-28 15:29:40 +01:00
Tobias Brunner 73ee7b6664 swanctl: Add missing header guards for load commands 2020-01-28 15:29:40 +01:00
Tobias Brunner 91c6387e69 swanctl: Add missing `extern` for `swanctl_dir` variable in header
This clearly never was correct, but didn't cause problems so far.
However, GCC 10 will default to `-fno-common` instead of
`-fcommon` (https://gcc.gnu.org/PR85678), so compilation there fails
with something like:

```
libtool: link: gcc ... -o .libs/swanctl ...
ld: commands/load_authorities.o:strongswan/src/swanctl/./swanctl.h:33:
  multiple definition of `swanctl_dir'; commands/load_all.o:strongswan/src/swanctl/./swanctl.h:33: first defined here
```

Fixes: 501bd53a6c ("swanctl: Make credential directories relative to swanctl.conf")
Closes strongswan/strongswan#163.
2020-01-28 15:29:40 +01:00
Tobias Brunner 8ea13bbc5c lgtm: Add query to detect problematic uses of chunk_from_chars()
GCC 9+ and clang 4+ (partially) optimize out usages of
chunk_from_chars() if the value is read outside of the block where the
macro is used.  For instance:

```
chunk_t chunk = chunk_empty;
if (...)
{
	chunk = chunk_from_chars(0x01, 0x06);
}
/* do something with chunk */
```

The chunk_from_chars() macro expands to a chunk_t declaration, which is
technically only defined inside that block.

Still, with older GCC versions the fourth line was compiled to something
like this:

```
mov     WORD PTR [rsp+14], 1537 # 0x0106 in little-endian
lea     rdx, [rsp+14]
mov     ecx, 2
```

However, with GCC 9.1 and -O2 the first instruction might be omitted
(strangely the others usually were not, so the chunk pointed to whatever
was stored on the stack).  It's not easily reproducible, so there are
situations where the seemingly identical code is not optimized in this
way.

This query should detect such problematic uses of the macro (definition
and usage in different blocks).

References #3249.
2020-01-27 18:31:09 +01:00
Tobias Brunner 9c6ab71782 lgtm: Add config for a more complete build on lgtm.com 2020-01-27 18:00:49 +01:00
Tobias Brunner 3be430cc13 travis: Build on ARM64, IBM Power and IBM Z architectures
IBM Z is big-endian, IBM Power runs in little-endian mode.

Botan requires a fix for issues with GCC and amalgamation enabled (target
pragma ‘*’ is invalid) on ARM64 and IBM Power, while wolfSSL can't be
compiled successfully on IBM Z without an additional patch.

libunwind is not available for x390x, but since we explicitly disable
such backtraces it's not necessary anyway.
2020-01-22 15:10:09 +01:00
Tobias Brunner 3bc0c9807a sha3: Fix readLane() macro on big-endian platforms 2020-01-20 11:05:17 +01:00