The FreeRADIUS server  $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
Functions
hmac_md5.c File Reference

MD5 HMAC not dependent on OpenSSL. More...

#include <freeradius-devel/util/atexit.h>
#include <freeradius-devel/util/md5.h>
#include <freeradius-devel/util/strerror.h>
+ Include dependency graph for hmac_md5.c:

Go to the source code of this file.

Functions

int fr_hmac_md5 (uint8_t digest[MD5_DIGEST_LENGTH], uint8_t const *in, size_t inlen, uint8_t const *key, size_t key_len)
 Calculate HMAC using internal MD5 implementation. More...
 

Detailed Description

MD5 HMAC not dependent on OpenSSL.

Note
New code that needs fast or incremental HMACs should use the OpenSSL EVP_* HMAC interface instead, as that can take advantage of acceleration instructions provided by various CPUs (and provides an incremental hashing interface).

For the sake of illustration we provide the following sample code for the implementation of HMAC-MD5 as well as some corresponding test vectors (the code is based on MD5 code as described in [MD5]).

Definition in file hmac_md5.c.

Function Documentation

◆ fr_hmac_md5()

int fr_hmac_md5 ( uint8_t  digest[MD5_DIGEST_LENGTH],
uint8_t const *  in,
size_t  inlen,
uint8_t const *  key,
size_t  key_len 
)

Calculate HMAC using internal MD5 implementation.

Parameters
digestCaller digest to be filled in.
inPointer to data stream.
inlenlength of data stream.
keyPointer to authentication key.
key_lenLength of authentication key.
Returns
  • 0 on success.
  • -1 on error.

Definition at line 119 of file hmac_md5.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function: