projects
/
gnulib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Make it possible to use the list in signal-handlers.
[gnulib.git]
/
lib
/
hmac-md5.c
diff --git
a/lib/hmac-md5.c
b/lib/hmac-md5.c
index
6df653d
..
816762b
100644
(file)
--- a/
lib/hmac-md5.c
+++ b/
lib/hmac-md5.c
@@
-23,6
+23,7
@@
#include "hmac.h"
#include "hmac.h"
+#include "memxor.h"
#include "md5.h"
#include <string.h>
#include "md5.h"
#include <string.h>
@@
-40,6
+41,8
@@
hmac_md5 (const void *key, size_t keylen,
char block[64];
char innerhash[16];
char block[64];
char innerhash[16];
+ /* Reduce the key's size, so that it becomes <= 64 bytes large. */
+
if (keylen > 64)
{
struct md5_ctx keyhash;
if (keylen > 64)
{
struct md5_ctx keyhash;
@@
-52,6
+55,8
@@
hmac_md5 (const void *key, size_t keylen,
keylen = 16;
}
keylen = 16;
}
+ /* Compute INNERHASH from KEY and IN. */
+
md5_init_ctx (&inner);
memset (block, IPAD, sizeof (block));
md5_init_ctx (&inner);
memset (block, IPAD, sizeof (block));
@@
-62,6
+67,8
@@
hmac_md5 (const void *key, size_t keylen,
md5_finish_ctx (&inner, innerhash);
md5_finish_ctx (&inner, innerhash);
+ /* Compute result from KEY and INNERHASH. */
+
md5_init_ctx (&outer);
memset (block, OPAD, sizeof (block));
md5_init_ctx (&outer);
memset (block, OPAD, sizeof (block));