Displaying 2 results from an estimated 2 matches for "k_ipad".
Did you mean:
ipad
2012 Sep 04
2
[PATCH] Generalize HMAC implementation
...ware is released under the MIT license.
- */
-
-#include "lib.h"
-#include "hmac-md5.h"
-#include "safe-memset.h"
-
-void hmac_md5_init(struct hmac_md5_context *ctx,
- const unsigned char *key, size_t key_len)
-{
- int i;
- unsigned char md5key[16];
- unsigned char k_ipad[64];
- unsigned char k_opad[64];
-
- if (key_len > 64) {
- md5_get_digest(key, key_len, md5key);
- key = md5key;
- key_len = 16;
- }
-
- memcpy(k_ipad, key, key_len);
- memset(k_ipad + key_len, 0, 64 - key_len);
- memcpy(k_opad, k_ipad, 64);
-
- for (i = 0; i < 64; i++) {
- k_ipad[i] ^= 0...
2013 Aug 21
1
Bug in dovecot 2.2.5: segfault due to bad alignment
...st unsigned char*)username, strlen(username),
&hash_method_sha1);
In hmac.c, lines 43 and following, ctx->ctx with an alignment of
4 is passed to meth->init and meth->loop where meth refers to
hash_method_sha1:
meth->init(ctx->ctx);
meth->loop(ctx->ctx, k_ipad, 64);
These functions refer now to sha1_init and sha1_loop where the
first parameter is expected to be a pointer to struct sha1_ctxt,
a data structure which is declared in sha1.h:
struct sha1_ctxt {
union {
uint8_t b8[20];
uint32_t b32[5];...