diff options
author | 2024-06-16 15:53:29 +0200 | |
---|---|---|
committer | 2024-06-16 18:49:32 +0200 | |
commit | 10cd5f7f0fe14fbf51f2142ea2df153da33d1a21 (patch) | |
tree | 2b445205092457cfecddd3e3a3396009d0f6c29a /src/asr.c | |
parent | 4e95bd957981ba6bb1fc56d5f0f9781ed9fa8123 (diff) | |
download | idevicerestore-10cd5f7f0fe14fbf51f2142ea2df153da33d1a21.tar.gz idevicerestore-10cd5f7f0fe14fbf51f2142ea2df153da33d1a21.tar.bz2 |
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.
Diffstat (limited to 'src/asr.c')
-rw-r--r-- | src/asr.c | 19 |
1 files changed, 3 insertions, 16 deletions
@@ -30,15 +30,8 @@ #include <unistd.h> #include <errno.h> #include <libimobiledevice/libimobiledevice.h> -#ifdef HAVE_OPENSSL -#include <openssl/sha.h> -#else -#include "sha1.h" -#define SHA_CTX SHA1_CTX -#define SHA1_Init SHA1Init -#define SHA1_Update SHA1Update -#define SHA1_Final SHA1Final -#endif + +#include <libimobiledevice-glue/sha.h> #include "asr.h" #include "idevicerestore.h" @@ -343,12 +336,6 @@ int asr_send_payload(asr_client_t asr, ipsw_file_handle_t file) data = (char*)malloc(ASR_PAYLOAD_CHUNK_SIZE + 20); - SHA_CTX sha1; - - if (asr->checksum_chunks) { - SHA1_Init(&sha1); - } - i = length; int retry = 3; while(i > 0 && retry >= 0) { @@ -367,7 +354,7 @@ int asr_send_payload(asr_client_t asr, ipsw_file_handle_t file) sendsize = size; if (asr->checksum_chunks) { - SHA1((unsigned char*)data, size, (unsigned char*)(data+size)); + sha1((unsigned char*)data, size, (unsigned char*)(data+size)); sendsize += 20; } if (asr_send_buffer(asr, data, sendsize) < 0) { |