mirror of
https://github.com/moparisthebest/open-keychain
synced 2024-11-14 04:45:04 -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.Context;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
|
import android.os.Build;
|
||||||
|
|
||||||
import org.spongycastle.bcpg.CompressionAlgorithmTags;
|
import org.spongycastle.bcpg.CompressionAlgorithmTags;
|
||||||
import org.spongycastle.bcpg.HashAlgorithmTags;
|
import org.spongycastle.bcpg.HashAlgorithmTags;
|
||||||
@ -51,8 +52,13 @@ public class Preferences {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private Preferences(Context context) {
|
private Preferences(Context context) {
|
||||||
|
// 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);
|
mSharedPreferences = context.getSharedPreferences("APG.main", Context.MODE_PRIVATE);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public String getLanguage() {
|
public String getLanguage() {
|
||||||
return mSharedPreferences.getString(Constants.Pref.LANGUAGE, "");
|
return mSharedPreferences.getString(Constants.Pref.LANGUAGE, "");
|
||||||
|
@ -215,8 +215,10 @@ public class PassphraseCacheService extends Service {
|
|||||||
switch (keyType) {
|
switch (keyType) {
|
||||||
case DIVERT_TO_CARD:
|
case DIVERT_TO_CARD:
|
||||||
if (Preferences.getPreferences(this).useDefaultYubikeyPin()) {
|
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/
|
return "123456"; // default Yubikey PIN, see http://www.yubico.com/2012/12/yubikey-neo-openpgp/
|
||||||
} else {
|
} else {
|
||||||
|
Log.d(Constants.TAG, "PassphraseCacheService: NOT using default Yubikey PIN");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case PASSPHRASE_EMPTY:
|
case PASSPHRASE_EMPTY:
|
||||||
|
@ -160,7 +160,7 @@ public class PassphraseDialogFragment extends DialogFragment implements OnEditor
|
|||||||
message = getString(R.string.passphrase_for, userId);
|
message = getString(R.string.passphrase_for, userId);
|
||||||
break;
|
break;
|
||||||
case DIVERT_TO_CARD:
|
case DIVERT_TO_CARD:
|
||||||
message = getString(R.string.yubikey_pin);
|
message = getString(R.string.yubikey_pin, userId);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
message = "This should not happen!";
|
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