Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Redth committed Apr 13, 2020
1 parent 92783a3 commit 0c7729c
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions DeviceTests/DeviceTests.Shared/SecureStorage_Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -167,14 +167,11 @@ public async Task Asymmetric_to_Symmetric_API_Upgrade()
public async Task Legacy_Key(string key, string data)
{
byte[] encryptedData = null;
lock (locker)
{
var ks = new AndroidKeyStore(Platform.AppContext, SecureStorage.Alias, SecureStorage.AlwaysUseAsymmetricKeyStorage);
encryptedData = ks.Encrypt(data);
}
var ks = new AndroidKeyStore(Platform.AppContext, SecureStorage.Alias, SecureStorage.AlwaysUseAsymmetricKeyStorage);
encryptedData = ks.Encrypt(data);

var encStr = Convert.ToBase64String(encryptedData);
Preferences.Set(Utils.Md5Hash(key), encStr, Alias);
var encStr = System.Convert.ToBase64String(encryptedData);
Preferences.Set(Xamarin.Essentials.Utils.Md5Hash(key), encStr, SecureStorage.Alias);

// Ensure we read back out the right key
var c = await SecureStorage.GetAsync(key);
Expand Down

0 comments on commit 0c7729c

Please sign in to comment.