diff options
Diffstat (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain')
4 files changed, 15 insertions, 3 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpSignEncrypt.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpSignEncrypt.java index 2e4620813..c7d6455ab 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpSignEncrypt.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpSignEncrypt.java @@ -569,7 +569,7 @@ public class PgpSignEncrypt { log.add(LogType.MSG_SE_PENDING_NFC, indent); SignEncryptResult result = new SignEncryptResult(SignEncryptResult.RESULT_PENDING_NFC, log); - result.setNfcData(e.hashToSign, e.hashAlgo, e.creationTimestamp); + result.setNfcData(e.hashToSign, e.hashAlgo, e.creationTimestamp, mSignaturePassphrase); Log.d(Constants.TAG, "e.hashToSign"+ Hex.toHexString(e.hashToSign)); return result; } diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/results/SignEncryptResult.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/results/SignEncryptResult.java index 84eb29a62..0f3c93385 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/results/SignEncryptResult.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/results/SignEncryptResult.java @@ -35,6 +35,7 @@ public class SignEncryptResult extends OperationResult { byte[] mNfcHash; int mNfcAlgo; Date mNfcTimestamp; + String mNfcPassphrase; public long getKeyIdPassphraseNeeded() { return mKeyIdPassphraseNeeded; @@ -44,10 +45,11 @@ public class SignEncryptResult extends OperationResult { mKeyIdPassphraseNeeded = keyIdPassphraseNeeded; } - public void setNfcData(byte[] nfcHash, int nfcAlgo, Date nfcTimestamp) { + public void setNfcData(byte[] nfcHash, int nfcAlgo, Date nfcTimestamp, String passphrase) { mNfcHash = nfcHash; mNfcAlgo = nfcAlgo; mNfcTimestamp = nfcTimestamp; + mNfcPassphrase = passphrase; } public byte[] getNfcHash() { @@ -62,6 +64,10 @@ public class SignEncryptResult extends OperationResult { return mNfcTimestamp; } + public String getNfcPassphrase() { + return mNfcPassphrase; + } + public boolean isPending() { return (mResult & RESULT_PENDING) == RESULT_PENDING; } diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptTextActivity.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptTextActivity.java index 6598ec50c..f1040dd18 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptTextActivity.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptTextActivity.java @@ -207,7 +207,7 @@ public class EncryptTextActivity extends EncryptActivity implements EncryptActiv SignEncryptResult.RESULT_PENDING_NFC) { mNfcTimestamp = pgpResult.getNfcTimestamp(); - startNfcSign("123456", pgpResult.getNfcHash(), pgpResult.getNfcAlgo()); + startNfcSign(pgpResult.getNfcPassphrase(), pgpResult.getNfcHash(), pgpResult.getNfcAlgo()); } else { throw new RuntimeException("Unhandled pending result!"); } diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/NfcActivity.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/NfcActivity.java index 922ff1aa5..fb2209d3e 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/NfcActivity.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/NfcActivity.java @@ -43,6 +43,7 @@ public class NfcActivity extends ActionBarActivity { // always public static final String EXTRA_PIN = "pin"; + public static final String EXTRA_FINGERPRINT = "fingerprint"; // special extra for OpenPgpService public static final String EXTRA_DATA = "data"; @@ -63,6 +64,8 @@ public class NfcActivity extends ActionBarActivity { private String mPin; + private byte[] mFingerprint; + // sign private byte[] mHashToSign; private int mHashAlgo; @@ -83,6 +86,9 @@ public class NfcActivity extends ActionBarActivity { Bundle data = intent.getExtras(); String action = intent.getAction(); + // TODO check fingerprint + // mFingerprint = data.getByteArray(EXTRA_FINGERPRINT); + if (ACTION_SIGN_HASH.equals(action)) { mAction = action; mPin = data.getString(EXTRA_PIN); |