0
0
mirror of https://github.com/OpenVPN/openvpn.git synced 2024-09-20 03:52:28 +02:00
Commit Graph

8 Commits

Author SHA1 Message Date
Arne Schwabe
e7427bcbb9 Remove openssl engine method for loading the key
This is a contribution for loading engine key. OpenSSL engine is
deprecated since OpenSSL 3.0 and James Bottomley has not agreed to
the proposed license chagne. He is also okay with removing the
feature from the current code base as it is obsolete with OpenSSL 3.0.

The original commit ID was a0a8d801dd0d84e0ec844b9ca4c225df7 (plus
subsequent fixes).

Change-Id: I2d353a0cea0a62f289b8c1060244df66dd7a14cb
Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Message-Id: <20231006111910.3541180-1-arne@rfc2549.org>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg27133.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
2023-10-18 15:24:10 +02:00
James Bottomley
542c69c37b Add unit tests for engine keys
Testing engines is problematic, so one of the prerequisites built for
the tests is a simple openssl engine that reads a non-standard PEM
guarded key.  The test is simply can we run a client/server
configuration with the usual sample key replaced by an engine key.
The trivial engine prints out some operations and we check for these
in the log to make sure the engine was used to load the key and that
it correctly got the password.

Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>

Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <20200622232319.8143-2-James.Bottomley@HansenPartnership.com>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg20075.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
2020-06-23 08:16:35 +02:00
Gert Doering
222e691739 Remove cmocka submodule, rely on system-wide installation instead.
We used to ship git submodule instructions to build a local copy of
cmocka in vendor/cmocka/ and use that (if cmake is installed) to build
unit tests.  With the network test driver this turns out to be a
LD_LIBRARY_PATH vs. SUDO complication which is really outweighing the
benefit of a local build today - so, use the system-wide installation
if available (querying pgk-config).  Do not build unit-tests otherwise.

v2: (inspired by patch from David Sommerseth)
  introduce "configure --disable-unit-test" switch
  simplify configure.ac logic
  use CMOCKA_LIBS and CMOCKA_INCLUDE (set by PKG_CHECK)

v3:
  repair conflict with commit 7473f32636
  CMOCKA_INCLUDE is not correct, must be CMOCKA_CFLAGS (see config.status)

Signed-off-by: Gert Doering <gert@greenie.muc.de>
Acked-by: David Sommerseth <davids@openvpn.net>
Message-Id: <20190623183210.6005-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg18570.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
2019-06-24 20:43:58 +02:00
Steffan Karger
ac42df1a2e Make argv unit tests obey {MBEDTLS, OPENSSL}_{LIBS, CFLAGS}
Fixes builds that use MBEDTLS_CFLAGS and friends to tell the build where
the header files and libraries are.  Also alphabetically orders some of
the listed files in relates Makefile.am files.

Signed-off-by: Steffan Karger <steffan@karger.me>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1479152603-5103-1-git-send-email-steffan@karger.me>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg13050.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
2016-11-14 20:46:28 +01:00
Heiko Hund
698e268afb put argv_* functions into own file, add unit tests
misc.c is too crowded with different things to perform any
sane unit testing due to its dependencies. So, in order to re-write
the #ifdef'ed tests for the argv_* family of functions into unit
tests I moved them into a dedicated file.

Signed-off-by: Heiko Hund <heiko.hund@sophos.com>
Acked-by: David Sommerseth <davids@redhat.com>
Message-Id: <1477672963-5724-2-git-send-email-heiko.hund@sophos.com>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg12811.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
2016-11-14 20:17:29 +01:00
David Sommerseth
45f6e7991c Only build and run cmocka unit tests if its submodule is initialized
Commit 40cb4cfc5d added infrastructure to write unit tests using
cmocka.  This was implemented using a git submodule to fetch an
up-to-date cmocka test framework.

The issue which appeared was that 'make check' stopped working if
the cmocka submodule was not initialized and updated.  As we do not
want this to be a hard depenency, this patch makes running these
unit tests conditional.  If cmocka has not been initialized, skip
them or if it has been initialized all unit tests will be run.

 [v2 - Also check if cmake is available, as cmocka depends on that
       to be built ]

Signed-off-by: David Sommerseth <dazo@privateinternetaccess.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1464703645-26640-1-git-send-email-openvpn@sf.lists.topphemmelig.net>
URL: http://article.gmane.org/gmane.network.openvpn.devel/11758
2016-05-31 16:40:29 +02:00
Jens Neuhalfen
4507bb6cd1 Add a test for auth-pam searchandreplace
No functional changes.

Utility functions of auth-pam are split into a dedicated file. This allows
the test programs to easily test these functions without adding
dependencies.

Add a minimal test for searchandreplace as a proof of concept.

[ Modified during commit: Enhanced documentation of functions in utils.h
  to comply with doxygen standards ]

Signed-off-by: Jens Neuhalfen <jens@neuhalfen.name>
Acked-by: Steffan Karger <steffan@karger.me>
Message-Id: <20160525175756.56186-3-openvpn-devel@neuhalfen.name>
URL: http://article.gmane.org/gmane.network.openvpn.devel/11724
Signed-off-by: David Sommerseth <dazo@privateinternetaccess.com>
2016-05-30 23:18:09 +02:00
Jens Neuhalfen
40cb4cfc5d Add unit testing support via cmocka
cmocka [1,2] is a testing framework for C. Adding unit test
capabilities to the openvpn repository will greatly ease the
task of writing correct code.

cmocka source code is added as git submodule in ./vendor. A
submodule approach has been chosen over a classical library
dependency because libcmocka is not available, or only
available in very old versions (e.g. on Ubuntu).

cmocka is build during 'make check' and installed in vendor/dist/.

[1] https://cmocka.org/
[2] https://lwn.net/Articles/558106/

Signed-off-by: Jens Neuhalfen <jens@neuhalfen.name>
Acked-by: Steffan Karger <steffan@karger.me>
Message-Id: <20160525175756.56186-2-openvpn-devel@neuhalfen.name>
URL: http://article.gmane.org/gmane.network.openvpn.devel/11725
Signed-off-by: David Sommerseth <dazo@privateinternetaccess.com>
2016-05-30 22:40:55 +02:00