Loading...
Searching...
No Matches
MD5 Routines

## Data Structures

struct | apr_md5_ctx_t

## Macros

#define | APR_MD5_DIGESTSIZE 16

## Typedefs

typedef struct apr_md5_ctx_t | apr_md5_ctx_t

## Functions

apr_status_t | apr_md5_init (apr_md5_ctx_t *context)
apr_status_t | apr_md5_set_xlate (apr_md5_ctx_t *context, apr_xlate_t *xlate)
apr_status_t | apr_md5_update (apr_md5_ctx_t *context, const void *input, apr_size_t inputLen)
apr_status_t | apr_md5_final (unsigned char digest[APR_MD5_DIGESTSIZE], apr_md5_ctx_t *context)
apr_status_t | apr_md5 (unsigned char digest[APR_MD5_DIGESTSIZE], const void *input, apr_size_t inputLen)
apr_status_t | apr_md5_encode (const char *password, const char *salt, char *result, apr_size_t nbytes)
apr_status_t | apr_bcrypt_encode (const char *pw, unsigned int count, const unsigned char *salt, apr_size_t salt_len, char *out, apr_size_t out_len)
apr_status_t | apr_password_validate (const char *passwd, const char *hash)

## Detailed Description

## Macro Definition Documentation

## APR_MD5_DIGESTSIZE

#define APR_MD5_DIGESTSIZE 16

The MD5 digest size

## Typedef Documentation

## apr_md5_ctx_t

typedef struct apr_md5_ctx_t apr_md5_ctx_t

See also
  apr_md5_ctx_t

## Function Documentation

## apr_bcrypt_encode()

apr_status_t apr_bcrypt_encode | ( | const char * | pw,
|  | unsigned int | count,
|  | const unsigned char * | salt,
|  | apr_size_t | salt_len,
|  | char * | out,
|  | apr_size_t | out_len
| ) |  |

Encode a password using the bcrypt algorithm

Parameters

  password | The password to encode
  count | The cost of the encoding, possible values are 4 to 31
  salt | Pointer to binary data to be used as salt for the encoding
  salt_len | The size of the salt data (must be >= 16)
  out | The string to store the encoded password in
  out_len | The size of the result buffer (must be >= 61)

## apr_md5()

apr_status_t apr_md5 | ( | unsigned char | digest[APR_MD5_DIGESTSIZE],
|  | const void * | input,
|  | apr_size_t | inputLen
| ) |  |

MD5 in one step

Parameters

  digest | The final MD5 digest
  input | The message block to use
  inputLen | The length of the message block

## apr_md5_encode()

apr_status_t apr_md5_encode | ( | const char * | password,
|  | const char * | salt,
|  | char * | result,
|  | apr_size_t | nbytes
| ) |  |

Encode a password using an MD5 algorithm

Parameters

  password | The password to encode
  salt | The salt string to use for the encoding
  result | The string to store the encoded password in
  nbytes | The size of the result buffer

## apr_md5_final()

apr_status_t apr_md5_final | ( | unsigned char | digest[APR_MD5_DIGESTSIZE],
|  | apr_md5_ctx_t * | context
| ) |  |

MD5 finalization. Ends an MD5 message-digest operation, writing the message digest and zeroing the context

Parameters

  digest | The final MD5 digest
  context | The MD5 content we are finalizing.

## apr_md5_init()

apr_status_t apr_md5_init | ( | apr_md5_ctx_t * | context | ) |

MD5 Initialize. Begins an MD5 operation, writing a new context.

Parameters

  context | The MD5 context to initialize.

## apr_md5_set_xlate()

apr_status_t apr_md5_set_xlate | ( | apr_md5_ctx_t * | context,
|  | apr_xlate_t * | xlate
| ) |  |

MD5 translation setup. Provides the APR translation handle to be used for translating the content before calculating the digest.

Parameters

  context | The MD5 content to set the translation for.
  xlate | The translation handle to use for this MD5 context

## apr_md5_update()

apr_status_t apr_md5_update | ( | apr_md5_ctx_t * | context,
|  | const void * | input,
|  | apr_size_t | inputLen
| ) |  |

MD5 block update operation. Continue an MD5 message-digest operation, processing another message block, and updating the context.

Parameters

  context | The MD5 content to update.
  input | next message block to update
  inputLen | The length of the next message block

## apr_password_validate()

apr_status_t apr_password_validate | ( | const char * | passwd,
|  | const char * | hash
| ) |  |

Validate hashes created by APR-supported algorithms: md5, bcrypt, and sha1. hashes created by crypt are supported only on platforms that provide crypt(3), so don't rely on that function unless you know that your application will be run only on platforms that support it. On platforms that don't support crypt(3), this falls back to a clear text string comparison.

Parameters

  passwd | The password to validate
  hash | The password to validate against