ANDROID: net: xfrm: make PF_KEY SHA256 use RFC-compliant truncation.
authorLorenzo Colitti <lorenzo@google.com>
Wed, 10 May 2017 14:54:04 +0000 (23:54 +0900)
committerAmit Pundir <amit.pundir@linaro.org>
Mon, 18 Dec 2017 15:41:22 +0000 (21:11 +0530)
When using the PF_KEY interface, SHA-256 hashes are hardcoded to
use 96-bit truncation. This is a violation of RFC4868, which
specifies 128-bit truncation, but will not be fixed upstream due
to backwards compatibility concerns and because the PF_KEY
interface is deprecated in favour of netlink XFRM (which allows
the app to specify an arbitrary truncation length).

Change the hardcoded truncation length from 96 to 128 so that
PF_KEY apps such as racoon will work with standards-compliant VPN
servers.

Bug: 34114242
Change-Id: Ie46bff4b6358f18117d0be241171d677d31d33f7
Signed-off-by: Lorenzo Colitti <lorenzo@google.com>
net/xfrm/xfrm_algo.c

index 44ac85fe2bc9bfe72ca1e1e55399428c41a581fa..d0ca0dbf494e4ce98675235c0f8af698e6d6e602 100644 (file)
@@ -241,7 +241,7 @@ static struct xfrm_algo_desc aalg_list[] = {
 
        .uinfo = {
                .auth = {
-                       .icv_truncbits = 96,
+                       .icv_truncbits = 128,
                        .icv_fullbits = 256,
                }
        },