diff options
author | Ricardo Mestre <mestre@cvs.openbsd.org> | 2017-08-11 20:56:16 +0000 |
---|---|---|
committer | Ricardo Mestre <mestre@cvs.openbsd.org> | 2017-08-11 20:56:16 +0000 |
commit | dcc0f930c3365e8d56498bbb06d129ee37e52c4c (patch) | |
tree | 203e0db4d45a964efefbfbe56c0e3afddeb9fde9 /sys/net | |
parent | b4b728921807aedab6e41cd0ad9af1d4093aaeca (diff) |
During MPPE key reduction on the 40 bits case the first 3 octets need to be
changed with known constants (RFC3079). Current code uses a switch case without
breaks which implicitly makes the code correct, but to improve readibility the
first octect should have the constant assigned also in the first case, without
relying on a fallthrough to the second, and the break statement should be
called on boths cases.
This was a false positive found in Coverity CID 1453390, but changed due to
to readibility as explained above.
After discussion with millert@ and guenther@
Diffstat (limited to 'sys/net')
-rw-r--r-- | sys/net/pipex.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/net/pipex.c b/sys/net/pipex.c index 10ee07029f3..6ba44d75ec8 100644 --- a/sys/net/pipex.c +++ b/sys/net/pipex.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pipex.c,v 1.103 2017/07/13 14:54:25 mpi Exp $ */ +/* $OpenBSD: pipex.c,v 1.104 2017/08/11 20:56:15 mestre Exp $ */ /*- * Copyright (c) 2009 Internet Initiative Japan Inc. @@ -2311,10 +2311,13 @@ pipex_mppe_reduce_key(struct pipex_mppe *mppe) { switch (mppe->keylenbits) { case 40: + mppe->session_key[0] = 0xd1; mppe->session_key[1] = 0x26; mppe->session_key[2] = 0x9e; + break; case 56: mppe->session_key[0] = 0xd1; + break; } } |