18d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt/*
28d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt * MSCHAPV2 (RFC 2759)
38d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt * Copyright (c) 2004-2008, Jouni Malinen <j@w1.fi>
48d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt *
5c5ec7f57ead87efa365800228aa0b09a12d9e6c4Dmitry Shmidt * This software may be distributed under the terms of the BSD license.
6c5ec7f57ead87efa365800228aa0b09a12d9e6c4Dmitry Shmidt * See README for more details.
78d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt */
88d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
98d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#ifndef MSCHAPV2_H
108d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#define MSCHAPV2_H
118d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
128d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#define MSCHAPV2_CHAL_LEN 16
138d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#define MSCHAPV2_NT_RESPONSE_LEN 24
148d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#define MSCHAPV2_AUTH_RESPONSE_LEN 20
158d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#define MSCHAPV2_MASTER_KEY_LEN 16
168d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
178d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtconst u8 * mschapv2_remove_domain(const u8 *username, size_t *len);
188d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint mschapv2_derive_response(const u8 *username, size_t username_len,
198d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt			     const u8 *password, size_t password_len,
208d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt			     int pwhash,
218d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt			     const u8 *auth_challenge,
228d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt			     const u8 *peer_challenge,
238d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt			     u8 *nt_response, u8 *auth_response,
248d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt			     u8 *master_key);
258d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint mschapv2_verify_auth_response(const u8 *auth_response,
268d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt				  const u8 *buf, size_t buf_len);
278d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
288d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#endif /* MSCHAPV2_H */
29