diff options
author | Nikias Bassen | 2021-05-28 02:59:18 +0200 |
---|---|---|
committer | Nikias Bassen | 2021-05-28 02:59:18 +0200 |
commit | ab6592861713fcae4d3c3d831ae75394e6262582 (patch) | |
tree | 8210eadca38239ada8feccaf21868cb80f9d23ba | |
parent | 0a76f61a4ca56a67548ee296695fe39af15862eb (diff) | |
download | idevicerestore-ab6592861713fcae4d3c3d831ae75394e6262582.tar.gz idevicerestore-ab6592861713fcae4d3c3d831ae75394e6262582.tar.bz2 |
Update internal SHA1 and SHA1Update function prototypes to match OpenSSL's SHA1/SHA1_Update
-rw-r--r-- | src/sha1.c | 20 | ||||
-rw-r--r-- | src/sha1.h | 8 |
2 files changed, 14 insertions, 14 deletions
@@ -197,12 +197,12 @@ void SHA1Init( void SHA1Update( SHA1_CTX * context, const unsigned char *data, - uint32_t len + size_t len ) { - uint32_t i; + size_t i; - uint32_t j; + size_t j; j = context->count[0]; if ((context->count[0] += len << 3) < j) @@ -279,16 +279,16 @@ void SHA1Final( } void SHA1( - char *hash_out, - const char *str, - int len) + const unsigned char *str, + size_t len, + unsigned char *hash_out +) { SHA1_CTX ctx; - unsigned int ii; + size_t ii; SHA1Init(&ctx); for (ii=0; ii<len; ii+=1) - SHA1Update(&ctx, (const unsigned char*)str + ii, 1); - SHA1Final((unsigned char *)hash_out, &ctx); - hash_out[20] = '\0'; + SHA1Update(&ctx, str + ii, 1); + SHA1Final(hash_out, &ctx); } @@ -28,7 +28,7 @@ void SHA1Init( void SHA1Update( SHA1_CTX * context, const unsigned char *data, - uint32_t len + size_t len ); void SHA1Final( @@ -37,8 +37,8 @@ void SHA1Final( ); void SHA1( - char *hash_out, - const char *str, - int len); + const unsigned char *str, + size_t len, + unsigned char *hash_out); #endif /* SHA1_H */ |