aboutsummaryrefslogtreecommitdiffstats
path: root/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentService.java
diff options
context:
space:
mode:
authorVincent Breitmoser <valodim@mugenguild.com>2014-09-24 01:41:40 +0200
committerVincent Breitmoser <valodim@mugenguild.com>2014-09-24 01:41:40 +0200
commit7654cd54fbba9fa6ecaf47f5ffc5fc21669d6e56 (patch)
tree371060df8332f6dd419ad524b02412b9dfeffa60 /OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentService.java
parentd588b13255a7b7391c5f782a464c44bee4a3391b (diff)
downloadopen-keychain-7654cd54fbba9fa6ecaf47f5ffc5fc21669d6e56.tar.gz
open-keychain-7654cd54fbba9fa6ecaf47f5ffc5fc21669d6e56.tar.bz2
open-keychain-7654cd54fbba9fa6ecaf47f5ffc5fc21669d6e56.zip
fix signing in OK with yubikeys
Diffstat (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentService.java')
-rw-r--r--OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentService.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentService.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentService.java
index 6d23c36b9..dc0d59e86 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentService.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentService.java
@@ -77,6 +77,7 @@ import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.util.ArrayList;
+import java.util.Date;
import java.util.List;
import java.util.concurrent.atomic.AtomicBoolean;
@@ -133,6 +134,8 @@ public class KeychainIntentService extends IntentService implements Progressable
// encrypt
public static final String ENCRYPT_SIGNATURE_MASTER_ID = "secret_key_id";
public static final String ENCRYPT_SIGNATURE_KEY_PASSPHRASE = "secret_key_passphrase";
+ public static final String ENCRYPT_SIGNATURE_NFC_TIMESTAMP = "signature_nfc_timestamp";
+ public static final String ENCRYPT_SIGNATURE_NFC_HASH = "signature_nfc_hash";
public static final String ENCRYPT_USE_ASCII_ARMOR = "use_ascii_armor";
public static final String ENCRYPT_ENCRYPTION_KEYS_IDS = "encryption_keys_ids";
public static final String ENCRYPT_COMPRESSION_ID = "compression_id";
@@ -255,6 +258,10 @@ public class KeychainIntentService extends IntentService implements Progressable
long sigMasterKeyId = data.getLong(ENCRYPT_SIGNATURE_MASTER_ID);
String sigKeyPassphrase = data.getString(ENCRYPT_SIGNATURE_KEY_PASSPHRASE);
+
+ byte[] nfcHash = data.getByteArray(ENCRYPT_SIGNATURE_NFC_HASH);
+ Date nfcTimestamp = (Date) data.getSerializable(ENCRYPT_SIGNATURE_NFC_TIMESTAMP);
+
String symmetricPassphrase = data.getString(ENCRYPT_SYMMETRIC_PASSPHRASE);
boolean useAsciiArmor = data.getBoolean(ENCRYPT_USE_ASCII_ARMOR);
@@ -295,6 +302,10 @@ public class KeychainIntentService extends IntentService implements Progressable
.setSignatureHashAlgorithm(
Preferences.getPreferences(this).getDefaultHashAlgorithm())
.setAdditionalEncryptId(sigMasterKeyId);
+ if (nfcHash != null && nfcTimestamp != null) {
+ builder.setNfcState(nfcHash, nfcTimestamp);
+ }
+
} catch (PgpGeneralException e) {
// encrypt-only
// TODO Just silently drop the requested signature? Shouldn't we throw here?