aboutsummaryrefslogtreecommitdiffstats
path: root/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/UncachedPublicKey.java
diff options
context:
space:
mode:
authorVincent Breitmoser <valodim@mugenguild.com>2014-09-28 14:25:54 +0200
committerVincent Breitmoser <valodim@mugenguild.com>2014-09-28 14:25:54 +0200
commit706e60474d15f833ad5ead519518775812978bac (patch)
tree33c37457905843a95cba6b91b578017e082e0412 /OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/UncachedPublicKey.java
parentc0abae5cc366eb4fc0ed89cbf44e4d2ab8aa7893 (diff)
downloadopen-keychain-706e60474d15f833ad5ead519518775812978bac.tar.gz
open-keychain-706e60474d15f833ad5ead519518775812978bac.tar.bz2
open-keychain-706e60474d15f833ad5ead519518775812978bac.zip
be more mindful of algorithm and usage flag interaction
Fixes #895
Diffstat (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/UncachedPublicKey.java')
-rw-r--r--OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/UncachedPublicKey.java16
1 files changed, 2 insertions, 14 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/UncachedPublicKey.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/UncachedPublicKey.java
index 7f08d121e..74af9fc97 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/UncachedPublicKey.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/UncachedPublicKey.java
@@ -18,9 +18,6 @@
package org.sufficientlysecure.keychain.pgp;
-import org.spongycastle.asn1.ASN1ObjectIdentifier;
-import org.spongycastle.asn1.nist.NISTNamedCurves;
-import org.spongycastle.asn1.teletrust.TeleTrusTNamedCurves;
import org.spongycastle.bcpg.ECPublicBCPGKey;
import org.spongycastle.bcpg.SignatureSubpacketTags;
import org.spongycastle.bcpg.sig.KeyFlags;
@@ -28,7 +25,6 @@ import org.spongycastle.openpgp.PGPPublicKey;
import org.spongycastle.openpgp.PGPSignature;
import org.spongycastle.openpgp.PGPSignatureSubpacketVector;
import org.spongycastle.openpgp.operator.jcajce.JcaPGPContentVerifierBuilderProvider;
-import org.spongycastle.util.Strings;
import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.util.IterableIterator;
import org.sufficientlysecure.keychain.util.Log;
@@ -264,12 +260,6 @@ public class UncachedPublicKey {
return (getKeyUsage() & KeyFlags.CERTIFY_OTHER) != 0;
}
- if (mPublicKey.getAlgorithm() == PGPPublicKey.RSA_GENERAL
- || mPublicKey.getAlgorithm() == PGPPublicKey.RSA_SIGN
- || mPublicKey.getAlgorithm() == PGPPublicKey.ECDSA) {
- return true;
- }
-
return false;
}
@@ -279,9 +269,7 @@ public class UncachedPublicKey {
return (getKeyUsage() & KeyFlags.SIGN_DATA) != 0;
}
- if (mPublicKey.getAlgorithm() == PGPPublicKey.RSA_GENERAL
- || mPublicKey.getAlgorithm() == PGPPublicKey.RSA_SIGN
- || mPublicKey.getAlgorithm() == PGPPublicKey.ECDSA) {
+ if (UncachedKeyRing.isSigningAlgo(mPublicKey.getAlgorithm())) {
return true;
}
@@ -295,7 +283,7 @@ public class UncachedPublicKey {
}
// RSA_GENERAL, RSA_ENCRYPT, ELGAMAL_ENCRYPT, ELGAMAL_GENERAL, ECDH
- if (mPublicKey.isEncryptionKey()) {
+ if (UncachedKeyRing.isEncryptionAlgo(mPublicKey.getAlgorithm())) {
return true;
}