Commit Graph

12948 Commits

Author SHA1 Message Date
Tobias Brunner 9d69d8a399 stroke: Remove external enumeration to unroute shunt policies 2018-02-22 11:31:05 +01:00
Tobias Brunner 57ea3f73bb shunt-manager: Remove first match if no namespace given during uninstall
Also makes namespace mandatory.
2018-02-22 11:31:05 +01:00
Tobias Brunner c1c63a400e appveyor: Allow events to trigger early in threading unit tests
The timed wait functions tested in the threading unit tests often but
randomly trigger a bit early on AppVeyor Windows containers.  We allow this
if it is not earlier than 5ms.
2018-02-22 09:19:14 +01:00
Tobias Brunner ee8c25516a charon-nm: Fix building list of DNS/MDNS servers with libnm
g_variant_builder_add() creates a new GVariant using g_variant_new() and
then adds it to the builder.  Passing a GVariant probably adds the
pointer to the array, not the value.  I think an alternative fix would
be to use "@u" as type string for the g_variant_builder_add() call, then
the already allocated GVariant is adopted.

Fixes: 9a71b7219c ("charon-nm: Port to libnm")
2018-02-22 09:05:48 +01:00
Tobias Brunner 9ba01ce380 x509: Fix leak if a CRL contains multiple authorityKeyIdentifiers 2018-02-21 11:13:42 +01:00
Tobias Brunner 29b983309f nm: Version bump to 1.4.3 2018-02-19 14:45:15 +01:00
Tobias Brunner 40da179f28 signature-params: Properly handle MGF1 algorithm identifier without parameters
Credit to OSS-Fuzz.

Fixes: CVE-2018-6459
2018-02-19 10:29:32 +01:00
Tobias Brunner fb545dd34d vici: Also return close action 2018-02-16 09:55:22 +01:00
Tobias Brunner bac71410f3 save-keys: Add warning message to log if keys are being saved 2018-02-15 23:03:29 +01:00
Tobias Brunner 1da1ba01c4 save-keys: Add options to enable saving IKE and/or ESP keys 2018-02-15 23:03:29 +01:00
Codrut Cristian Grosu 88e151d10d save-keys: Store derived CHILD_SA keys in Wireshark format 2018-02-15 23:03:29 +01:00
Codrut Cristian Grosu 4be7db5f60 save-keys: Store derived IKE_SA keys in Wireshark format
The path has to be set first, otherwise, nothing is done.
2018-02-15 23:03:29 +01:00
Codrut Cristian Grosu 345cd4684c save-keys: Add save-keys plugin
This plugin will export IKE_SA and CHILD_SA secret keys in the format used
by Wireshark.

It has to be loaded explicitly.
2018-02-15 23:03:29 +01:00
Andreas Steffen 4eaf08c35b vici: list-conn reports DPD settings and swanctl displays them 2018-02-15 16:28:06 +01:00
Tobias Brunner ac140220c4 proposal: Add modp6144 to the default proposal
We always had modp4096 and modp8192 included, not sure why this wasn't.
2018-02-14 14:54:32 +01:00
Tobias Brunner ce048c30ff ha: Double receive buffer size for HA messages and make it configurable
With IKEv1 we transmit both public DH factors (used to derive the initial
IV) besides the shared secret.  So these messages could get significantly
larger than 1024 bytes, depending on the DH group (modp2048 just about
fits into it).  The new default of 2048 bytes should be fine up to modp4096
and for larger groups the buffer size may be increased (an error is
logged should this happen).
2018-02-14 14:52:18 +01:00
Tobias Brunner 2db6d5b8b3 Fixed some typos, courtesy of codespell 2018-02-13 12:19:54 +01:00
Tobias Brunner 044b0f048b ike-mobike: Don't trigger update for NAT mapping change detected during an address update
This is really only needed for other exchanges like DPDs not when we
just updated the addresses. The NAT-D payloads are only used here to
detect whether UDP encapsulation has to be enabled/disabled.
2018-02-09 15:53:30 +01:00
Tobias Brunner 35ef1b032d child-sa: Install drop policies while updating IPsec SAs and policies
If we have to remove and reinstall SAs for address updates (as with the
Linux kernel) there is a short time where there is no SA installed.  If
we keep the policies installed they (or any traps) might cause acquires
and temporary kernel states that could prevent the updated SA from
getting installed again.

This replaces the previous workaround to avoid plaintext traffic leaks
during policy updates, which used low-priority drop policies.
2018-02-09 15:53:30 +01:00
Tobias Brunner 4664992f7d kernel-netlink: Optionally trigger roam events on routing rule changes
This can be useful if routing rules (instead of e.g. route metrics) are used
to switch from one to another interface (i.e. from one to another
routing table).  Since we currently don't evaluate routing rules when
doing the route lookup this is only useful if the kernel-based route
lookup is used.

