diff --git a/external/img4tool b/external/img4tool index 17060e50..8b32c5ce 160000 --- a/external/img4tool +++ b/external/img4tool @@ -1 +1 @@ -Subproject commit 17060e500a853a9b4ed860f246d3aa0a90258e31 +Subproject commit 8b32c5ce738564bae01f08ff9285e5b3ed8a51f1 diff --git a/futurerestore.xcodeproj/project.pbxproj b/futurerestore.xcodeproj/project.pbxproj index 8cfc92f1..9225c813 100644 --- a/futurerestore.xcodeproj/project.pbxproj +++ b/futurerestore.xcodeproj/project.pbxproj @@ -459,12 +459,12 @@ LIBRARY_SEARCH_PATHS = ( /usr/local/lib, /usr/lib, + /usr/local/opt/openssl/lib, "$(SDKROOT)/usr/lib/system", - /opt/local/lib, ); OTHER_CFLAGS = ""; PRODUCT_NAME = "$(TARGET_NAME)"; - USER_HEADER_SEARCH_PATHS = "/usr/local/include /opt/local/include"; + USER_HEADER_SEARCH_PATHS = "/usr/local/opt/openssl/include /usr/local/include"; }; name = Debug; }; @@ -476,12 +476,12 @@ LIBRARY_SEARCH_PATHS = ( /usr/local/lib, /usr/lib, + /usr/local/opt/openssl/lib, "$(SDKROOT)/usr/lib/system", - /opt/local/lib, ); OTHER_CFLAGS = ""; PRODUCT_NAME = "$(TARGET_NAME)"; - USER_HEADER_SEARCH_PATHS = "/usr/local/include /opt/local/include"; + USER_HEADER_SEARCH_PATHS = "/usr/local/opt/openssl/include /usr/local/include"; }; name = Release; }; diff --git a/futurerestore/futurerestore.cpp b/futurerestore/futurerestore.cpp index e60aaed1..46e83ba1 100644 --- a/futurerestore/futurerestore.cpp +++ b/futurerestore/futurerestore.cpp @@ -347,7 +347,7 @@ int futurerestore::doRestore(const char *ipsw, bool noerase){ //TODO: make this nicer! //for now a simple pointercompare should be fine, because both plist_t should point into the same buildidentity inside the buildmanifest - if (ticketIdentity != build_identity){ + if (ticketIdentity != build_identity ){ error("BuildIdentity selected for restore does not match APTicket\n\n"); printf("BuildIdentity selected for restore:\n"); printGeneralBuildIdentityInformation(build_identity); @@ -360,6 +360,10 @@ int futurerestore::doRestore(const char *ipsw, bool noerase){ } reterror(-44, "APTicket can't be used for this restore\n"); }else{ + if (verifyIM4MSignature(nonceMatchesIM4Ms())){ + printf("IM4M signature is not valid!\n"); + reterror(-44, "APTicket can't be used for this restore\n"); + } printf("Verified APTicket to be valid for this restore\n"); } @@ -727,9 +731,9 @@ inline void futurerestore::saveStringToFile(const char *str, const char *path){ char *futurerestore::getNonceFromIM4M(const char* im4m, size_t *nonceSize){ char *ret = NULL; - t_asn1Tag *mainSet = NULL; - t_asn1Tag *manbSet = NULL; - t_asn1Tag *manpSet = NULL; + char *mainSet = NULL; + char *manbSet = NULL; + char *manpSet = NULL; char *nonceOctet = NULL; char *bnch = NULL; char *manb = NULL;