Disconnect hostapd from building in base
[dragonfly.git] / contrib / hostapd / src / eap_common / chap.c
CommitLineData
ebfa2275 1/*
a875087d 2 * CHAP-MD5 (RFC 1994)
4781064b 3 * Copyright (c) 2007-2009, Jouni Malinen <j@w1.fi>
ebfa2275 4 *
4781064b
JM
5 * This software may be distributed under the terms of the BSD license.
6 * See README for more details.
ebfa2275
SZ
7 */
8
9#include "includes.h"
10
a875087d 11#include "common.h"
4781064b 12#include "crypto/crypto.h"
a875087d 13#include "chap.h"
ebfa2275 14
4781064b 15int chap_md5(u8 id, const u8 *secret, size_t secret_len, const u8 *challenge,
a875087d 16 size_t challenge_len, u8 *response)
ebfa2275 17{
a875087d
JL
18 const u8 *addr[3];
19 size_t len[3];
ebfa2275 20
a875087d
JL
21 addr[0] = &id;
22 len[0] = 1;
23 addr[1] = secret;
24 len[1] = secret_len;
25 addr[2] = challenge;
26 len[2] = challenge_len;
4781064b 27 return md5_vector(3, addr, len, response);
ebfa2275 28}