Bläddra i källkod

bugfix autoinsert passcode crypto cloud system

Marino Faggiana 8 år sedan
förälder
incheckning
2801bacca8
1 ändrade filer med 4 tillägg och 2 borttagningar
  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