make some internal functions static; patch supplied by Kurt Roeckx
[oweals/openssl.git] / crypto / hmac / hmac.c
index 50765e227bf2ef0a3a0c134537dc390c7bff4d23..c45e001492759d05c4a497206dd004ffeda76b3d 100644 (file)
@@ -58,8 +58,8 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <openssl/hmac.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)
@@ -89,7 +89,7 @@ void HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int len,
                        }
                else
                        {
-                       OPENSSL_assert(len <= (int)sizeof(ctx->key));
+                       OPENSSL_assert(len>=0 && len<=(int)sizeof(ctx->key));
                        memcpy(ctx->key,key,len);
                        ctx->key_length=len;
                        }