Displaying 2 results from an estimated 2 matches for "hash_method".
2012 Sep 04
2
[PATCH] Generalize HMAC implementation
Hello everyone and Timo in particular,
about a year ago I implemented a SHA-1 variant of the HMAC(-MD5) present
in Dovecot.
I had always disliked this a bit, because it replicates a lot of code.
This patch generalizes the HMAC function to take a hash_method struct as
parameter, and changes existing code which uses the "old" HMAC function
to use this new one.
I'm not really sure this is actually a good idea, but I still felt I
should provide the code in case you would want to merge it upstream.
Attached is the patch as a hg export based...
2013 Aug 21
1
Bug in dovecot 2.2.5: segfault due to bad alignment
Take a look at the sources, hmac.h declares struct hmac_context:
struct hmac_context {
char ctx[HMAC_MAX_CONTEXT_SIZE];
char ctxo[HMAC_MAX_CONTEXT_SIZE];
const struct hash_method *hash;
};
If compiled for a 32 bit virtual address space, this has an alignment
requirement of 4 due to the hash pointer.
In line 171 of auth-token.c, we have following declaration of ctx
as a local variable in auth_token_get():
struct hmac_context ctx;
This is put on an address with an a...