projects
/
oweals
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix mapping "leak" in newly introduced win32_globallookup.
[oweals/openssl.git]
/
crypto
/
hmac
/
hmac.c
diff --git
a/crypto/hmac/hmac.c
b/crypto/hmac/hmac.c
index 4c91f919d56d9ac619c6dd2b7572bcb93bc63f65..c45e001492759d05c4a497206dd004ffeda76b3d 100644
(file)
--- a/
crypto/hmac/hmac.c
+++ b/
crypto/hmac/hmac.c
@@
-58,8
+58,8
@@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <openssl/hmac.h>
#include "cryptlib.h"
#include "cryptlib.h"
+#include <openssl/hmac.h>
void HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int len,
const EVP_MD *md, ENGINE *impl)
void HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int len,
const EVP_MD *md, ENGINE *impl)
@@
-79,7
+79,7
@@
void HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int len,
{
reset=1;
j=EVP_MD_block_size(md);
{
reset=1;
j=EVP_MD_block_size(md);
- OPENSSL_assert(j <=
sizeof ctx->key
);
+ OPENSSL_assert(j <=
(int)sizeof(ctx->key)
);
if (j < len)
{
EVP_DigestInit_ex(&ctx->md_ctx,md, impl);
if (j < len)
{
EVP_DigestInit_ex(&ctx->md_ctx,md, impl);
@@
-89,7
+89,7
@@
void HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int len,
}
else
{
}
else
{
- OPENSSL_assert(len
<= sizeof ctx->key
);
+ OPENSSL_assert(len
>=0 && len<=(int)sizeof(ctx->key)
);
memcpy(ctx->key,key,len);
ctx->key_length=len;
}
memcpy(ctx->key,key,len);
ctx->key_length=len;
}
@@
-121,7
+121,7
@@
void HMAC_Init(HMAC_CTX *ctx, const void *key, int len,
HMAC_Init_ex(ctx,key,len,md, NULL);
}
HMAC_Init_ex(ctx,key,len,md, NULL);
}
-void HMAC_Update(HMAC_CTX *ctx, const unsigned char *data,
in
t len)
+void HMAC_Update(HMAC_CTX *ctx, const unsigned char *data,
size_
t len)
{
EVP_DigestUpdate(&ctx->md_ctx,data,len);
}
{
EVP_DigestUpdate(&ctx->md_ctx,data,len);
}
@@
-156,7
+156,7
@@
void HMAC_CTX_cleanup(HMAC_CTX *ctx)
}
unsigned char *HMAC(const EVP_MD *evp_md, const void *key, int key_len,
}
unsigned char *HMAC(const EVP_MD *evp_md, const void *key, int key_len,
- const unsigned char *d,
in
t n, unsigned char *md,
+ const unsigned char *d,
size_
t n, unsigned char *md,
unsigned int *md_len)
{
HMAC_CTX c;
unsigned int *md_len)
{
HMAC_CTX c;