WPA Supplicant / shared MSCHAPV2 helper functions / RFC 2433 / RFC 2759. More...
#include "includes.h"
#include "common.h"
#include "sha1.h"
#include "ms_funcs.h"
#include "crypto.h"
Go to the source code of this file.
Defines | |
#define | PWBLOCK_LEN 516 |
Functions | |
int | nt_password_hash (const u8 *password, size_t password_len, u8 *password_hash) |
NtPasswordHash() - RFC 2759, Sect. 8.3. | |
int | hash_nt_password_hash (const u8 *password_hash, u8 *password_hash_hash) |
HashNtPasswordHash() - RFC 2759, Sect. 8.4. | |
void | challenge_response (const u8 *challenge, const u8 *password_hash, u8 *response) |
ChallengeResponse() - RFC 2759, Sect. 8.5. | |
int | generate_nt_response (const u8 *auth_challenge, const u8 *peer_challenge, const u8 *username, size_t username_len, const u8 *password, size_t password_len, u8 *response) |
GenerateNTResponse() - RFC 2759, Sect. 8.1. | |
int | generate_nt_response_pwhash (const u8 *auth_challenge, const u8 *peer_challenge, const u8 *username, size_t username_len, const u8 *password_hash, u8 *response) |
GenerateNTResponse() - RFC 2759, Sect. 8.1. | |
int | generate_authenticator_response_pwhash (const u8 *password_hash, const u8 *peer_challenge, const u8 *auth_challenge, const u8 *username, size_t username_len, const u8 *nt_response, u8 *response) |
GenerateAuthenticatorResponse() - RFC 2759, Sect. 8.7. | |
int | generate_authenticator_response (const u8 *password, size_t password_len, const u8 *peer_challenge, const u8 *auth_challenge, const u8 *username, size_t username_len, const u8 *nt_response, u8 *response) |
GenerateAuthenticatorResponse() - RFC 2759, Sect. 8.7. | |
int | nt_challenge_response (const u8 *challenge, const u8 *password, size_t password_len, u8 *response) |
NtChallengeResponse() - RFC 2433, Sect. A.5. | |
int | get_master_key (const u8 *password_hash_hash, const u8 *nt_response, u8 *master_key) |
GetMasterKey() - RFC 3079, Sect. 3.4. | |
int | get_asymetric_start_key (const u8 *master_key, u8 *session_key, size_t session_key_len, int is_send, int is_server) |
GetAsymetricStartKey() - RFC 3079, Sect. 3.4. | |
int | encrypt_pw_block_with_password_hash (const u8 *password, size_t password_len, const u8 *password_hash, u8 *pw_block) |
EncryptPwBlockWithPasswordHash() - RFC 2759, Sect. 8.10. | |
int | new_password_encrypted_with_old_nt_password_hash (const u8 *new_password, size_t new_password_len, const u8 *old_password, size_t old_password_len, u8 *encrypted_pw_block) |
NewPasswordEncryptedWithOldNtPasswordHash() - RFC 2759, Sect. 8.9. | |
void | nt_password_hash_encrypted_with_block (const u8 *password_hash, const u8 *block, u8 *cypher) |
NtPasswordHashEncryptedWithBlock() - RFC 2759, Sect 8.13. | |
int | old_nt_password_hash_encrypted_with_new_nt_password_hash (const u8 *new_password, size_t new_password_len, const u8 *old_password, size_t old_password_len, u8 *encrypted_password_hash) |
OldNtPasswordHashEncryptedWithNewNtPasswordHash() - RFC 2759, Sect. 8.12. |
WPA Supplicant / shared MSCHAPV2 helper functions / RFC 2433 / RFC 2759.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation.
Alternatively, this software may be distributed under the terms of BSD license.
See README and COPYING for more details.
Definition in file ms_funcs.c.
void challenge_response | ( | const u8 * | challenge, | |
const u8 * | password_hash, | |||
u8 * | response | |||
) |
ChallengeResponse() - RFC 2759, Sect. 8.5.
challenge | 8-octet Challenge (IN) | |
password_hash | 16-octet PasswordHash (IN) | |
response | 24-octet Response (OUT) |
Definition at line 106 of file ms_funcs.c.
int encrypt_pw_block_with_password_hash | ( | const u8 * | password, | |
size_t | password_len, | |||
const u8 * | password_hash, | |||
u8 * | pw_block | |||
) |
EncryptPwBlockWithPasswordHash() - RFC 2759, Sect. 8.10.
password | 0-to-256-unicode-char Password (IN; ASCII) | |
password_len | Length of password | |
password_hash | 16-octet PasswordHash (IN) | |
pw_block | 516-byte PwBlock (OUT) |
Definition at line 397 of file ms_funcs.c.
int generate_authenticator_response | ( | const u8 * | password, | |
size_t | password_len, | |||
const u8 * | peer_challenge, | |||
const u8 * | auth_challenge, | |||
const u8 * | username, | |||
size_t | username_len, | |||
const u8 * | nt_response, | |||
u8 * | response | |||
) |
GenerateAuthenticatorResponse() - RFC 2759, Sect. 8.7.
password | 0-to-256-unicode-char Password (IN; ASCII) | |
password_len | Length of password | |
nt_response | 24-octet NT-Response (IN) | |
peer_challenge | 16-octet PeerChallenge (IN) | |
auth_challenge | 16-octet AuthenticatorChallenge (IN) | |
username | 0-to-256-char UserName (IN) | |
username_len | Length of username | |
response | 20-octet AuthenticatorResponse (OUT) (note: this value is usually encoded as a 42-octet ASCII string (S=hexdump_of_response) |
Definition at line 248 of file ms_funcs.c.
int generate_authenticator_response_pwhash | ( | const u8 * | password_hash, | |
const u8 * | peer_challenge, | |||
const u8 * | auth_challenge, | |||
const u8 * | username, | |||
size_t | username_len, | |||
const u8 * | nt_response, | |||
u8 * | response | |||
) |
GenerateAuthenticatorResponse() - RFC 2759, Sect. 8.7.
password_hash | 16-octet PasswordHash (IN) | |
nt_response | 24-octet NT-Response (IN) | |
peer_challenge | 16-octet PeerChallenge (IN) | |
auth_challenge | 16-octet AuthenticatorChallenge (IN) | |
username | 0-to-256-char UserName (IN) | |
username_len | Length of username | |
response | 20-octet AuthenticatorResponse (OUT) (note: this value is usually encoded as a 42-octet ASCII string (S=hexdump_of_response) |
Definition at line 189 of file ms_funcs.c.
int generate_nt_response | ( | const u8 * | auth_challenge, | |
const u8 * | peer_challenge, | |||
const u8 * | username, | |||
size_t | username_len, | |||
const u8 * | password, | |||
size_t | password_len, | |||
u8 * | response | |||
) |
GenerateNTResponse() - RFC 2759, Sect. 8.1.
auth_challenge | 16-octet AuthenticatorChallenge (IN) | |
peer_challenge | 16-octet PeerChallenge (IN) | |
username | 0-to-256-char UserName (IN) | |
username_len | Length of username | |
password | 0-to-256-unicode-char Password (IN; ASCII) | |
password_len | Length of password | |
response | 24-octet Response (OUT) |
Definition at line 131 of file ms_funcs.c.
int generate_nt_response_pwhash | ( | const u8 * | auth_challenge, | |
const u8 * | peer_challenge, | |||
const u8 * | username, | |||
size_t | username_len, | |||
const u8 * | password_hash, | |||
u8 * | response | |||
) |
GenerateNTResponse() - RFC 2759, Sect. 8.1.
auth_challenge | 16-octet AuthenticatorChallenge (IN) | |
peer_challenge | 16-octet PeerChallenge (IN) | |
username | 0-to-256-char UserName (IN) | |
username_len | Length of username | |
password_hash | 16-octet PasswordHash (IN) | |
response | 24-octet Response (OUT) |
Definition at line 159 of file ms_funcs.c.
int get_asymetric_start_key | ( | const u8 * | master_key, | |
u8 * | session_key, | |||
size_t | session_key_len, | |||
int | is_send, | |||
int | is_server | |||
) |
GetAsymetricStartKey() - RFC 3079, Sect. 3.4.
master_key | 16-octet MasterKey (IN) | |
session_key | 8-to-16 octet SessionKey (OUT) | |
session_key_len | SessionKeyLength (Length of session_key) (IN) | |
is_send | IsSend (IN, BOOLEAN) | |
is_server | IsServer (IN, BOOLEAN) |
Definition at line 324 of file ms_funcs.c.
int get_master_key | ( | const u8 * | password_hash_hash, | |
const u8 * | nt_response, | |||
u8 * | master_key | |||
) |
GetMasterKey() - RFC 3079, Sect. 3.4.
password_hash_hash | 16-octet PasswordHashHash (IN) | |
nt_response | 24-octet NTResponse (IN) | |
master_key | 16-octet MasterKey (OUT) |
Definition at line 291 of file ms_funcs.c.
int hash_nt_password_hash | ( | const u8 * | password_hash, | |
u8 * | password_hash_hash | |||
) |
HashNtPasswordHash() - RFC 2759, Sect. 8.4.
password_hash | 16-octet PasswordHash (IN) | |
password_hash_hash | 16-octet PasswordHashHash (OUT) |
Definition at line 92 of file ms_funcs.c.
int new_password_encrypted_with_old_nt_password_hash | ( | const u8 * | new_password, | |
size_t | new_password_len, | |||
const u8 * | old_password, | |||
size_t | old_password_len, | |||
u8 * | encrypted_pw_block | |||
) |
NewPasswordEncryptedWithOldNtPasswordHash() - RFC 2759, Sect. 8.9.
new_password | 0-to-256-unicode-char NewPassword (IN; ASCII) | |
new_password_len | Length of new_password | |
old_password | 0-to-256-unicode-char OldPassword (IN; ASCII) | |
old_password_len | Length of old_password | |
encrypted_pw_block | 516-octet EncryptedPwBlock (OUT) |
Definition at line 434 of file ms_funcs.c.
int nt_challenge_response | ( | const u8 * | challenge, | |
const u8 * | password, | |||
size_t | password_len, | |||
u8 * | response | |||
) |
NtChallengeResponse() - RFC 2433, Sect. A.5.
challenge | 8-octet Challenge (IN) | |
password | 0-to-256-unicode-char Password (IN; ASCII) | |
password_len | Length of password | |
response | 24-octet Response (OUT) |
Definition at line 272 of file ms_funcs.c.
int nt_password_hash | ( | const u8 * | password, | |
size_t | password_len, | |||
u8 * | password_hash | |||
) |
NtPasswordHash() - RFC 2759, Sect. 8.3.
password | 0-to-256-unicode-char Password (IN; ASCII) | |
password_len | Length of password | |
password_hash | 16-octet PasswordHash (OUT) |
Definition at line 64 of file ms_funcs.c.
void nt_password_hash_encrypted_with_block | ( | const u8 * | password_hash, | |
const u8 * | block, | |||
u8 * | cypher | |||
) |
NtPasswordHashEncryptedWithBlock() - RFC 2759, Sect 8.13.
password_hash | 16-octer PasswordHash (IN) | |
block | 16-octet Block (IN) | |
cypher | 16-octer Cypher (OUT) |
Definition at line 458 of file ms_funcs.c.
int old_nt_password_hash_encrypted_with_new_nt_password_hash | ( | const u8 * | new_password, | |
size_t | new_password_len, | |||
const u8 * | old_password, | |||
size_t | old_password_len, | |||
u8 * | encrypted_password_hash | |||
) |
OldNtPasswordHashEncryptedWithNewNtPasswordHash() - RFC 2759, Sect. 8.12.
new_password | 0-to-256-unicode-char NewPassword (IN; ASCII) | |
new_password_len | Length of new_password | |
old_password | 0-to-256-unicode-char OldPassword (IN; ASCII) | |
old_password_len | Length of old_password | |
encrypted_password_hash | 16-octet EncryptedPasswordHash (OUT) |
Definition at line 476 of file ms_funcs.c.