Fix tests

This commit is contained in:
Dominik Schürmann 2014-09-13 19:41:38 +02:00
parent 7475aae5e1
commit 0f88d5b024
2 changed files with 4 additions and 2 deletions

View File

@ -44,6 +44,7 @@ import org.spongycastle.openpgp.operator.PGPContentSignerBuilder;
import org.spongycastle.openpgp.operator.jcajce.JcaKeyFingerprintCalculator;
import org.spongycastle.openpgp.operator.jcajce.JcaPGPContentSignerBuilder;
import org.spongycastle.openpgp.operator.jcajce.JcePBESecretKeyDecryptorBuilder;
import org.spongycastle.util.Strings;
import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.service.results.OperationResultParcel;
import org.sufficientlysecure.keychain.service.results.EditKeyResult;
@ -157,7 +158,7 @@ public class UncachedKeyringCanonicalizeTest {
@Test public void testUidSignature() throws Exception {
UncachedPublicKey masterKey = ring.getPublicKey();
final WrappedSignature sig = masterKey.getSignaturesForId("twi").next();
final WrappedSignature sig = masterKey.getSignaturesForRawId(Strings.toUTF8ByteArray("twi")).next();
byte[] raw = sig.getEncoded();
// destroy the signature

View File

@ -31,6 +31,7 @@ import org.spongycastle.bcpg.S2K;
import org.spongycastle.bcpg.SecretKeyPacket;
import org.spongycastle.bcpg.sig.KeyFlags;
import org.spongycastle.jce.provider.BouncyCastleProvider;
import org.spongycastle.util.Strings;
import org.sufficientlysecure.keychain.service.results.OperationResultParcel;
import org.sufficientlysecure.keychain.service.results.EditKeyResult;
import org.sufficientlysecure.keychain.service.SaveKeyringParcel;
@ -296,7 +297,7 @@ public class UncachedKeyringMergeTest {
{
byte[] sig = KeyringTestingHelper.getNth(
modified.getPublicKey().getSignaturesForId("twi"), 1).getEncoded();
modified.getPublicKey().getSignaturesForRawId(Strings.toUTF8ByteArray("twi")), 1).getEncoded();
// inject the (foreign!) signature into subkey signature position
UncachedKeyRing moreModified = KeyringTestingHelper.injectPacket(modified, sig, 1);