Ver Fonte

bugfix autoinsert passcode crypto cloud system

Marino Faggiana há 8 anos atrás
pai
commit
2801bacca8
1 ficheiros alterados com 4 adições e 2 exclusões
  1. 4 2
      iOSClient/Security/CCCrypto.m

+ 4 - 2
iOSClient/Security/CCCrypto.m

@@ -56,14 +56,16 @@
     NSString *passcode;
     
     // if return the passcode the UUID it has already entered
-    if ([CCUtility getKeyChainPasscodeForUUID:uuid]) return;
+    if ([[CCUtility getKeyChainPasscodeForUUID:uuid] length] > 0)
+        return;
     
     // verify if the password of the UUID insert is good (OPTIMIZATION)
     passcode = [CCUtility getKeyChainPasscodeForUUID:[CCUtility getUUID]];
     key = [AESCrypt encrypt:uuid password:passcode];
         
     // if the decryption it's ok insert UUID with Passcode in KeyChain
-    if([AESCrypt decrypt:text password:key]) [CCUtility setKeyChainPasscodeForUUID:uuid conPasscode:passcode];
+    if([AESCrypt decrypt:text password:key])
+        [CCUtility setKeyChainPasscodeForUUID:uuid conPasscode:passcode];
 }
 
 - (BOOL)verifyPasscode:(NSString *)passcode uuid:(NSString*)uuid text:(NSString *)text