]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
ip/xfrm: Do not allow redundant algorithm combinations to be specified
authorDavid Ward <david.ward@ll.mit.edu>
Mon, 25 Mar 2013 04:23:14 +0000 (04:23 +0000)
committerStephen Hemminger <stephen@networkplumber.org>
Thu, 28 Mar 2013 21:40:45 +0000 (14:40 -0700)
AEAD algorithms perform both encryption and authentication; they are
not combined with separate encryption or authentication algorithms.

Signed-off-by: David Ward <david.ward@ll.mit.edu>
ip/xfrm_state.c

index 3c01ec52e66505be1704127b97c192abcda2167b..85d3e352fec33336fbfcb94a554774d31492d7e3 100644 (file)
@@ -379,18 +379,18 @@ static int xfrm_state_modify(int cmd, unsigned flags, int argc, char **argv)
 
                                switch (type) {
                                case XFRMA_ALG_AEAD:
-                                       if (aeadop)
+                                       if (ealgop || aalgop || aeadop)
                                                duparg("ALGO-TYPE", *argv);
                                        aeadop = *argv;
                                        break;
                                case XFRMA_ALG_CRYPT:
-                                       if (ealgop)
+                                       if (ealgop || aeadop)
                                                duparg("ALGO-TYPE", *argv);
                                        ealgop = *argv;
                                        break;
                                case XFRMA_ALG_AUTH:
                                case XFRMA_ALG_AUTH_TRUNC:
-                                       if (aalgop)
+                                       if (aalgop || aeadop)
                                                duparg("ALGO-TYPE", *argv);
                                        aalgop = *argv;
                                        break;