From 920941159a59c60a3673ac4995dbdc2e897e3b15 Mon Sep 17 00:00:00 2001 From: tihmstar Date: Thu, 27 Apr 2017 15:37:12 +0200 Subject: [PATCH] fixed type error when compiling with openssl (hopefully) --- futurerestore/futurerestore.cpp | 6 +++--- futurerestore/futurerestore.hpp | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/futurerestore/futurerestore.cpp b/futurerestore/futurerestore.cpp index 6725f237..b9f600eb 100644 --- a/futurerestore/futurerestore.cpp +++ b/futurerestore/futurerestore.cpp @@ -534,19 +534,19 @@ int futurerestore::doRestore(const char *ipsw){ plist_dict_set_item(manifest, "SEP", sep_sep); //check SEP unsigned char genHash[48]; //SHA384 digest length - ptr_smartsephash = NULL; + ptr_smartsephash = NULL; uint64_t sephashlen = 0; plist_t digest = plist_dict_get_item(sep_sep, "Digest"); if (!digest || plist_get_node_type(digest) != PLIST_DATA) reterror(-66, "ERROR: can't find sep digest\n"); - plist_get_data_val(digest, &sephash, &sephashlen); + plist_get_data_val(digest, reinterpret_cast(&sephash), &sephashlen); if (sephashlen == 20) SHA1(_client->sepfwdata, (unsigned int)_client->sepfwdatasize, genHash); else SHA384(_client->sepfwdata, (unsigned int)_client->sepfwdatasize, genHash); - if (memcmp(genHash, static_cast(sephash), sephashlen)) + if (memcmp(genHash, sephash, sephashlen)) reterror(-67, "ERROR: SEP does not match sepmanifest\n"); } diff --git a/futurerestore/futurerestore.hpp b/futurerestore/futurerestore.hpp index c70676dd..7348c7c0 100644 --- a/futurerestore/futurerestore.hpp +++ b/futurerestore/futurerestore.hpp @@ -29,7 +29,8 @@ public: ptr_smart(){_p = NULL;} T operator=(T p){return _p = p;} T *operator&(){return &_p;} - explicit operator const char*() const {return _p;} + operator const T() const {return _p;} + operator const void*() const {return _p;} ~ptr_smart(){if (_p) (_ptr_free) ? _ptr_free(_p) : free((void*)_p);} };