mirror of
https://github.com/moparisthebest/open-keychain
synced 2024-11-12 12:05:10 -05:00
Yubikey: use PIN
This commit is contained in:
parent
7ccd30b78e
commit
f4592c8b95
@ -20,6 +20,7 @@ package org.sufficientlysecure.keychain.helper;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Build;
|
||||
|
||||
import org.spongycastle.bcpg.CompressionAlgorithmTags;
|
||||
import org.spongycastle.bcpg.HashAlgorithmTags;
|
||||
@ -51,7 +52,12 @@ public class Preferences {
|
||||
}
|
||||
|
||||
private Preferences(Context context) {
|
||||
mSharedPreferences = context.getSharedPreferences("APG.main", Context.MODE_PRIVATE);
|
||||
// multi-process preferences
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
|
||||
mSharedPreferences = context.getSharedPreferences("APG.main", Context.MODE_MULTI_PROCESS);
|
||||
} else {
|
||||
mSharedPreferences = context.getSharedPreferences("APG.main", Context.MODE_PRIVATE);
|
||||
}
|
||||
}
|
||||
|
||||
public String getLanguage() {
|
||||
|
@ -215,8 +215,10 @@ public class PassphraseCacheService extends Service {
|
||||
switch (keyType) {
|
||||
case DIVERT_TO_CARD:
|
||||
if (Preferences.getPreferences(this).useDefaultYubikeyPin()) {
|
||||
Log.d(Constants.TAG, "PassphraseCacheService: Using default Yubikey PIN: 123456");
|
||||
return "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:
|
||||
|
@ -160,7 +160,7 @@ public class PassphraseDialogFragment extends DialogFragment implements OnEditor
|
||||
message = getString(R.string.passphrase_for, userId);
|
||||
break;
|
||||
case DIVERT_TO_CARD:
|
||||
message = getString(R.string.yubikey_pin);
|
||||
message = getString(R.string.yubikey_pin, userId);
|
||||
break;
|
||||
default:
|
||||
message = "This should not happen!";
|
||||
|
2
extern/openpgp-card-nfc-lib
vendored
2
extern/openpgp-card-nfc-lib
vendored
@ -1 +1 @@
|
||||
Subproject commit 14370a4b07922deec909472616c3df0d950d5614
|
||||
Subproject commit d5871f13bd9e328ede389c65c20e541fb740121d
|
Loading…
Reference in New Issue
Block a user