tests: added test to test match-tls-dtls-ciphers config option

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
This commit is contained in:
Nikos Mavrogiannopoulos
2020-03-12 16:22:04 +01:00
parent b0c885ca63
commit 5e817d3d60
5 changed files with 34 additions and 2 deletions

View File

@@ -68,7 +68,7 @@ if ENABLE_NUTTCP_TESTS
dist_check_SCRIPTS += traffic lz4-compression lzs-compression \
aes256-cipher aes128-cipher oc-aes256-gcm-cipher oc-aes128-gcm-cipher \
test-config-per-group ac-aes128-gcm-cipher ac-aes256-gcm-cipher \
no-dtls-cipher radius radius-config psk-negotiate
no-dtls-cipher radius radius-config psk-negotiate psk-negotiate-match
endif
endif

View File

@@ -72,6 +72,7 @@ update_config() {
-e 's|@VPNNET6@|'${VPNNET6}'|g' "$file.$$.tmp" \
-e 's|@ROUTE1@|'${ROUTE1}'|g' "$file.$$.tmp" \
-e 's|@ROUTE2@|'${ROUTE2}'|g' "$file.$$.tmp" \
-e 's|@MATCH_CIPHERS@|'${MATCH_CIPHERS}'|g' "$file.$$.tmp" \
-e 's|@OCCTL_SOCKET@|'${OCCTL_SOCKET}'|g' "$file.$$.tmp"
CONFIG="$file.$$.tmp"
}

View File

@@ -190,3 +190,5 @@ ping-leases = false
cisco-client-compat = false
dtls-psk = true
dtls-legacy = false
match-tls-dtls-ciphers = @MATCH_CIPHERS@

View File

@@ -23,6 +23,6 @@
CIPHER_NAME="PSK-NEGOTIATE"
GNUTLS_NAME="(DTLS1.2)-(PSK)"
TEST_CONFIG="test-psk-negotiate.config"
MATCH_CIPHERS=false
. cipher-common.sh

29
tests/psk-negotiate-match Executable file
View File

@@ -0,0 +1,29 @@
#!/bin/bash
#
# Copyright (C) 2018 Nikos Mavrogiannopoulos
#
# This file is part of ocserv.
#
# ocserv is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2 of the License, or (at
# your option) any later version.
#
# ocserv is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# This tests operation/traffic under compression (lzs or lz4).
CIPHER_NAME="PSK-NEGOTIATE"
GNUTLS_NAME="(DTLS1.2)-(PSK)"
TEST_CONFIG="test-psk-negotiate.config"
MATCH_CIPHERS=true
. cipher-common.sh