0
0
mirror of https://github.com/OpenVPN/openvpn3.git synced 2024-09-19 19:52:15 +02:00
Commit Graph

28 Commits

Author SHA1 Message Date
Frank Lichtenheld
358280f72f deps/mbedtls: drop old patch
mbedtls clearly don't want to apply this patch. So
affected users will need to find other solutions.

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
2023-09-08 12:10:36 +02:00
Frank Lichtenheld
1fa0e9589f deps: update mbedTLS to 2.28.4
We're specifically interested in the fix for the unit tests.
("Update test data to avoid failures of unit tests after
2023-08-07")

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
2023-08-23 11:58:44 +02:00
Arne Schwabe
a219ce0303 update mbed TLS to latest 2.7 version
Signed-off-by: Arne Schwabe <arne@openvpn.net>
2022-02-10 18:59:01 +01:00
Frank Lichtenheld
603a5758ea
OVPN3-799 build/deps: make AR and RANLIB more flexible
Make it possible to specify arguments for both.
2021-10-20 18:12:29 +02:00
Frank Lichtenheld
9c520dff14 OVPN3-800 build: re-enable -flto for linux deps
lz4 and mbedtls are currently the only deps
that are built for linux (asio and xxHash
are only copied, not built).

If LTO flag is specified (which is a variable
already supported by scrips/build) and target
is linux then enable -flto but allow to
speficy a random-seed to allow reproducibility.
2021-10-19 14:24:34 +02:00
Arne Schwabe
7eaa2893d4
Remove unused patch to fix compilation on Android
Signed-off-by: Arne Schwabe <arne@openvpn.net>
2020-09-09 18:58:54 +02:00
Arne Schwabe
1c751cc55b
Remove patch/code to allow unsupported name constraints in mbed TLS
This code was originally used in the Connect clients to allow PKIs that
use the (not commonly used) Name constraints feature. This is a
potential security risk but was done to allow PKIs that used that
feature. OpenSSL natively supports Name constraints and will check these.

Remove this hacky feature as feature as it also breaks compiling with
an unpatched mbed TLS and is not used by code anymore.
2020-09-09 18:58:53 +02:00
Lev Stipakov
728733aee7 deps/mbedtls: rebase "enable unsupported critical extensions" patch
This rebases "Enable allowing unsupported critical extensions in
 runtime" patch on top of 2.7.11.

Signed-off-by: Lev Stipakov <lev@openvpn.net>
2019-08-14 17:02:49 +03:00
Arne Schwabe
5f1f8470bc Revert bugfix for not compiling IA32 ASM of 2.7.5
Mbedtls 2.7.5 included a bugfix (e08754762d) that ASM code in bn_mul.h
was only enabled with -O0 instead of not enabling it with -O0
unfortenately the old gcc version (4.9.x) we use for our Android
build does not handle this. Fall back to not using ASM code on the
gcc/Android combination.
2018-08-22 14:44:58 +02:00
Antonio Quartulli
bde2c41be0
dep: switch from mbeTLS 2.7.0 to 2.7.5
Update dep on mbedTLS to latest maintenance release
of the 2.7 branch.

Mst of our private patches are now upstream and can
be removed.

Signed-off-by: Antonio Quartulli <antonio@openvpn.net>
2018-08-21 21:37:05 +08:00
Arne Schwabe
d339b684ac Modify build script of lz4/mbedtls to allow src only builds
The modern cmake build for the Android core does build the library
during the build of the core. Prebudiling these libraries is not
necessary.
2018-05-22 19:57:43 +02:00
Lev Stipakov
cfd6df5bc2 build system: fix 'git apply'
When 'git apply' is run inside repository folder, it ignores files
missing in index. To make it work, run 'git apply' outside of repository.

Signed-off-by: Lev Stipakov <lev@openvpn.net>
2018-04-19 11:11:39 +03:00
Lev Stipakov
40c70113d4 [OVPN3-184] Add mbedTLS patch
Add mbedTLS patch which enables to allow
unsupported critical extensions in runtime.

Signed-off-by: Lev Stipakov <lev@openvpn.net>
2018-04-19 10:59:35 +03:00
Antonio Quartulli
e6d68831a7
deps: update mbedTLS to 2.7.0
At the same time rebase patches on top of ne wversion
and get rid of fixes that have been merged upstream.

Signed-off-by: Antonio Quartulli <antonio@openvpn.net>
2018-03-26 23:58:35 +08:00
Antonio Quartulli
33dd2f29e8
mbedtls: backport fixes for CVE-2018-0487
Backport patches from mbedTLS-2.7.0 to address the CVE
in the subject:

28a0c727 RSA: Fix buffer overflow in PSS signature verification
6a54b024 RSA: Fix another buffer overflow in PSS signature verification
139108af RSA PSS: fix minimum length check for keys of size 8N+1
b00b0da4 RSA PSS: fix first byte check for keys of size 8N+1
91048a3a RSA PSS: remove redundant check; changelog

This bug can be exploited by sending a malicious certificate
chain signed using RSASSA-PSS.

Signed-off-by: Antonio Quartulli <antonio@openvpn.net>
2018-03-26 23:58:34 +08:00
Lev Stipakov
0912a9b629
[OVPN3-213] build system: mbedtls timing tests
Include patches from https://github.com/ARMmbed/mbedtls/pull/1136/commits

Signed-off-by: Lev Stipakov <lev@openvpn.net>
2018-03-26 23:58:34 +08:00
Lev Stipakov
a61cac9289
mbedtls: Patches from 2.7 to fix timing test failures
Changed to Changelog are removed to make patches apply on 2.6.

Signed-off-by: Lev Stipakov <lev@openvpn.net>
2018-03-26 23:58:34 +08:00
Lev Stipakov
8a394a37dd
[OVPN3-213] build system: mbedtls timing tests
Include patches from https://github.com/ARMmbed/mbedtls/pull/1136/commits

Signed-off-by: Lev Stipakov <lev@openvpn.net>
2018-03-26 23:58:33 +08:00
Lev Stipakov
3d6fd62cb1
mac build: improve unittest stability
mbedTLS commit 8873bcc4def433aa0edfbe260083f32f04aa097e

Timing self test: increased duration

Increase the duration of the self test, otherwise it tends to fail on
a busy machine even with the recently upped tolerance. But run the
loop only once, it's enough for a simple smoke test.

Signed-off-by: Lev Stipakov <lev@openvpn.net>
2018-03-26 23:58:33 +08:00
Lev Stipakov
b713762ba4
mbedtls: Patches from 2.7 to fix timing test failures
Changed to Changelog are removed to make patches apply on 2.6.

Signed-off-by: Lev Stipakov <lev@openvpn.net>
2018-03-10 02:28:35 +08:00
Antonio Quartulli
33c16812e1
[OVPN3-144] mbedTLS: fix support for 4096bit encrypted keys
Backported from mbedTLS 2.7.0

Signed-off-by: Antonio Quartulli <antonio@openvpn.net>
2018-03-10 02:28:33 +08:00
Antonio Quartulli
f249ab4bd3
[OVPN3-144] build-mbedtls: run make check before compiling
This will ensure that mbedtls is still passing all its
unit test before building it.

It is important to run the checks because we backport patches
on our own and they may break during the process.

Checks are perfomed only when building for linux or for osx.

Signed-off-by: Antonio Quartulli <antonio@openvpn.net>
2018-03-10 02:28:33 +08:00
Antonio Quartulli
5040aef4c1
[OVPN3-144] build-mbedtls: apply patches using git-apply instead of patch
This is required to allow git patches with binary content
to be properly applied.

Signed-off-by: Antonio Quartulli <antonio@openvpn.net>
2018-03-10 02:28:33 +08:00
Antonio Quartulli
8a5e838ab7
[OVPN3-144] mbedTLS: fix incompatibility with PKI created by OpenSSL 1.1
Please check the commit messages of the new patches for a better
description.

In a nutshell, this change allows mbedTLS to properly decrypt
keys created by OpenSSL using PKCS#5v2 with PRF different from
SHA1.

This change also add their related unit-tests.

Signed-off-by: Antonio Quartulli <antonio@openvpn.net>
2018-03-10 02:28:33 +08:00
Antonio Quartulli
06d23eccc2 [OVPN3-129] build-system: let scripts download dependencies
With this change a dep build script will now download
the related tarball automatically if not already present.

This way, we ensure that the core is built with the dep
package version specified in lib-versions.

After finding or downloading a tarball, its checksum is
computed and compared with the one in lib-versions to
ensure that the file is the expected one.

This logic has been applied to asio, mbedtls and lz4.

Signed-off-by: Antonio Quartulli <antonio@openvpn.net>
2017-12-22 17:59:39 +08:00
Antonio Quartulli
19e33c4ebe [OA-14] mbedTLS: relax x509 date/time format check
some CA provides certificates that do not fully follow
the RFC in terms of date format.
This patch relaxes the constrains in mbedTLS so that also
not sully compliant certificates can be accepted.

Signed-off-by: Antonio Quartulli <antonio@openvpn.net>
2017-12-22 17:59:38 +08:00
James Yonan
052f565ed7 build-mbedtls : simplify mbedTLS build script to no longer
depend on cmake.
2017-03-18 12:24:54 -06:00
James Yonan
a6b7cf458f mbedTLS: Port from polarssl-1.3 to mbedtls-2.3 (functional)
This patch builds on work by David Sommerseth <davids@openvpn.net>
to move the PolarSSL API from polarssl-1.3 to mbedtls-2.3, which
has significant differences in some areas.

- Strings containing keys, certificates, CRLs, and DH parameters
  need to be NULL-terminated and the length argument provided to
  the corresponding mbedtls parse function must be able to read
  the NULL-terminator.  These places have been modified with a
  '+1' to the length argument (x509cert.hpp, x509crl.hpp, dh.hpp,
  pkctx.hpp).

- The SSL context object has been split up in mbedtls-2.3
  Now many of the SSL configurations are done in a separate
  SSL config object, which is added to the SSL context once
  configured.  In addition private/public keys are now stored
  in a separate pk_context, which is later on attached to the
  SSL context.  Due to this, many of the calls setting either
  SSL configuration parameters or working with pk_contexts have
  been refactored.  (sslctx.hpp)

- The older API loading the CA chain took a hostname argument.
  The new API requires mbedtls_ssl_set_hostname() explicitly to
  be called setting hostname.  Some refactoring was needed here
  too (sslctx.hpp).

- x509_oid_get_description() is now replaced by
  mbedtls_oid_get_extended_key_usage().

- when mbedTLS renamed OID_CMP to MBEDTLS_OID_CMP, the return
  value was changed so that a return value of 0 now means equal
  rather than not-equal.

- mbedtls/platform.h must be loaded before any other mbedtls
  include files (sslchoose.hpp).

- All functions and macros related to mbedTLS are now prefixed
  with mbedtls_/MBEDTLS_

- Refactored External PKI and added some options to cli.cpp
  to make it easier to test that the feature still works
  correctly.  This included removing the sig_type var and
  standardizing on a PKCS#1 digest prefix per RFC 3447.

- Updated test keys to 2048 bits.

- Updated dependency build scripts to build mbedTLS.

- Enable MD4 in mbedTLS build script (needed for NTLM auth).

- Use an allow-all X509 cert profile to preserve compatibility
  with older configs.  Going forward, we will implement new
  options to increase strictness on minimum RSA key size and
  required cert signing algs.

- Added human-readable reason strings that explain why
  a given cert in the chain wasn't accepted.

- This patch doesn't rename any files or rename internal
  OpenVPN 3 symbols such as PolarSSLContext.  This will
  be done in a separate commit.

Signed-off-by: James Yonan <james@openvpn.net>
2017-03-18 12:24:54 -06:00