diff --git a/src/algo_sha1.c b/src/algo_sha1.c index 42ca94cf..dbf646b8 100644 --- a/src/algo_sha1.c +++ b/src/algo_sha1.c @@ -69,7 +69,7 @@ typedef union _BYTE64QUAD16 { } BYTE64QUAD16; /* Hash a single 512-bit block. This is the core of the algorithm. */ -void SHA1_Transform(sha1_quadbyte state[5], sha1_byte buffer[64]) { +void SHA1_Transform(sha1_quadbyte state[5], const sha1_byte buffer[64]) { sha1_quadbyte a, b, c, d, e; BYTE64QUAD16 src; BYTE64QUAD16 *block; @@ -127,7 +127,7 @@ void SHA1_Init(SHA_CTX* context) { } /* Run your data through this. */ -void SHA1_Update(SHA_CTX *context, sha1_byte *data, unsigned int len) { +void SHA1_Update(SHA_CTX *context, const sha1_byte *data, unsigned int len) { unsigned int i, j; j = (context->count[0] >> 3) & 63; diff --git a/src/algo_sha1.h b/src/algo_sha1.h index 8c3ec35c..d8b44379 100644 --- a/src/algo_sha1.h +++ b/src/algo_sha1.h @@ -44,6 +44,7 @@ extern "C" { #ifdef HAVE_INTTYPES_H # include #endif +#include /* Make sure you define these types for your architecture: */ typedef uint32_t sha1_quadbyte; /* 4 byte type */ @@ -63,7 +64,7 @@ typedef struct _SHA_CTX { #ifndef NOPROTO void SHA1_Init(SHA_CTX *context); -void SHA1_Update(SHA_CTX *context, sha1_byte *data, unsigned int len); +void SHA1_Update(SHA_CTX *context, const sha1_byte *data, unsigned int len); void SHA1_Final(sha1_byte digest[SHA1_DIGEST_LENGTH], SHA_CTX *context); /*(added for lighttpd)*/ unsigned char *SHA1(const unsigned char *d, size_t n, unsigned char *md);