~ubuntu-branches/ubuntu/trusty/wpa/trusty

« back to all changes in this revision

Viewing changes to src/eap_peer/mschapv2.c

  • Committer: Package Import Robot
  • Author(s): Mathieu Trudel-Lapierre
  • Date: 2014-03-04 16:13:24 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20140304161324-md40gw8imcectbuu
Tags: 2.1-0ubuntu1
* New upstream release (LP: #1099755)
* debian/get-orig-source: update for new git repository for the current
  hostap/wpasupplicant versions.
* Dropped patches due to being applied upstream and included in the current
  source tarball:
  - debian/patches/11_wpa_gui_ftbfs_gcc_4_7.patch
  - debian/patches/13_human_readable_signal.patch
  - debian/patches/git_deinit_p2p_context_on_mgmt_remove_ff1f9c8.patch
  - debian/patches/libnl3-includes.patch
* debian/patches/git_accept_client_cert_from_server.patch: revert the commit:
  "OpenSSL: Do not accept SSL Client certificate for server", which breaks
  many AAA servers that include both client and server EKUs. Cherry-picked
  from hostap git commit b62d5b5.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 * MSCHAPV2 (RFC 2759)
3
3
 * Copyright (c) 2004-2008, Jouni Malinen <j@w1.fi>
4
4
 *
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.
8
 
 *
9
 
 * Alternatively, this software may be distributed under the terms of BSD
10
 
 * license.
11
 
 *
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.
13
7
 */
14
8
 
15
9
#include "includes.h"
69
63
        if (pwhash) {
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,
 
72
                            auth_response))
 
73
                        return -1;
78
74
        } else {
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,
 
80
                                         nt_response) ||
 
81
                    generate_authenticator_response(password, password_len,
 
82
                                                    peer_challenge,
 
83
                                                    auth_challenge,
 
84
                                                    username, username_len,
 
85
                                                    nt_response,
 
86
                                                    auth_response))
 
87
                        return -1;
88
88
        }
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))
101
101
                        return -1;
102
102
        }
103
 
        get_master_key(password_hash_hash, nt_response, master_key);
 
103
        if (get_master_key(password_hash_hash, nt_response, master_key))
 
104
                return -1;
104
105
        wpa_hexdump_key(MSG_DEBUG, "MSCHAPV2: Master Key",
105
106
                        master_key, MSCHAPV2_MASTER_KEY_LEN);
106
107