Resolves strongswan/strongswan#88.
2018-02-09 15:51:28 +01:00
Tobias Brunner 80ae474863 ike-sa: Remove unused counter for pending MOBIKE updates 2018-02-09 11:21:02 +01:00
Tobias Brunner 9f0497818c ike-mobike: Only ignore MOBIKE responses if an actual update is queued
The counter does not tell us what task is actually queued, so we might
ignore the response to an update (with NAT-D payloads) if only an address
update is queued.
2018-02-09 11:21:02 +01:00
Tobias Brunner 2d27c350f8 ikev2: Update currently queued MOBIKE task
Instead of destroying the new task and keeping the existing one we
update any already queued task, so we don't loose any work (e.g. if a
DPD task is active and address update is queued and we'd actually like
to queue a roam task).
2018-02-09 11:21:02 +01:00
Tobias Brunner 43bbe07036 ike-mobike: Don't reset address update flag if set previously
If we update a queued job we don't want to reset previously set task
properties.
2018-02-09 11:21:02 +01:00
Tobias Brunner f90561155b ike: Add log message if host moves out of NAT 2018-02-09 11:21:02 +01:00
Tobias Brunner 626e8a31d0 ikev1: Properly handle fragmented Quick Mode messages 2018-02-09 10:46:00 +01:00
Tobias Brunner 73cbce6013 libradius: Pad received MSK to at least 64 bytes
According to RFC 3748 MSKs must be at least 64 bytes, however, that's
not the case for the MSK derived via EAP-MSCHAPv2.  The two key parts
received are only 16 bytes each (derived according to RFC 3079,
section 3.3), so we end up with an MSK of only 32 bytes. The eap-mschapv2
plugin, on the other hand, pads these two parts with 32 zeros.

Interestingly, this is not a problem in many cases as the SHA1/2 based
PRFs used later use a block size that's >= 64 bytes, so the shorter MSK
is just padded with zeros then.  However, with AES-XCBC-PRF-128, for
instance, which uses a block size of 16 bytes, the different MSKs are an
issue as XCBC is applied to both to shorten them, with different results.
This eventually causes the authentication to fail if the client uses a
zero-padded MSK produced by the eap-mschapv2 plugin and the server the 32
byte MSK received via RADIUS.
2018-02-09 10:44:52 +01:00
Tobias Brunner e698bdea24 man: Fix documentation of pubkey constraints
Hash algorithms have to be repeated for multiple key types.

References #2514.
2018-02-09 10:42:13 +01:00
Tobias Brunner 5a259ade4e child-create: Promote selected DH group, demote proposals that don't contain it 2018-02-09 10:20:05 +01:00
Tobias Brunner ff79020cd2 ike-init: Promote selected DH group and demote proposals that don't contain it 2018-02-09 10:20:05 +01:00
Tobias Brunner d9c9b7b832 proposal: Add method to move a given DH group to the front
This way a responder (like strongSwan) selecting a proposal first and
then checking if the KE payload matches sees the peer's preferred group
first.
2018-02-09 10:20:05 +01:00
Tobias Brunner 97ad041e6e unit-tests: Make sure we reuse the DH group during CHILD_SA rekeying 2018-02-09 10:20:05 +01:00
Tobias Brunner 576d9b907c ike-init: Make DH group reuse optional to test INVALID_KE_PAYLOAD handling
This is currently not an issue for CHILD_SA rekeying tests as these only
check rekeyings of the CHILD_SA created with the IKE_SA, i.e. there is
no previous DH group to reuse.
2018-02-09 10:20:05 +01:00
Tobias Brunner 27b0bd91d4 child-rekey: Use previously negotiated DH group when rekeying CHILD_SAs
For the CHILD_SA created with the IKE_SA the group won't be set in the
proposal, so we will use the first one configure just as if the SA was
created new with a CREATE_CHILD_SA exchange.  I guess we could
theoretically try to use the DH group negotiated for IKE but then this
would get a lot more complicated as we'd have to check if that group is
actually contained in any of the CHILD_SA's configured proposals.
2018-02-09 10:20:05 +01:00
Tobias Brunner f8e53003aa child-create: Add an option to set the DH group to be used 2018-02-09 10:20:05 +01:00
Tobias Brunner 727615ee05 ike-init: Reuse the DH group of the previous IKE_SA when rekeying 2018-02-09 10:20:05 +01:00
Tobias Brunner 18242f62c2 ike-init: Move creation of DH instance after INVALID_KE_PAYLOAD to build_i()
This way we get proper error handling if the DH group the peer requested
is not actually supported for some reason (otherwise we'd just retry to
initiate with the configured group and get back another notify).
2018-02-09 10:20:05 +01:00
Tobias Brunner d058fd3c32 child-cfg: Strip DH groups from both compared proposals
This fixes two issues, one is a bug if a DH group is configured for the
local ESP proposals and charon.prefer_configured_proposals is disabled.
This would cause the DH groups to get stripped not from the configured but
from the supplied proposal, which usually already has them stripped.  So
the proposals wouldn't match.  We'd have to always strip them from the local
proposal.  Since there are apparently implementations that, incorrectly, don't
remove the DH groups in the IKE_AUTH exchange (e.g. WatchGuard XTM25
appliances) we just strip them from both proposals.  It's a bit more lenient
that way and we don't have to complicate the code to only clone and strip the
local proposal, which would depend on a flag.

