From 10cd5f7f0fe14fbf51f2142ea2df153da33d1a21 Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Sun, 16 Jun 2024 15:53:29 +0200 Subject: Remove OpenSSL dependency in favor of libimobiledevice-glue's hash functions This also removes the sha1/sha384 code from this repository since we are using the ones from libimobiledevice-glue now. --- src/ipsw.c | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) (limited to 'src/ipsw.c') diff --git a/src/ipsw.c b/src/ipsw.c index c25f61d..6a747f4 100644 --- a/src/ipsw.c +++ b/src/ipsw.c @@ -34,16 +34,8 @@ #include #include #include -#ifdef HAVE_OPENSSL -#include -#else -#include "sha1.h" -#define SHA_CTX SHA1_CTX -#define SHA1_Init SHA1Init -#define SHA1_Update SHA1Update -#define SHA1_Final SHA1Final -#endif +#include #include #include @@ -1176,14 +1168,14 @@ static int sha1_verify_fp(FILE* f, unsigned char* expected_sha1) unsigned char tsha1[20]; char buf[8192]; if (!f) return 0; - SHA_CTX sha1ctx; - SHA1_Init(&sha1ctx); + sha1_context sha1ctx; + sha1_init(&sha1ctx); rewind(f); while (!feof(f)) { size_t sz = fread(buf, 1, 8192, f); - SHA1_Update(&sha1ctx, (const void*)buf, sz); + sha1_update(&sha1ctx, buf, sz); } - SHA1_Final(tsha1, &sha1ctx); + sha1_final(&sha1ctx, tsha1); return (memcmp(expected_sha1, tsha1, 20) == 0) ? 1 : 0; } -- cgit v1.1-32-gdbae