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

SHA1 HMAC not dependent on OpenSSL. More...

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

Go to the source code of this file.

Functions

int fr_hmac_sha1 (uint8_t digest[static SHA1_DIGEST_LENGTH], uint8_t const *in, size_t inlen, uint8_t const *key, size_t key_len)
 Calculate HMAC using internal SHA1 implementation. More...
 

Detailed Description

SHA1 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).

Adapted from hmacmd5.c (HMAC-MD5). Test cases from RFC2202.

Author
Michael Richardson (mcr@s.nosp@m.ande.nosp@m.lman..nosp@m.otta.nosp@m.wa.on.nosp@m..ca)

Definition in file hmac_sha1.c.

Function Documentation

◆ fr_hmac_sha1()

int fr_hmac_sha1 ( uint8_t  digest[static SHA1_DIGEST_LENGTH],
uint8_t const *  in,
size_t  inlen,
uint8_t const *  key,
size_t  key_len 
)

Calculate HMAC using internal SHA1 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 124 of file hmac_sha1.c.

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