2
2
* MSCHAPV2 (RFC 2759)
3
3
* Copyright (c) 2004-2008, Jouni Malinen <j@w1.fi>
5
* This program is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License version 2 as
7
* published by the Free Software Foundation.
9
* Alternatively, this software may be distributed under the terms of BSD
12
* See README and COPYING for more details.
5
* This software may be distributed under the terms of the BSD license.
6
* See README for more details.
15
9
#include "includes.h"
70
64
wpa_hexdump_key(MSG_DEBUG, "MSCHAPV2: password hash",
71
65
password, password_len);
72
generate_nt_response_pwhash(auth_challenge, peer_challenge,
73
username, username_len,
74
password, nt_response);
75
generate_authenticator_response_pwhash(
76
password, peer_challenge, auth_challenge,
77
username, username_len, nt_response, auth_response);
66
if (generate_nt_response_pwhash(auth_challenge, peer_challenge,
67
username, username_len,
68
password, nt_response) ||
69
generate_authenticator_response_pwhash(
70
password, peer_challenge, auth_challenge,
71
username, username_len, nt_response,
79
75
wpa_hexdump_ascii_key(MSG_DEBUG, "MSCHAPV2: password",
80
76
password, password_len);
81
generate_nt_response(auth_challenge, peer_challenge,
82
username, username_len,
83
password, password_len, nt_response);
84
generate_authenticator_response(password, password_len,
85
peer_challenge, auth_challenge,
86
username, username_len,
87
nt_response, auth_response);
77
if (generate_nt_response(auth_challenge, peer_challenge,
78
username, username_len,
79
password, password_len,
81
generate_authenticator_response(password, password_len,
84
username, username_len,
89
89
wpa_hexdump(MSG_DEBUG, "MSCHAPV2: NT Response",
90
90
nt_response, MSCHAPV2_NT_RESPONSE_LEN);
100
100
hash_nt_password_hash(password_hash, password_hash_hash))
103
get_master_key(password_hash_hash, nt_response, master_key);
103
if (get_master_key(password_hash_hash, nt_response, master_key))
104
105
wpa_hexdump_key(MSG_DEBUG, "MSCHAPV2: Master Key",
105
106
master_key, MSCHAPV2_MASTER_KEY_LEN);