Skip to content

Commit

Permalink
if_ovpn tests: add aes-128-gcm test case
Browse files Browse the repository at this point in the history
Sponsored by:	Rubicon Communications, LLC ("Netgate")
  • Loading branch information
kprovost committed Nov 11, 2022
1 parent 2c58d0c commit 832c8a5
Showing 1 changed file with 39 additions and 11 deletions.
50 changes: 39 additions & 11 deletions tests/sys/net/if_ovpn/if_ovpn.sh
Original file line number Diff line number Diff line change
Expand Up @@ -915,17 +915,10 @@ ra_cleanup()
ovpn_cleanup
}


atf_test_case "chacha" "cleanup"
chacha_head()
ovpn_algo_body()
{
atf_set descr 'Test DCO with the chacha algorithm'
atf_set require.user root
atf_set require.progs openvpn
}
algo=$1

chacha_body()
{
ovpn_init

l=$(vnet_mkepair)
Expand All @@ -943,8 +936,8 @@ chacha_body()
dev-type tun
proto udp4
cipher CHACHA20-POLY1305
data-ciphers CHACHA20-POLY1305
cipher ${algo}
data-ciphers ${algo}
auth SHA256
local 192.0.2.1
Expand All @@ -967,6 +960,9 @@ chacha_body()
client
cipher ${algo}
data-ciphers ${algo}
remote 192.0.2.1
auth-user-pass $(atf_get_srcdir)/user.pass
Expand All @@ -984,11 +980,42 @@ chacha_body()
atf_check -s exit:0 -o ignore jexec b ping -c 3 198.51.100.1
}

atf_test_case "chacha" "cleanup"
chacha_head()
{
atf_set descr 'Test DCO with the chacha algorithm'
atf_set require.user root
atf_set require.progs openvpn
}

chacha_body()
{
ovpn_algo_body CHACHA20-POLY1305
}

chacha_cleanup()
{
ovpn_cleanup
}

atf_test_case "gcm_128" "cleanup"
gcm_128_head()
{
atf_set descr 'Test DCO with AES-128-GCM'
atf_set require.user root
atf_set require.progs openvpn
}

gcm_128_body()
{
ovpn_algo_body AES-128-GCM
}

gcm_128_cleanup()
{
ovpn_cleanup
}

atf_init_test_cases()
{
atf_add_test_case "4in4"
Expand All @@ -1002,4 +1029,5 @@ atf_init_test_cases()
atf_add_test_case "route_to"
atf_add_test_case "ra"
atf_add_test_case "chacha"
atf_add_test_case "gcm_128"
}

0 comments on commit 832c8a5

Please sign in to comment.