Deleted Added
full compact
chap.c (189261) chap.c (214734)
1/*
2 * CHAP-MD5 (RFC 1994)
1/*
2 * CHAP-MD5 (RFC 1994)
3 * Copyright (c) 2007, Jouni Malinen
3 * Copyright (c) 2007-2009, Jouni Malinen <j@w1.fi>
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.
13 */
14
15#include "includes.h"
16
17#include "common.h"
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.
13 */
14
15#include "includes.h"
16
17#include "common.h"
18#include "md5.h"
19#include "crypto.h"
18#include "crypto/crypto.h"
20#include "chap.h"
21
19#include "chap.h"
20
22void chap_md5(u8 id, const u8 *secret, size_t secret_len, const u8 *challenge,
21int chap_md5(u8 id, const u8 *secret, size_t secret_len, const u8 *challenge,
23 size_t challenge_len, u8 *response)
24{
25 const u8 *addr[3];
26 size_t len[3];
27
28 addr[0] = &id;
29 len[0] = 1;
30 addr[1] = secret;
31 len[1] = secret_len;
32 addr[2] = challenge;
33 len[2] = challenge_len;
22 size_t challenge_len, u8 *response)
23{
24 const u8 *addr[3];
25 size_t len[3];
26
27 addr[0] = &id;
28 len[0] = 1;
29 addr[1] = secret;
30 len[1] = secret_len;
31 addr[2] = challenge;
32 len[2] = challenge_len;
34 md5_vector(3, addr, len, response);
33 return md5_vector(3, addr, len, response);
35}
34}