chap.c revision 252726
11541Srgrimes/* 21541Srgrimes * CHAP-MD5 (RFC 1994) 31541Srgrimes * Copyright (c) 2007-2009, Jouni Malinen <j@w1.fi> 41541Srgrimes * 51541Srgrimes * This software may be distributed under the terms of the BSD license. 61541Srgrimes * See README for more details. 71541Srgrimes */ 81541Srgrimes 91541Srgrimes#include "includes.h" 101541Srgrimes 111541Srgrimes#include "common.h" 121541Srgrimes#include "crypto/crypto.h" 131541Srgrimes#include "chap.h" 141541Srgrimes 151541Srgrimesint chap_md5(u8 id, const u8 *secret, size_t secret_len, const u8 *challenge, 161541Srgrimes size_t challenge_len, u8 *response) 171541Srgrimes{ 181541Srgrimes const u8 *addr[3]; 191541Srgrimes size_t len[3]; 201541Srgrimes 211541Srgrimes addr[0] = &id; 221541Srgrimes len[0] = 1; 231541Srgrimes addr[1] = secret; 241541Srgrimes len[1] = secret_len; 251541Srgrimes addr[2] = challenge; 261541Srgrimes len[2] = challenge_len; 271541Srgrimes return md5_vector(3, addr, len, response); 281541Srgrimes} 291541Srgrimes