Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F178011230
D62099.1795755425.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
3 KB
Referenced Files
None
Subscribers
None
D62099.1795755425.diff
View Options
diff --git a/sys/netinet6/ip6_input.c b/sys/netinet6/ip6_input.c
--- a/sys/netinet6/ip6_input.c
+++ b/sys/netinet6/ip6_input.c
@@ -534,18 +534,6 @@
if ((rcvif->if_inet6->nd_flags & ND6_IFF_IFDISABLED))
goto bad;
-#if defined(IPSEC) || defined(IPSEC_SUPPORT)
- /*
- * should the inner packet be considered authentic?
- * see comment in ah4_input().
- * NB: m cannot be NULL when passed to the input routine
- */
-
- m->m_flags &= ~M_AUTHIPHDR;
- m->m_flags &= ~M_AUTHIPDGM;
-
-#endif /* IPSEC */
-
if (m->m_flags & M_FASTFWD_OURS) {
/*
* Firewall changed destination to local.
diff --git a/tests/sys/netipsec/tunnel/Makefile b/tests/sys/netipsec/tunnel/Makefile
--- a/tests/sys/netipsec/tunnel/Makefile
+++ b/tests/sys/netipsec/tunnel/Makefile
@@ -11,6 +11,7 @@
aesni_aes_cbc_256_hmac_sha2_256 \
aesni_aes_gcm_128 \
aesni_aes_gcm_256 \
+ ah_hmac_sha2_256 \
bundle \
chacha20_poly1305 \
esp_iv \
diff --git a/tests/sys/netipsec/tunnel/ah_hmac_sha2_256.sh b/tests/sys/netipsec/tunnel/ah_hmac_sha2_256.sh
new file mode 100644
--- /dev/null
+++ b/tests/sys/netipsec/tunnel/ah_hmac_sha2_256.sh
@@ -0,0 +1,42 @@
+
+. $(atf_get_srcdir)/utils.subr
+
+atf_test_case "v4" "cleanup"
+v4_head()
+{
+ atf_set descr 'IPSec inet4 AH tunnel using hmac-sha2-256'
+ atf_set require.user root
+}
+
+v4_body()
+{
+ ist_test 4 "" "" hmac-sha2-256 "12345678901234567890123456789012"
+}
+
+v4_cleanup()
+{
+ ist_cleanup
+}
+
+atf_test_case "v6" "cleanup"
+v6_head()
+{
+ atf_set descr 'IPSec inet6 AH tunnel using hmac-sha2-256'
+ atf_set require.user root
+}
+
+v6_body()
+{
+ ist_test 6 "" "" hmac-sha2-256 "12345678901234567890123456789012"
+}
+
+v6_cleanup()
+{
+ ist_cleanup
+}
+
+atf_init_test_cases()
+{
+ atf_add_test_case "v4"
+ atf_add_test_case "v6"
+}
diff --git a/tests/sys/netipsec/tunnel/utils.subr b/tests/sys/netipsec/tunnel/utils.subr
--- a/tests/sys/netipsec/tunnel/utils.subr
+++ b/tests/sys/netipsec/tunnel/utils.subr
@@ -79,6 +79,8 @@
enc_key=$5
auth_algo=$6
auth_key=$7
+ # AH when there is no encryption algorithm.
+ [ -n "${enc_algo}" ] && proto=esp || proto=ah
# Load
(
@@ -99,14 +101,18 @@
fi
printf "spdadd ${SRC_LAN} ${DST_LAN} any -P "
[ ${dir} = "out" ] && printf "out" || printf "in"
- printf " ipsec esp/tunnel/${SRC_GW}-${DST_GW}/require;\n"
+ printf " ipsec ${proto}/tunnel/${SRC_GW}-${DST_GW}/require;\n"
printf "spdadd ${DST_LAN} ${SRC_LAN} any -P "
[ ${dir} = "out" ] && printf "in" || printf "out"
- printf " ipsec esp/tunnel/${DST_GW}-${SRC_GW}/require;\n"
- printf "add ${SRC_GW} ${DST_GW} esp 0x1000 -E ${enc_algo} \"${enc_key}\""
- [ -n "${auth_algo}" ] && printf " -A ${auth_algo} \"${auth_key}\";\n" || printf ";\n"
- printf "add ${DST_GW} ${SRC_GW} esp 0x1001 -E ${enc_algo} \"${enc_key}\""
- [ -n "$auth_algo" ] && printf " -A ${auth_algo} \"${auth_key}\";\n" || printf ";\n"
+ printf " ipsec ${proto}/tunnel/${DST_GW}-${SRC_GW}/require;\n"
+ printf "add ${SRC_GW} ${DST_GW} ${proto} 0x1000"
+ [ -n "${enc_algo}" ] && printf " -E ${enc_algo} \"${enc_key}\""
+ [ -n "${auth_algo}" ] && printf " -A ${auth_algo} \"${auth_key}\""
+ printf ";\n"
+ printf "add ${DST_GW} ${SRC_GW} ${proto} 0x1001"
+ [ -n "${enc_algo}" ] && printf " -E ${enc_algo} \"${enc_key}\""
+ [ -n "${auth_algo}" ] && printf " -A ${auth_algo} \"${auth_key}\""
+ printf ";\n"
) > ${TMPDIR}/ipsec.${jname}.conf
}
@@ -115,9 +121,9 @@
ist_init
ist_labsetup
[ $1 -eq 4 ] && ist_v4_setup || ist_v6_setup
- ist_setkey ipsecA out $@
+ ist_setkey ipsecA out "$@"
atf_check -s exit:0 -o ignore jexec ipsecA setkey -f ${TMPDIR}/ipsec.ipsecA.conf
- ist_setkey ipsecB in $@
+ ist_setkey ipsecB in "$@"
atf_check -s exit:0 -o ignore jexec ipsecB setkey -f ${TMPDIR}/ipsec.ipsecB.conf
# Check ipsec tunnel
if [ $1 -eq 4 ]; then
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Nov 27, 4:57 AM (18 h, 35 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
42036222
Default Alt Text
D62099.1795755425.diff (3 KB)
Attached To
Mode
D62099: netinet6: Keep the AH flags on the inner packet of a tunnel mode SA
Attached
Detach File
Event Timeline