crypto.c File Reference

#include "internal.h"
#include "gc.h"

Go to the source code of this file.

Functions

int gsasl_nonce (char *data, size_t datalen)
int gsasl_random (char *data, size_t datalen)
int gsasl_md5 (const char *in, size_t inlen, char *out[16])
int gsasl_hmac_md5 (const char *key, size_t keylen, const char *in, size_t inlen, char *outhash[16])


Function Documentation

int gsasl_hmac_md5 ( const char *  key,
size_t  keylen,
const char *  in,
size_t  inlen,
char *  outhash[16] 
)

gsasl_hmac_md5:

Parameters:
key input character array with key to use.
keylen length of input character array with key to use.
in input character array of data to hash.
inlen length of input character array of data to hash.
outhash newly allocated character array with keyed hash of data.
Compute keyed checksum of data using HMAC-MD5. The buffer must be deallocated by the caller.

Return value: Returns GSASL_OK iff successful.

Definition at line 92 of file crypto.c.

References GSASL_MALLOC_ERROR.

int gsasl_md5 ( const char *  in,
size_t  inlen,
char *  out[16] 
)

gsasl_md5:

Parameters:
in input character array of data to hash.
inlen length of input character array of data to hash.
out newly allocated character array with hash of data.
Compute hash of data using MD5. The buffer must be deallocated by the caller.

Return value: Returns GSASL_OK iff successful.

Definition at line 70 of file crypto.c.

References GSASL_MALLOC_ERROR.

Referenced by _gsasl_digest_md5_client_step(), and _gsasl_digest_md5_server_step().

int gsasl_nonce ( char *  data,
size_t  datalen 
)

gsasl_nonce:

Parameters:
data output array to be filled with unpredictable random data.
datalen size of output array.
Store unpredictable data of given size in the provided buffer.

Return value: Returns GSASL_OK iff successful.

Definition at line 37 of file crypto.c.

Referenced by _gsasl_digest_md5_client_start(), _gsasl_digest_md5_server_start(), and gsasl_randomize().

int gsasl_random ( char *  data,
size_t  datalen 
)

gsasl_random:

Parameters:
data output array to be filled with strong random data.
datalen size of output array.
Store cryptographically strong random data of given size in the provided buffer.

Return value: Returns GSASL_OK iff successful.

Definition at line 53 of file crypto.c.

Referenced by gsasl_randomize().


Generated on Tue Aug 22 12:06:07 2006 for gsasl by  doxygen 1.4.7