Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement OpenPGP v6 & LibrePGP v5 signature verification #1725

Closed
wants to merge 18 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Reuse constants for fingerprint calculation
vanitasvitae committed Jun 12, 2024
commit 3042c099e768f63426ff8a3b5c624851d4ed26f7
Original file line number Diff line number Diff line change
@@ -23,7 +23,7 @@ public byte[] calculateFingerprint(PublicKeyPacket publicPk)
BCPGKey key = publicPk.getKey();
Digest digest;

if (publicPk.getVersion() <= 3)
if (publicPk.getVersion() <= PublicKeyPacket.VERSION_3)
{
RSAPublicBCPGKey rK = (RSAPublicBCPGKey)key;

@@ -42,7 +42,7 @@ public byte[] calculateFingerprint(PublicKeyPacket publicPk)
throw new PGPException("can't encode key components: " + e.getMessage(), e);
}
}
else if (publicPk.getVersion() == 4)
else if (publicPk.getVersion() == PublicKeyPacket.VERSION_4)
{
try
{
@@ -60,7 +60,7 @@ else if (publicPk.getVersion() == 4)
throw new PGPException("can't encode key components: " + e.getMessage(), e);
}
}
else if (publicPk.getVersion() == 6)
else if (publicPk.getVersion() == PublicKeyPacket.VERSION_6)
{
try
{
Original file line number Diff line number Diff line change
@@ -63,7 +63,7 @@ public byte[] calculateFingerprint(PublicKeyPacket publicPk)
{
BCPGKey key = publicPk.getKey();

if (publicPk.getVersion() <= 3)
if (publicPk.getVersion() <= PublicKeyPacket.VERSION_3)
{
RSAPublicBCPGKey rK = (RSAPublicBCPGKey)key;

@@ -92,7 +92,7 @@ public byte[] calculateFingerprint(PublicKeyPacket publicPk)
throw new PGPException("can't encode key components: " + e.getMessage(), e);
}
}
else if (publicPk.getVersion() == 4)
else if (publicPk.getVersion() == PublicKeyPacket.VERSION_4)
{
try
{
@@ -120,7 +120,7 @@ else if (publicPk.getVersion() == 4)
throw new PGPException("can't encode key components: " + e.getMessage(), e);
}
}
else if (publicPk.getVersion() == 6)
else if (publicPk.getVersion() == PublicKeyPacket.VERSION_6)
{
try
{