diff options
author | 2020-06-02 03:23:07 +0200 | |
---|---|---|
committer | 2020-06-02 03:23:07 +0200 | |
commit | 571e9645410482e74714e5089048682e05b3d3f8 (patch) | |
tree | f2309cc8cabdb9e681623ae1c7df75f921daf0e8 /src/asr.c | |
parent | 8036f3f227211fdff18cbbf85ab84f45a44c5add (diff) | |
download | idevicerestore-571e9645410482e74714e5089048682e05b3d3f8.tar.gz idevicerestore-571e9645410482e74714e5089048682e05b3d3f8.tar.bz2 |
Make OpenSSL dependency optional (used for SHA1)
Can be disabled with --without-openssl, otherwise auto-detected.
Diffstat (limited to 'src/asr.c')
-rw-r--r-- | src/asr.c | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -21,13 +21,24 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif #include <stdio.h> #include <stdlib.h> #include <string.h> #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 "asr.h" #include "idevicerestore.h" @@ -399,7 +410,7 @@ int asr_send_payload(asr_client_t asr, const char* filesystem) } if (asr->checksum_chunks) { - SHA1_Update(&sha1, data, size); + SHA1_Update(&sha1, (unsigned char*)data, size); chunk += size; if (add_checksum) { |