fix code mix up.
This commit is contained in:
		
							
								
								
									
										44
									
								
								c_micasad/cache/SecretStore.cs
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										44
									
								
								c_micasad/cache/SecretStore.cs
									
									
									
									
										vendored
									
									
								
							| @@ -210,41 +210,29 @@ namespace sscs.cache | |||||||
|  |  | ||||||
|                 } |                 } | ||||||
|                 baPasscode = CASACrypto.GetMasterPasscodeUsingDesktopPasswd(desktopPasswd, GetPasscodeByDesktopFilePath(), false); |                 baPasscode = CASACrypto.GetMasterPasscodeUsingDesktopPasswd(desktopPasswd, GetPasscodeByDesktopFilePath(), false); | ||||||
|                 //if(baPasscode != null) |                 if(CASACrypto.ValidatePasscode(baPasscode,GetValidationFilePath())) | ||||||
|                 if (true) |  | ||||||
|                 { |                 { | ||||||
|                     if(CASACrypto.ValidatePasscode(baPasscode,GetValidationFilePath())) |                     lss = new LocalStorage(this,baPasscode); | ||||||
|  |                     bIsStorePersistent = true; | ||||||
|  |                     return true; | ||||||
|  |                 } | ||||||
|  |                 else | ||||||
|  |                 { | ||||||
|  |                     // try old encryption method | ||||||
|  |                     baPasscode = CASACrypto.GetMasterPasscodeUsingDesktopPasswd(desktopPasswd, GetPasscodeByDesktopFilePath(), true); | ||||||
|  |                     if (CASACrypto.ValidatePasscode(baPasscode, GetValidationFilePath())) | ||||||
|                     { |                     { | ||||||
|                         lss = new LocalStorage(this,baPasscode); |             	        // rewrite file using new encryption | ||||||
|  |                         CASACrypto.EncryptAndStoreMasterPasscodeUsingString(baPasscode, desktopPasswd, GetPasscodeByDesktopFilePath()); | ||||||
|  |                         lss = new LocalStorage(this, baPasscode); | ||||||
|                         bIsStorePersistent = true; |                         bIsStorePersistent = true; | ||||||
|                         return true; |                         return true; | ||||||
|                     } |                     } | ||||||
|                     else |                     else | ||||||
|                     { |                     { | ||||||
|                         // try old encryption method |                         lss = null; | ||||||
|                         baPasscode = CASACrypto.GetMasterPasscodeUsingDesktopPasswd(desktopPasswd, GetPasscodeByDesktopFilePath(), true); |                         bIsStorePersistent = false; //till masterPasswd is verified | ||||||
|                         if (CASACrypto.ValidatePasscode(baPasscode, GetValidationFilePath())) |                      } | ||||||
|                         { |  | ||||||
|                             // rewrite file using new encryption |  | ||||||
|                             CASACrypto.EncryptAndStoreMasterPasscodeUsingString(baPasscode, desktopPasswd, GetPasscodeByDesktopFilePath()); |  | ||||||
|                             lss = new LocalStorage(this, baPasscode); |  | ||||||
|                             bIsStorePersistent = true; |  | ||||||
|                             return true; |  | ||||||
|                         } |  | ||||||
|                         else |  | ||||||
|                         { |  | ||||||
|                             lss = null; |  | ||||||
|                             bIsStorePersistent = false; //till masterPasswd is verified |  | ||||||
|                         } |  | ||||||
|                     } |  | ||||||
|                     return true; |  | ||||||
|                 } |  | ||||||
|                 else |  | ||||||
|                 { |  | ||||||
|                     CSSSLogger.DbgLog(CSSSLogger.GetExecutionPath(this) + " May be desktop passwd has changed"); |  | ||||||
|                     lss = null; |  | ||||||
|                     bIsStorePersistent = false; |  | ||||||
|                     return false; |  | ||||||
|                 } |                 } | ||||||
|             } |             } | ||||||
|             catch(Exception e) |             catch(Exception e) | ||||||
|   | |||||||
| @@ -20,7 +20,6 @@ | |||||||
|  *  |  *  | ||||||
|  ***********************************************************************/ |  ***********************************************************************/ | ||||||
| using System; | using System; | ||||||
| using System.Collections.Generic; |  | ||||||
| using System.Text; | using System.Text; | ||||||
|  |  | ||||||
| namespace sscs.lss | namespace sscs.lss | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user