Lines Matching +full:aes +full:- +full:gcm

2 # SPDX-License-Identifier: GPL-2.0
6 # host-1 | router | host-2
30 if [ ${rc} -eq ${expected} ]; then
31 printf "TEST: %-60s [ OK ]\n" "${msg}"
36 printf "TEST: %-60s [FAIL]\n" "${msg}"
63 if [ "$VERBOSE" = "1" -a -n "$out" ]; then
81 [ -z "${addr}" ] && addr="-"
82 [ -z "${addr6}" ] && addr6="-"
84 if [ "${addr}" != "-" ]; then
85 ip -netns ${ns} addr add dev lo ${addr}
87 if [ "${addr6}" != "-" ]; then
88 ip -netns ${ns} -6 addr add dev lo ${addr6}
91 ip -netns ${ns} ro add unreachable default metric 8192
92 ip -netns ${ns} -6 ro add unreachable default metric 8192
94 ip netns exec ${ns} sysctl -qw net.ipv4.ip_forward=1
95 ip netns exec ${ns} sysctl -qw net.ipv6.conf.all.keep_addr_on_down=1
96 ip netns exec ${ns} sysctl -qw net.ipv6.conf.all.forwarding=1
97 ip netns exec ${ns} sysctl -qw net.ipv6.conf.default.forwarding=1
98 ip netns exec ${ns} sysctl -qw net.ipv6.conf.default.accept_dad=0
113 ip -netns ${ns1} li add ${ns1_dev} type veth peer name tmp
114 ip -netns ${ns1} li set ${ns1_dev} up
115 ip -netns ${ns1} li set tmp netns ${ns2} name ${ns2_dev}
116 ip -netns ${ns2} li set ${ns2_dev} up
118 if [ "${ns1_addr}" != "-" ]; then
119 ip -netns ${ns1} addr add dev ${ns1_dev} ${ns1_addr}
120 ip -netns ${ns2} addr add dev ${ns2_dev} ${ns2_addr}
123 if [ "${ns1_addr6}" != "-" ]; then
124 ip -netns ${ns1} addr add dev ${ns1_dev} ${ns1_addr6}
125 ip -netns ${ns2} addr add dev ${ns2_dev} ${ns2_addr6}
140 # configure l2tpv3 tunnel on host-1
142 ip -netns $host_1 l2tp add tunnel tunnel_id 1041 peer_tunnel_id 1042 \
144 ip -netns $host_1 l2tp add session name l2tp4 tunnel_id 1041 \
146 ip -netns $host_1 link set dev l2tp4 up
147 ip -netns $host_1 addr add dev l2tp4 172.16.1.1 peer 172.16.1.2
150 # configure l2tpv3 tunnel on host-2
152 ip -netns $host_2 l2tp add tunnel tunnel_id 1042 peer_tunnel_id 1041 \
154 ip -netns $host_2 l2tp add session name l2tp4 tunnel_id 1042 \
156 ip -netns $host_2 link set dev l2tp4 up
157 ip -netns $host_2 addr add dev l2tp4 172.16.1.2 peer 172.16.1.1
162 ip -netns $host_1 ro add 172.16.101.2/32 via 172.16.1.2
163 ip -netns $host_2 ro add 172.16.101.1/32 via 172.16.1.1
169 # configure l2tpv3 tunnel on host-1
171 ip -netns $host_1 l2tp add tunnel tunnel_id 1061 peer_tunnel_id 1062 \
173 ip -netns $host_1 l2tp add session name l2tp6 tunnel_id 1061 \
175 ip -netns $host_1 link set dev l2tp6 up
176 ip -netns $host_1 addr add dev l2tp6 fc00:1::1 peer fc00:1::2
179 # configure l2tpv3 tunnel on host-2
181 ip -netns $host_2 l2tp add tunnel tunnel_id 1062 peer_tunnel_id 1061 \
183 ip -netns $host_2 l2tp add session name l2tp6 tunnel_id 1062 \
185 ip -netns $host_2 link set dev l2tp6 up
186 ip -netns $host_2 addr add dev l2tp6 fc00:1::2 peer fc00:1::1
191 ip -netns $host_1 -6 ro add fc00:101::2/128 via fc00:1::2
192 ip -netns $host_2 -6 ro add fc00:101::1/128 via fc00:1::1
200 set -e
212 ip -netns $host_1 ro add 10.1.2.0/24 via 10.1.1.2
213 ip -netns $host_1 -6 ro add 2001:db8:2::/64 via 2001:db8:1::2
215 ip -netns $host_2 ro add 10.1.1.0/24 via 10.1.2.2
216 ip -netns $host_2 -6 ro add 2001:db8:1::/64 via 2001:db8:2::2
244 ip -netns $host_1 xfrm state add \
246 spi 0x1000 proto esp aead 'rfc4106(gcm(aes))' \
249 ip -netns $host_1 xfrm state add \
251 spi 0x1001 proto esp aead 'rfc4106(gcm(aes))' \
254 ip -netns $host_2 xfrm state add \
256 spi 0x1000 proto esp aead 'rfc4106(gcm(aes))' \
259 ip -netns $host_2 xfrm state add \
261 spi 0x1001 proto esp aead 'rfc4106(gcm(aes))' \
267 run_cmd $host_1 ip -6 xfrm policy add \
271 run_cmd $host_1 ip -6 xfrm policy add \
275 run_cmd $host_2 ip -6 xfrm policy add \
279 run_cmd $host_2 ip -6 xfrm policy add \
283 ip -netns $host_1 -6 xfrm state add \
285 spi 0x1000 proto esp aead 'rfc4106(gcm(aes))' \
288 ip -netns $host_1 -6 xfrm state add \
290 spi 0x1001 proto esp aead 'rfc4106(gcm(aes))' \
293 ip -netns $host_2 -6 xfrm state add \
295 spi 0x1000 proto esp aead 'rfc4106(gcm(aes))' \
298 ip -netns $host_2 -6 xfrm state add \
300 spi 0x1001 proto esp aead 'rfc4106(gcm(aes))' \
319 run_cmd $host_1 ping -c1 -w1 172.16.1.2
322 run_cmd $host_1 ping -c1 -w1 -I 172.16.101.1 172.16.101.2
325 run_cmd $host_1 ${ping6} -c1 -w1 fc00:1::2
328 run_cmd $host_1 ${ping6} -c1 -w1 -I fc00:101::1 fc00:101::2
340 run_ping "- with IPsec"
341 run_cmd $host_1 ping -c1 -w1 172.16.1.2
344 run_cmd $host_1 ping -c1 -w1 -I 172.16.101.1 172.16.101.2
347 run_cmd $host_1 ${ping6} -c1 -w1 fc00:1::2
348 log_test $? 0 "IPv6 basic L2TP tunnel - with IPsec"
350 run_cmd $host_1 ${ping6} -c1 -w1 -I fc00:101::1 fc00:101::2
351 log_test $? 0 "IPv6 route through L2TP tunnel - with IPsec"
354 run_ping "- after IPsec teardown"
360 declare -i nfail=0
361 declare -i nsuccess=0