jgit/org.eclipse.jgit.gpg.bc
Thomas Wolf bdc48aeac7 GPG: handle extended private key format
Add detection for the key-value pair format that was available in
gpg-agent for some time already and that has become the default since
gpg-agent 2.2.20. If a secret key in the .gnupg/private-keys-v1.d
directory is found to have this format, extract the human-readable key
from it, convert it to the binary serialized form and hand that to
BouncyCastle.

Encrypted keys in the new format may use AES/OCB. OCB is a patent-
encumbered algorithm; although there is a license for open-source
software, that may not be good enough and OCB may not be available in
Java. It is not available in the default security provider in Java,
and it is also not available in the BouncyCastle version included in
Eclipse.

Implement AES/OCB decryption, throwing a PGPException with a nice
message if the algorithm is not available. Include a copy of the normal
s-expression parser of BouncyCastle and fix it to properly handle data
from such keys: such keys do not contain an internal hash since the
AES/OCB cipher includes and checks a MAC already.

Bug: 570501
Change-Id: Ifa6391a809a84cfc6ae7c6610af6a79204b4143b
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2021-02-19 18:24:47 -05:00
..
.settings Decouple BouncyCastle from JGit Core 2020-06-01 01:26:22 +02:00
META-INF GPG: handle extended private key format 2021-02-19 18:24:47 -05:00
resources GPG: handle extended private key format 2021-02-19 18:24:47 -05:00
src/org/eclipse/jgit/gpg/bc GPG: handle extended private key format 2021-02-19 18:24:47 -05:00
.classpath Decouple BouncyCastle from JGit Core 2020-06-01 01:26:22 +02:00
.fbprefs Decouple BouncyCastle from JGit Core 2020-06-01 01:26:22 +02:00
.gitignore Decouple BouncyCastle from JGit Core 2020-06-01 01:26:22 +02:00
.project Decouple BouncyCastle from JGit Core 2020-06-01 01:26:22 +02:00
BUILD Decouple BouncyCastle from JGit Core 2020-06-01 01:26:22 +02:00
about.html GPG: handle extended private key format 2021-02-19 18:24:47 -05:00
build.properties Decouple BouncyCastle from JGit Core 2020-06-01 01:26:22 +02:00
plugin.properties Decouple BouncyCastle from JGit Core 2020-06-01 01:26:22 +02:00
pom.xml Prepare 5.11.0-SNAPSHOT builds 2020-12-02 15:57:16 +01:00