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