2008-02-28 02:34:43 +01:00
|
|
|
/*
|
|
|
|
* CHAP-MD5 (RFC 1994)
|
2009-08-16 17:38:35 +02:00
|
|
|
* Copyright (c) 2007-2009, Jouni Malinen <j@w1.fi>
|
2008-02-28 02:34:43 +01:00
|
|
|
*
|
2012-02-11 15:46:35 +01:00
|
|
|
* This software may be distributed under the terms of the BSD license.
|
|
|
|
* See README for more details.
|
2008-02-28 02:34:43 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "includes.h"
|
|
|
|
|
|
|
|
#include "common.h"
|
2009-11-29 22:04:43 +01:00
|
|
|
#include "crypto/crypto.h"
|
2008-02-28 02:34:43 +01:00
|
|
|
#include "chap.h"
|
|
|
|
|
2009-08-16 17:38:35 +02:00
|
|
|
int chap_md5(u8 id, const u8 *secret, size_t secret_len, const u8 *challenge,
|
2008-02-28 02:34:43 +01:00
|
|
|
size_t challenge_len, u8 *response)
|
|
|
|
{
|
|
|
|
const u8 *addr[3];
|
|
|
|
size_t len[3];
|
|
|
|
|
|
|
|
addr[0] = &id;
|
|
|
|
len[0] = 1;
|
|
|
|
addr[1] = secret;
|
|
|
|
len[1] = secret_len;
|
|
|
|
addr[2] = challenge;
|
|
|
|
len[2] = challenge_len;
|
2009-08-16 17:38:35 +02:00
|
|
|
return md5_vector(3, addr, len, response);
|
2008-02-28 02:34:43 +01:00
|
|
|
}
|