diff options
author | sam <sam@FreeBSD.org> | 2005-06-05 22:35:03 +0000 |
---|---|---|
committer | sam <sam@FreeBSD.org> | 2005-06-05 22:35:03 +0000 |
commit | 21e78f430e299464b3c902bec78f8daa1f0e2e71 (patch) | |
tree | a7d225a062cd128980707f3fa918dec2d015c46b /contrib/hostapd/md5.h | |
download | FreeBSD-src-21e78f430e299464b3c902bec78f8daa1f0e2e71.zip FreeBSD-src-21e78f430e299464b3c902bec78f8daa1f0e2e71.tar.gz |
Stripped down import of hostapd v0.3.7
Diffstat (limited to 'contrib/hostapd/md5.h')
-rw-r--r-- | contrib/hostapd/md5.h | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/contrib/hostapd/md5.h b/contrib/hostapd/md5.h new file mode 100644 index 0000000..cc3eb95 --- /dev/null +++ b/contrib/hostapd/md5.h @@ -0,0 +1,43 @@ +#ifndef MD5_H +#define MD5_H + +#ifdef EAP_TLS_FUNCS + +#include <openssl/md5.h> + +#define MD5Init MD5_Init +#define MD5Update MD5_Update +#define MD5Final MD5_Final +#define MD5Transform MD5_Transform + +#define MD5_MAC_LEN MD5_DIGEST_LENGTH + +#else /* EAP_TLS_FUNCS */ + +#define MD5_MAC_LEN 16 + +struct MD5Context { + u32 buf[4]; + u32 bits[2]; + u8 in[64]; +}; + +void MD5Init(struct MD5Context *context); +void MD5Update(struct MD5Context *context, unsigned char const *buf, + unsigned len); +void MD5Final(unsigned char digest[16], struct MD5Context *context); +void MD5Transform(u32 buf[4], u32 const in[16]); + +typedef struct MD5Context MD5_CTX; + +#endif /* EAP_TLS_FUNCS */ + + +void md5_mac(const u8 *key, size_t key_len, const u8 *data, size_t data_len, + u8 *mac); +void hmac_md5_vector(const u8 *key, size_t key_len, size_t num_elem, + const u8 *addr[], const size_t *len, u8 *mac); +void hmac_md5(const u8 *key, size_t key_len, const u8 *data, size_t data_len, + u8 *mac); + +#endif /* MD5_H */ |