From 408a1f2f50676618209a855cd3fbb213580b1a51 Mon Sep 17 00:00:00 2001 From: Jim Norman Date: Tue, 1 Nov 2005 17:02:52 +0000 Subject: [PATCH] Fix caching of secrets that contain extended ascii or double byte keys and values. --- c_micasad/lss/LocalStorage.cs | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/c_micasad/lss/LocalStorage.cs b/c_micasad/lss/LocalStorage.cs index 7a4920e0..5999139f 100644 --- a/c_micasad/lss/LocalStorage.cs +++ b/c_micasad/lss/LocalStorage.cs @@ -132,15 +132,11 @@ namespace sscs.lss byte[] decryptedBuffer = CASACrypto.ReadFileAndDecryptData(key,fileName); if( null == decryptedBuffer ) - return null; - - char[] chArr = new char[decryptedBuffer.Length]; - for(int z = 0; z < decryptedBuffer.Length; z++ ) - { - chArr[z] = (char)decryptedBuffer[z]; - } - string toReturn = new string(chArr); - return toReturn; + return null; + + string temp = Encoding.UTF8.GetString(decryptedBuffer, 0, decryptedBuffer.Length); + + return temp; } catch(Exception e) {