apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sander Striker" <stri...@samba-tng.org>
Subject [PATCH] apr-util hmac md5
Date Mon, 04 Jun 2001 23:54:05 GMT

This patch adds HMAC MD5 to apr-util.


APU_DECLARE(apr_status_t) apr_hmac_md5_init(apr_hmac_md5_ctx_t *context,
                                            const unsigned char *key,
                                            apr_size_t keyLen);

APU_DECLARE(apr_status_t) apr_hmac_md5_update(apr_hmac_md5_ctx_t *context,
                                              const unsigned char *input,
                                              apr_size_t inputLen);

APU_DECLARE(apr_status_t) apr_hmac_md5_final(unsigned char
                                             apr_hmac_md5_ctx_t *context);

APU_DECLARE(apr_status_t) apr_hmac_md5(unsigned char digest[MD5_DIGESTSIZE],
                                       const unsigned char *key,
                                       apr_size_t keyLen,
                                       const unsigned char *input,
                                       apr_size_t inputLen);

The algorithm is pretty straightforward and I needed it anyway.
I used RFC2104 as a guide.

It probably needs some looking over. Also the doc comments are a bit
dense (I'm a bit to tired to come up with any good ones).



PS. If someone is looking into MD5, maybe MD5_DIGESTSIZE can be changed to
APR_MD5_DIGESTSIZE, like in the md4 code (which has APR_MD4_DIGESTSIZE).

View raw message