mirror of
https://github.com/moparisthebest/open-keychain
synced 2024-12-25 00:18:51 -05:00
Fix tests
This commit is contained in:
parent
7475aae5e1
commit
0f88d5b024
@ -44,6 +44,7 @@ import org.spongycastle.openpgp.operator.PGPContentSignerBuilder;
|
|||||||
import org.spongycastle.openpgp.operator.jcajce.JcaKeyFingerprintCalculator;
|
import org.spongycastle.openpgp.operator.jcajce.JcaKeyFingerprintCalculator;
|
||||||
import org.spongycastle.openpgp.operator.jcajce.JcaPGPContentSignerBuilder;
|
import org.spongycastle.openpgp.operator.jcajce.JcaPGPContentSignerBuilder;
|
||||||
import org.spongycastle.openpgp.operator.jcajce.JcePBESecretKeyDecryptorBuilder;
|
import org.spongycastle.openpgp.operator.jcajce.JcePBESecretKeyDecryptorBuilder;
|
||||||
|
import org.spongycastle.util.Strings;
|
||||||
import org.sufficientlysecure.keychain.Constants;
|
import org.sufficientlysecure.keychain.Constants;
|
||||||
import org.sufficientlysecure.keychain.service.results.OperationResultParcel;
|
import org.sufficientlysecure.keychain.service.results.OperationResultParcel;
|
||||||
import org.sufficientlysecure.keychain.service.results.EditKeyResult;
|
import org.sufficientlysecure.keychain.service.results.EditKeyResult;
|
||||||
@ -157,7 +158,7 @@ public class UncachedKeyringCanonicalizeTest {
|
|||||||
@Test public void testUidSignature() throws Exception {
|
@Test public void testUidSignature() throws Exception {
|
||||||
|
|
||||||
UncachedPublicKey masterKey = ring.getPublicKey();
|
UncachedPublicKey masterKey = ring.getPublicKey();
|
||||||
final WrappedSignature sig = masterKey.getSignaturesForId("twi").next();
|
final WrappedSignature sig = masterKey.getSignaturesForRawId(Strings.toUTF8ByteArray("twi")).next();
|
||||||
|
|
||||||
byte[] raw = sig.getEncoded();
|
byte[] raw = sig.getEncoded();
|
||||||
// destroy the signature
|
// destroy the signature
|
||||||
|
@ -31,6 +31,7 @@ import org.spongycastle.bcpg.S2K;
|
|||||||
import org.spongycastle.bcpg.SecretKeyPacket;
|
import org.spongycastle.bcpg.SecretKeyPacket;
|
||||||
import org.spongycastle.bcpg.sig.KeyFlags;
|
import org.spongycastle.bcpg.sig.KeyFlags;
|
||||||
import org.spongycastle.jce.provider.BouncyCastleProvider;
|
import org.spongycastle.jce.provider.BouncyCastleProvider;
|
||||||
|
import org.spongycastle.util.Strings;
|
||||||
import org.sufficientlysecure.keychain.service.results.OperationResultParcel;
|
import org.sufficientlysecure.keychain.service.results.OperationResultParcel;
|
||||||
import org.sufficientlysecure.keychain.service.results.EditKeyResult;
|
import org.sufficientlysecure.keychain.service.results.EditKeyResult;
|
||||||
import org.sufficientlysecure.keychain.service.SaveKeyringParcel;
|
import org.sufficientlysecure.keychain.service.SaveKeyringParcel;
|
||||||
@ -296,7 +297,7 @@ public class UncachedKeyringMergeTest {
|
|||||||
|
|
||||||
{
|
{
|
||||||
byte[] sig = KeyringTestingHelper.getNth(
|
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
|
// inject the (foreign!) signature into subkey signature position
|
||||||
UncachedKeyRing moreModified = KeyringTestingHelper.injectPacket(modified, sig, 1);
|
UncachedKeyRing moreModified = KeyringTestingHelper.injectPacket(modified, sig, 1);
|
||||||
|
Loading…
Reference in New Issue
Block a user