File: CVE-2015-8023_eap_mschapv2_state.patch

package info (click to toggle)
strongswan 5.2.1-6%2Bdeb8u2~bpo70%2B1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy-backports
  • size: 48,080 kB
  • sloc: ansic: 292,318; sh: 16,273; sql: 7,950; makefile: 5,254; xml: 574; cs: 522; ruby: 453; lex: 406; yacc: 374; python: 236; ada: 111; perl: 93
file content (35 lines) | stat: -rw-r--r-- 1,015 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
From 91762f11e223e33b82182150d7c4cf7c2ec3cefa Mon Sep 17 00:00:00 2001
From: Tobias Brunner <tobias@strongswan.org>
Date: Thu, 29 Oct 2015 11:18:27 +0100
Subject: [PATCH] eap-mschapv2: Only succeed authentication if MSK was
 established

An MSK is only established if the client successfully authenticated
itself and only then must we accept an MSCHAPV2_SUCCESS message.

Fixes CVE-2015-8023
---
 src/libcharon/plugins/eap_mschapv2/eap_mschapv2.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/libcharon/plugins/eap_mschapv2/eap_mschapv2.c b/src/libcharon/plugins/eap_mschapv2/eap_mschapv2.c
index f7f39f9841d2..931e3c41dde4 100644
--- a/src/libcharon/plugins/eap_mschapv2/eap_mschapv2.c
+++ b/src/libcharon/plugins/eap_mschapv2/eap_mschapv2.c
@@ -1145,7 +1145,11 @@ METHOD(eap_method_t, process_server, status_t,
 		}
 		case MSCHAPV2_SUCCESS:
 		{
-			return SUCCESS;
+			if (this->msk.ptr)
+			{
+				return SUCCESS;
+			}
+			break;
 		}
 		case MSCHAPV2_FAILURE:
 		{
-- 
1.9.1