diff options
Diffstat (limited to 'OpenKeychain/src')
8 files changed, 1 insertions, 63 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/Constants.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/Constants.java index d02629b1a..9623eaeda 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/Constants.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/Constants.java @@ -100,7 +100,6 @@ public final class Constants { public static final String CACHED_CONSOLIDATE = "cachedConsolidate"; public static final String SEARCH_KEYSERVER = "search_keyserver_pref"; public static final String SEARCH_KEYBASE = "search_keybase_pref"; - public static final String USE_DEFAULT_YUBIKEY_PIN = "useDefaultYubikeyPin"; public static final String USE_NUMKEYPAD_FOR_YUBIKEY_PIN = "useNumKeypadForYubikeyPin"; public static final String ENCRYPT_FILENAMES = "encryptFilenames"; public static final String FILE_USE_COMPRESSION = "useFileCompression"; diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/PassphraseCacheService.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/PassphraseCacheService.java index 5d04317b3..df29a388f 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/PassphraseCacheService.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/PassphraseCacheService.java @@ -256,14 +256,6 @@ public class PassphraseCacheService extends Service { SecretKeyType keyType = keyRing.getSecretKeyType(subKeyId); switch (keyType) { - case DIVERT_TO_CARD: - if (Preferences.getPreferences(this).useDefaultYubiKeyPin()) { - Log.d(Constants.TAG, "PassphraseCacheService: Using default YubiKey PIN: 123456"); - return new Passphrase("123456"); // default YubiKey PIN, see http://www.yubico.com/2012/12/yubikey-neo-openpgp/ - } else { - Log.d(Constants.TAG, "PassphraseCacheService: NOT using default YubiKey PIN"); - break; - } case PASSPHRASE_EMPTY: return new Passphrase(""); case UNAVAILABLE: diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/NfcOperationActivity.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/NfcOperationActivity.java index c167e2b57..b79d3305d 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/NfcOperationActivity.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/NfcOperationActivity.java @@ -308,16 +308,6 @@ public class NfcOperationActivity extends BaseNfcActivity { public void onNfcPinError(String error) { onNfcError(error); - // avoid a loop - Preferences prefs = Preferences.getPreferences(this); - if (prefs.useDefaultYubiKeyPin()) { - // use Toast because activity is finished afterwards - Toast.makeText(this, R.string.error_pin_nodefault, Toast.LENGTH_LONG).show(); - setResult(RESULT_CANCELED); - finish(); - return; - } - // clear (invalid) passphrase PassphraseCacheService.clearCachedPassphrase( this, mRequiredInput.getMasterKeyId(), mRequiredInput.getSubKeyId()); diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/SettingsActivity.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/SettingsActivity.java index eb9ee05af..8118c2fa7 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/SettingsActivity.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/SettingsActivity.java @@ -109,9 +109,6 @@ public class SettingsActivity extends AppCompatPreferenceActivity { initializePassphraseCacheTtl( (IntegerListPreference) findPreference(Constants.Pref.PASSPHRASE_CACHE_TTL)); - initializeUseDefaultYubiKeyPin( - (CheckBoxPreference) findPreference(Constants.Pref.USE_DEFAULT_YUBIKEY_PIN)); - initializeUseNumKeypadForYubiKeyPin( (CheckBoxPreference) findPreference(Constants.Pref.USE_NUMKEYPAD_FOR_YUBIKEY_PIN)); @@ -237,9 +234,6 @@ public class SettingsActivity extends AppCompatPreferenceActivity { initializePassphraseCacheTtl( (IntegerListPreference) findPreference(Constants.Pref.PASSPHRASE_CACHE_TTL)); - initializeUseDefaultYubiKeyPin( - (CheckBoxPreference) findPreference(Constants.Pref.USE_DEFAULT_YUBIKEY_PIN)); - initializeUseNumKeypadForYubiKeyPin( (CheckBoxPreference) findPreference(Constants.Pref.USE_NUMKEYPAD_FOR_YUBIKEY_PIN)); } @@ -665,17 +659,6 @@ public class SettingsActivity extends AppCompatPreferenceActivity { .getPreferredKeyserver(); } - private static void initializeUseDefaultYubiKeyPin(final CheckBoxPreference mUseDefaultYubiKeyPin) { - mUseDefaultYubiKeyPin.setChecked(sPreferences.useDefaultYubiKeyPin()); - mUseDefaultYubiKeyPin.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() { - public boolean onPreferenceChange(Preference preference, Object newValue) { - mUseDefaultYubiKeyPin.setChecked((Boolean) newValue); - sPreferences.setUseDefaultYubiKeyPin((Boolean) newValue); - return false; - } - }); - } - private static void initializeUseNumKeypadForYubiKeyPin(final CheckBoxPreference mUseNumKeypadForYubiKeyPin) { mUseNumKeypadForYubiKeyPin.setChecked(sPreferences.useNumKeypadForYubiKeyPin()); mUseNumKeypadForYubiKeyPin.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() { diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/base/BaseNfcActivity.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/base/BaseNfcActivity.java index f29f6eb7c..3e0bc7890 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/base/BaseNfcActivity.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/base/BaseNfcActivity.java @@ -337,13 +337,6 @@ public abstract class BaseNfcActivity extends BaseActivity { protected void obtainYubiKeyPin(RequiredInputParcel requiredInput) { - // shortcut if we only use the default YubiKey pin - Preferences prefs = Preferences.getPreferences(this); - if (prefs.useDefaultYubiKeyPin()) { - mPin = new Passphrase("123456"); - return; - } - try { Passphrase passphrase = PassphraseCacheService.getCachedPassphrase(this, requiredInput.getMasterKeyId(), requiredInput.getSubKeyId()); diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/util/Preferences.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/util/Preferences.java index 4ef215036..8b2c3c66a 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/util/Preferences.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/util/Preferences.java @@ -123,16 +123,6 @@ public class Preferences { return mSharedPreferences.getBoolean(Constants.Pref.FIRST_TIME, true); } - public boolean useDefaultYubiKeyPin() { - return mSharedPreferences.getBoolean(Pref.USE_DEFAULT_YUBIKEY_PIN, false); - } - - public void setUseDefaultYubiKeyPin(boolean useDefaultYubikeyPin) { - SharedPreferences.Editor editor = mSharedPreferences.edit(); - editor.putBoolean(Pref.USE_DEFAULT_YUBIKEY_PIN, useDefaultYubikeyPin); - editor.commit(); - } - public boolean useNumKeypadForYubiKeyPin() { return mSharedPreferences.getBoolean(Pref.USE_NUMKEYPAD_FOR_YUBIKEY_PIN, true); } diff --git a/OpenKeychain/src/main/res/values/strings.xml b/OpenKeychain/src/main/res/values/strings.xml index 15e714a11..11036c9d3 100644 --- a/OpenKeychain/src/main/res/values/strings.xml +++ b/OpenKeychain/src/main/res/values/strings.xml @@ -141,9 +141,7 @@ <string name="label_file_ascii_armor">"Enable ASCII Armor"</string> <string name="label_write_version_header">"Let others know that you're using OpenKeychain"</string> <string name="label_write_version_header_summary">"Writes 'OpenKeychain v2.7' to OpenPGP signatures, ciphertext, and exported keys"</string> - <string name="label_use_default_yubikey_pin">"Use default YubiKey PIN"</string> <string name="label_use_num_keypad_for_yubikey_pin">Use number keypad for YubiKey PIN</string> - <string name="label_label_use_default_yubikey_pin_summary">"Uses default PIN (123456) to access YubiKeys over NFC"</string> <string name="label_asymmetric_from">"Sign with:"</string> <string name="label_to">"Encrypt to:"</string> <string name="label_delete_after_encryption">"Delete files after encryption"</string> @@ -1537,7 +1535,6 @@ <string name="error_nfc_tag_lost">"YubiKey has been taken off too early. Keep the YubiKey at the back until the operation finishes."</string> <string name="error_nfc_iso_dep_not_supported">"Tag does not support ISO-DEP (ISO 14443-4)"</string> <string name="error_nfc_try_again">"Try again"</string> - <string name="error_pin_nodefault">Default PIN was rejected!</string> <string name="error_pin_wrong">PIN is wrong!</string> <string name="error_temp_file">Error creating temporary file.</string> <string name="btn_delete_original">Delete original file</string> diff --git a/OpenKeychain/src/main/res/xml/passphrase_preferences.xml b/OpenKeychain/src/main/res/xml/passphrase_preferences.xml index 7dd649e5d..86de8a4b7 100644 --- a/OpenKeychain/src/main/res/xml/passphrase_preferences.xml +++ b/OpenKeychain/src/main/res/xml/passphrase_preferences.xml @@ -10,14 +10,8 @@ android:persistent="false" android:title="@string/label_passphrase_cache_subs" /> <CheckBoxPreference - android:key="useDefaultYubikeyPin" - android:persistent="false" - android:defaultValue="true" - android:title="@string/label_use_default_yubikey_pin" - android:summary="@string/label_label_use_default_yubikey_pin_summary" /> - <CheckBoxPreference + android:defaultValue="false" android:key="useNumKeypadForYubikeyPin" android:persistent="false" - android:defaultValue="false" android:title="@string/label_use_num_keypad_for_yubikey_pin" /> </PreferenceScreen> |