aboutsummaryrefslogtreecommitdiffstats
path: root/OpenKeychain/src/test
diff options
context:
space:
mode:
authorDominik Schürmann <dominik@dominikschuermann.de>2016-01-10 17:17:57 +0100
committerDominik Schürmann <dominik@dominikschuermann.de>2016-01-10 17:17:57 +0100
commit0fd5b45df913d1524aa400a644c48dc91044d9bf (patch)
tree8a1c879bffd5143ef3c79a3a0702bddd085bf50e /OpenKeychain/src/test
parent9163b93a907a29dab04e1ca99b175b097d1e9d91 (diff)
downloadopen-keychain-0fd5b45df913d1524aa400a644c48dc91044d9bf.tar.gz
open-keychain-0fd5b45df913d1524aa400a644c48dc91044d9bf.tar.bz2
open-keychain-0fd5b45df913d1524aa400a644c48dc91044d9bf.zip
Use more generic 'Security Token' where possible, add sutitle to create key what tokens are supported
Diffstat (limited to 'OpenKeychain/src/test')
-rw-r--r--OpenKeychain/src/test/java/org/sufficientlysecure/keychain/pgp/PgpKeyOperationTest.java22
-rw-r--r--OpenKeychain/src/test/java/org/sufficientlysecure/keychain/util/Iso7816TLVTest.java2
2 files changed, 12 insertions, 12 deletions
diff --git a/OpenKeychain/src/test/java/org/sufficientlysecure/keychain/pgp/PgpKeyOperationTest.java b/OpenKeychain/src/test/java/org/sufficientlysecure/keychain/pgp/PgpKeyOperationTest.java
index 5a8bbad21..082a4923e 100644
--- a/OpenKeychain/src/test/java/org/sufficientlysecure/keychain/pgp/PgpKeyOperationTest.java
+++ b/OpenKeychain/src/test/java/org/sufficientlysecure/keychain/pgp/PgpKeyOperationTest.java
@@ -829,7 +829,7 @@ public class PgpKeyOperationTest {
}
@Test
- public void testKeyToCard() throws Exception {
+ public void testKeyToSecurityToken() throws Exception {
// Special keyring for security token tests with 2048 bit RSA as a subkey
SaveKeyringParcel parcelKey = new SaveKeyringParcel();
@@ -857,27 +857,27 @@ public class PgpKeyOperationTest {
UncachedKeyRing modified;
- { // keytocard should fail with BAD_NFC_SIZE when presented with the RSA-3072 key
+ { // moveKeyToSecurityToken should fail with BAD_NFC_SIZE when presented with the RSA-3072 key
long keyId = KeyringTestingHelper.getSubkeyId(ringSecurityToken, 2);
parcelSecurityToken.reset();
parcelSecurityToken.mChangeSubKeys.add(new SubkeyChange(keyId, false, true));
- assertModifyFailure("keytocard operation should fail on invalid key size", ringSecurityToken,
- parcelSecurityToken, cryptoInput, LogType.MSG_MF_ERROR_BAD_NFC_SIZE);
+ assertModifyFailure("moveKeyToSecurityToken operation should fail on invalid key size", ringSecurityToken,
+ parcelSecurityToken, cryptoInput, LogType.MSG_MF_ERROR_BAD_SECURITY_TOKEN_SIZE);
}
- { // keytocard should fail with BAD_NFC_ALGO when presented with the DSA-1024 key
+ { // moveKeyToSecurityToken should fail with BAD_NFC_ALGO when presented with the DSA-1024 key
long keyId = KeyringTestingHelper.getSubkeyId(ringSecurityToken, 0);
parcelSecurityToken.reset();
parcelSecurityToken.mChangeSubKeys.add(new SubkeyChange(keyId, false, true));
- assertModifyFailure("keytocard operation should fail on invalid key algorithm", ringSecurityToken,
- parcelSecurityToken, cryptoInput, LogType.MSG_MF_ERROR_BAD_NFC_ALGO);
+ assertModifyFailure("moveKeyToSecurityToken operation should fail on invalid key algorithm", ringSecurityToken,
+ parcelSecurityToken, cryptoInput, LogType.MSG_MF_ERROR_BAD_SECURITY_TOKEN_ALGO);
}
long keyId = KeyringTestingHelper.getSubkeyId(ringSecurityToken, 1);
- { // keytocard should return a pending NFC_MOVE_KEY_TO_CARD result when presented with the RSA-2048
+ { // moveKeyToSecurityToken should return a pending NFC_MOVE_KEY_TO_CARD result when presented with the RSA-2048
// key, and then make key divert-to-card when it gets a serial in the cryptoInputParcel.
parcelSecurityToken.reset();
parcelSecurityToken.mChangeSubKeys.add(new SubkeyChange(keyId, false, true));
@@ -886,11 +886,11 @@ public class PgpKeyOperationTest {
new CanonicalizedSecretKeyRing(ringSecurityToken.getEncoded(), false, 0);
PgpKeyOperation op = new PgpKeyOperation(null);
PgpEditKeyResult result = op.modifySecretKeyRing(secretRing, cryptoInput, parcelSecurityToken);
- Assert.assertTrue("keytocard operation should be pending", result.isPending());
+ Assert.assertTrue("moveKeyToSecurityToken operation should be pending", result.isPending());
Assert.assertEquals("required input should be RequiredInputType.NFC_MOVE_KEY_TO_CARD",
result.getRequiredInputParcel().mType, RequiredInputType.NFC_MOVE_KEY_TO_CARD);
- // Create a cryptoInputParcel that matches what the NFCOperationActivity would return.
+ // Create a cryptoInputParcel that matches what the SecurityTokenOperationActivity would return.
byte[] keyIdBytes = new byte[8];
ByteBuffer buf = ByteBuffer.wrap(keyIdBytes);
buf.putLong(keyId).rewind();
@@ -920,7 +920,7 @@ public class PgpKeyOperationTest {
new CanonicalizedSecretKeyRing(modified.getEncoded(), false, 0);
PgpKeyOperation op = new PgpKeyOperation(null);
PgpEditKeyResult result = op.modifySecretKeyRing(secretRing, cryptoInput, parcelSecurityToken);
- Assert.assertTrue("keytocard operation should be pending", result.isPending());
+ Assert.assertTrue("moveKeyToSecurityToken operation should be pending", result.isPending());
Assert.assertEquals("required input should be RequiredInputType.NFC_SIGN",
RequiredInputType.NFC_SIGN, result.getRequiredInputParcel().mType);
}
diff --git a/OpenKeychain/src/test/java/org/sufficientlysecure/keychain/util/Iso7816TLVTest.java b/OpenKeychain/src/test/java/org/sufficientlysecure/keychain/util/Iso7816TLVTest.java
index f6888588e..99f79bd5b 100644
--- a/OpenKeychain/src/test/java/org/sufficientlysecure/keychain/util/Iso7816TLVTest.java
+++ b/OpenKeychain/src/test/java/org/sufficientlysecure/keychain/util/Iso7816TLVTest.java
@@ -40,7 +40,7 @@ public class Iso7816TLVTest {
@Test
public void testDecode() throws Exception {
- // this is an Application Related Data packet, received from my Yubikey
+ // this is an Application Related Data packet, received from my YubiKey NEO
String input = "6e81dd4f10d27600012401020000000000000100005f520f0073000080000000000000000000007300c00af00000ff04c000ff00ffc106010800001103c206010800001103c306010800001103c407007f7f7f030303c53c1efdb4845ca242ca6977fddb1f788094fd3b430af1114c28a08d8c5afda81191cc50ca9bf51bc99fe8e6ca03a9d4d40e7b5925cd154813df381655b2c63c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000cd0c5423590e5423590e5423590e9000";
byte[] data = Hex.decode(input);