mirror of
https://github.com/bitwarden/android.git
synced 2024-12-20 08:12:26 +03:00
Fix android test for bouncy castle key der service
This commit is contained in:
parent
c42a1504a7
commit
aea96ae334
1 changed files with 3 additions and 2 deletions
|
@ -2,6 +2,7 @@ using System;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
|
using Bit.Android.Services;
|
||||||
|
|
||||||
namespace Bit.Android.Test
|
namespace Bit.Android.Test
|
||||||
{
|
{
|
||||||
|
@ -18,7 +19,7 @@ namespace Bit.Android.Test
|
||||||
[Test]
|
[Test]
|
||||||
public void MakeKeyFromPasswordBase64()
|
public void MakeKeyFromPasswordBase64()
|
||||||
{
|
{
|
||||||
var service = new CommonCryptoKeyDerivationService();
|
var service = new BouncyCastleKeyDerivationService();
|
||||||
var key = service.DeriveKey(Encoding.UTF8.GetBytes("123456"), Encoding.UTF8.GetBytes("salt"), 5000);
|
var key = service.DeriveKey(Encoding.UTF8.GetBytes("123456"), Encoding.UTF8.GetBytes("salt"), 5000);
|
||||||
Assert.True(key.SequenceEqual(GetKey()));
|
Assert.True(key.SequenceEqual(GetKey()));
|
||||||
}
|
}
|
||||||
|
@ -26,7 +27,7 @@ namespace Bit.Android.Test
|
||||||
[Test]
|
[Test]
|
||||||
public void HashPasswordBase64()
|
public void HashPasswordBase64()
|
||||||
{
|
{
|
||||||
var service = new CommonCryptoKeyDerivationService();
|
var service = new BouncyCastleKeyDerivationService();
|
||||||
var hash = service.DeriveKey(GetKey(), Encoding.UTF8.GetBytes("123456"), 1);
|
var hash = service.DeriveKey(GetKey(), Encoding.UTF8.GetBytes("123456"), 1);
|
||||||
var hashBytes = Convert.FromBase64String("7Bsl4ponrsFu0jGl4yMeLZp5tKqx6g4tLrXhMszIsjQ=");
|
var hashBytes = Convert.FromBase64String("7Bsl4ponrsFu0jGl4yMeLZp5tKqx6g4tLrXhMszIsjQ=");
|
||||||
Assert.True(hash.SequenceEqual(hashBytes));
|
Assert.True(hash.SequenceEqual(hashBytes));
|
||||||
|
|
Loading…
Reference in a new issue