References #2503.
2018-02-09 10:18:59 +01:00
Tobias Brunner 007a2701bb ike: Don't handle roam events if no IKE config is available
IKE_SAs newly created via HA_IKE_ADD message don't have any IKE or peer
config assigned yet (this happens later with an HA_IKE_UPDATE message).
And because the state is initially set to IKE_CONNECTING the roam() method
does not immediately return, as it later would for passive HA SAs. This
might cause the check for explicitly configured local addresses to crash
the daemon with a segmentation fault.

Fixes #2500.
2018-02-09 10:10:07 +01:00
Adrian-Ken Rueegsegger fcff3808b4 charon-tkm: Update to latest Anet version 2018-02-08 17:01:38 +01:00
Tobias Brunner c6a402d4fa android: New release after changing cert sending policy 2018-02-08 12:26:11 +01:00
Tobias Brunner 6bafa2d346 android: Always send the client certificate
In scenarios where the server accepts client certificates from dozens or
even hundreds of CAs it might be necessary to omit certificate request
payloads from the IKE_SA_INIT response to avoid fragmentation.

As it is rarely the case in road-warrior scenarios that the server
already has the client certificate installed it should not be a problem
to always send it.
2018-02-08 12:15:36 +01:00
Tobias Brunner c7263577b3 auth-cfg: Classify key strengths as multi value rules
If that's not the case only the last value added would be considered
not all the keys of a trust chain.

Fixes #2515.
2018-02-08 10:15:53 +01:00
Tobias Brunner 268a1bfa34 charon-nm: Remove unused variable 2018-02-05 15:11:03 +01:00
Tobias Brunner 4a84fb07ca gmp: Fix compatibility with older libgmp releases
Older releases don't have mpz_powm_sec() and mpz_inits() yet.

Fixes #2505.
2018-01-31 10:53:55 +01:00
Tobias Brunner 432358cf49 revocation: Skip any zero bytes when comparing serials in CRLs
Depending on the plugins that eventually parse the certificate and CRL,
serials with MSB set (i.e. negative numbers that have a zero byte prefixed
when encoded as ASN.1 INTEGER) might have (x509 plugin) or not have
(openssl plugin) a zero byte prefix when returned by get_serial() or
enumerated from the CRL.  Strip them before doing the comparison or
revocation checking might fail if not both credentials are parsed by the
same plugin (which should be rare and only happen if parsing of either
cert or CRL fails with one of the plugins and there is a fallback to the
implementation provided by the other plugin).

Fixes #2509.
2018-01-31 10:50:41 +01:00
Reinhard Pfau a8e940ade2 eap: Reset errno before calling strtoul() to parse EAP type
Reset errno to 0 before calling strtoul() since it sets errno only on
error cases. So the following test fails even on correct conversions if
errno had a value != 0.

Fixes #2506.
2018-01-23 10:09:14 +01:00
Andreas Steffen 3232cf68b9 libtpmtss: Return after failure 2018-01-09 16:12:40 +01:00
Tobias Brunner 419ae9a20a ikev1: Default remote identity to %any for PSK lookup if not configured
Otherwise, the remote identity is ignored when matching owner identities
of PSKs and this way matching PSKs that explicitly have %any assigned is
improved.

Fixes #2497.
2017-12-22 10:37:32 +01:00
Tobias Brunner a9f3016ef3 stroke: Don't ignore %any as owner of shared secrets
If users want to associate secrets with any identity, let 'em. This is
also possible with vici and might help if e.g. the remote identity is
actually %any as that would match a PSK with local IP and %any better
than one with local and different remote IP.

Fixes #2497.
2017-12-22 10:33:27 +01:00
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