From 056a6dd3479fe1e5cc5981ac51a458b015d3e9cb Mon Sep 17 00:00:00 2001 From: Thialfihar Date: Wed, 14 May 2014 14:14:02 +0200 Subject: [PATCH] Don't guess keybase key algorithm and size Once keybase reports them, we can display them. Until then we simply don't know and shouldn't lie about it. --- .../keychain/keyimport/KeybaseKeyServer.java | 6 ++---- .../keychain/ui/adapter/ImportKeysAdapter.java | 7 ++++++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/keyimport/KeybaseKeyServer.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/keyimport/KeybaseKeyServer.java index d1755fa12..da47c32c6 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/keyimport/KeybaseKeyServer.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/keyimport/KeybaseKeyServer.java @@ -98,10 +98,8 @@ public class KeybaseKeyServer extends KeyServer { entry.setExtraData(keybaseId); // TODO: Fix; have suggested keybase provide this value to avoid search-time crypto calls - entry.setBitStrength(4096); - entry.setAlgorithm("RSA"); - entry.setKeyIdHex("0x" + key_fingerprint); - entry.setRevoked(false); + //entry.setBitStrength(4096); + //entry.setAlgorithm("RSA"); // ctime final long creationDate = JWalk.getLong(match, "them", "public_keys", "primary", "ctime"); diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/ImportKeysAdapter.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/ImportKeysAdapter.java index 9d323c822..70b9f3f7e 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/ImportKeysAdapter.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/ImportKeysAdapter.java @@ -153,7 +153,12 @@ public class ImportKeysAdapter extends ArrayAdapter { holder.fingerprint.setVisibility(View.GONE); } - holder.algorithm.setText("" + entry.bitStrength + "/" + entry.algorithm); + if (entry.bitStrength != 0 && entry.algorithm != null) { + holder.algorithm.setText("" + entry.bitStrength + "/" + entry.algorithm); + holder.algorithm.setVisibility(View.VISIBLE); + } else { + holder.algorithm.setVisibility(View.INVISIBLE); + } if (entry.revoked) { holder.status.setVisibility(View.VISIBLE);