mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2026-09-14 00:45:08 +00:00
compare the ecies mac in constant time and test the invalid password cause
This commit is contained in:
+1
-1
Submodule drongo updated: cee00202dc...31130261ea
@@ -3,6 +3,7 @@ package com.sparrowwallet.sparrow.io;
|
||||
import com.google.common.io.ByteStreams;
|
||||
import com.sparrowwallet.drongo.Network;
|
||||
import com.sparrowwallet.drongo.Utils;
|
||||
import com.sparrowwallet.drongo.crypto.InvalidPasswordException;
|
||||
import com.sparrowwallet.drongo.policy.PolicyType;
|
||||
import com.sparrowwallet.drongo.protocol.ScriptType;
|
||||
import com.sparrowwallet.drongo.wallet.MnemonicException;
|
||||
@@ -107,6 +108,16 @@ public class ElectrumTest extends IoTest {
|
||||
Assertions.assertEquals("xpub69iSRreMB6fu24sU8Tdxv7yYGqzPkDwPkwqUfKJTxW3p8afW7XvTewVCapuX3dQjdD197iF65WcjYaNpFbwWT3RyuZ1KJ3ToJNVWKWyAJ6f", wallet.getKeystores().get(0).getExtendedPublicKey().toString());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testEncryptedImportInvalidPassword() throws IOException {
|
||||
Electrum electrum = new Electrum();
|
||||
byte[] walletBytes = ByteStreams.toByteArray(getInputStream("electrum-encrypted"));
|
||||
|
||||
ImportException importException = Assertions.assertThrows(ImportException.class, () -> electrum.importWallet(new ByteArrayInputStream(walletBytes), "wrong"));
|
||||
//FileImportPane reports "Invalid wallet password" by unwrapping this cause - dropping it degrades the message to a generic import error
|
||||
Assertions.assertInstanceOf(InvalidPasswordException.class, importException.getCause());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSinglesigSeedExport() throws ImportException, ExportException, IOException, MnemonicException {
|
||||
Electrum electrum = new Electrum();
|
||||
|
||||
Reference in New Issue
Block a user