summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.gpg.bc.test/tst
diff options
context:
space:
mode:
authorThomas Wolf <twolf@apache.org>2024-03-09 10:18:10 +0100
committerThomas Wolf <twolf@apache.org>2024-04-08 19:10:58 +0200
commited8c394eba244bcfdc78c40384c3edfb4d35e835 (patch)
tree8e80ab072b3099a0ddc779dfb39f12658522c0c4 /org.eclipse.jgit.gpg.bc.test/tst
parent5c623b1e6c69f2f67076d668157f9ad6be54422d (diff)
downloadjgit-ed8c394eba244bcfdc78c40384c3edfb4d35e835.tar.gz
jgit-ed8c394eba244bcfdc78c40384c3edfb4d35e835.zip
[gpg] Fix reading ed25519 GPG keys
The S-expression parser from Bouncy Castle parsed such keys wrongly; there is a "flags" sub-list before the "q" value. Additionally, the parser validates the key read against the given public key, this failed because Bouncy Castle does not know the OID of curve name "Ed25519". Fix this and add a test for reading an ed25519 GPG key. Bug: jgit-27 Change-Id: Ia50445b88759927d2e80b9871d498fbe5ad201bc Signed-off-by: Thomas Wolf <twolf@apache.org>
Diffstat (limited to 'org.eclipse.jgit.gpg.bc.test/tst')
-rw-r--r--org.eclipse.jgit.gpg.bc.test/tst/org/eclipse/jgit/gpg/bc/internal/keys/SecretKeysTest.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/org.eclipse.jgit.gpg.bc.test/tst/org/eclipse/jgit/gpg/bc/internal/keys/SecretKeysTest.java b/org.eclipse.jgit.gpg.bc.test/tst/org/eclipse/jgit/gpg/bc/internal/keys/SecretKeysTest.java
index 5e5e303319..fed06103b6 100644
--- a/org.eclipse.jgit.gpg.bc.test/tst/org/eclipse/jgit/gpg/bc/internal/keys/SecretKeysTest.java
+++ b/org.eclipse.jgit.gpg.bc.test/tst/org/eclipse/jgit/gpg/bc/internal/keys/SecretKeysTest.java
@@ -97,6 +97,7 @@ public class SecretKeysTest {
new TestData("2FB05DBB70FC07CB84C13431F640CA6CEA1DBF8A", false, true),
new TestData("66CCECEC2AB46A9735B10FEC54EDF9FD0F77BAF9", true, true),
new TestData("F727FAB884DA3BD402B6E0F5472E108D21033124", true, true),
+ new TestData("62D43D7F117F7A5E4998ECB6617EE9942D069C14", true, true),
new TestData("faked", false, true) };
}
@@ -152,7 +153,7 @@ public class SecretKeysTest {
assertNotNull(secretKey);
} catch (PGPException e) {
// Currently we may not be able to load OCB-encrypted keys.
- assertTrue(e.getMessage().contains("OCB"));
+ assertTrue(e.toString(), e.getMessage().contains("OCB"));
assertTrue(data.encrypted);
assertFalse(ocbAvailable());
}