mirror of
https://github.com/pgpainless/pgpainless.git
synced 2025-09-16 05:39:39 +02:00
Compare commits
4 commits
Author | SHA1 | Date | |
---|---|---|---|
af7da01497 | |||
23e6b6a35e | |||
03dbd2f03f | |||
d65a26fbf5 |
7 changed files with 13 additions and 13 deletions
|
@ -5,6 +5,10 @@ SPDX-License-Identifier: CC0-1.0
|
||||||
|
|
||||||
# PGPainless Changelog
|
# PGPainless Changelog
|
||||||
|
|
||||||
|
# 1.4.5
|
||||||
|
- Bugfix: Direct-Key signatures are calculated over the signee key only, not the signer key + signee key
|
||||||
|
- Security: Fix faulty bit-strength policy check for signing subkeys
|
||||||
|
|
||||||
## 1.4.4
|
## 1.4.4
|
||||||
- Fix expectations on subpackets of v3 signatures (thanks @bjansen)
|
- Fix expectations on subpackets of v3 signatures (thanks @bjansen)
|
||||||
- Properly verify v3 signatures, which do not yet have signature subpackets, yet we required them to have
|
- Properly verify v3 signatures, which do not yet have signature subpackets, yet we required them to have
|
||||||
|
|
|
@ -191,7 +191,7 @@ repositories {
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation 'org.pgpainless:pgpainless-core:1.4.4'
|
implementation 'org.pgpainless:pgpainless-core:1.4.5'
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -379,7 +379,7 @@ public final class SigningOptions {
|
||||||
SubkeyIdentifier signingKeyIdentifier = new SubkeyIdentifier(secretKey, signingSubkey.getKeyID());
|
SubkeyIdentifier signingKeyIdentifier = new SubkeyIdentifier(secretKey, signingSubkey.getKeyID());
|
||||||
PGPSecretKey signingSecretKey = secretKey.getSecretKey(signingSubkey.getKeyID());
|
PGPSecretKey signingSecretKey = secretKey.getSecretKey(signingSubkey.getKeyID());
|
||||||
PublicKeyAlgorithm publicKeyAlgorithm = PublicKeyAlgorithm.requireFromId(signingSecretKey.getPublicKey().getAlgorithm());
|
PublicKeyAlgorithm publicKeyAlgorithm = PublicKeyAlgorithm.requireFromId(signingSecretKey.getPublicKey().getAlgorithm());
|
||||||
int bitStrength = secretKey.getPublicKey().getBitStrength();
|
int bitStrength = signingSecretKey.getPublicKey().getBitStrength();
|
||||||
if (!PGPainless.getPolicy().getPublicKeyAlgorithmPolicy().isAcceptable(publicKeyAlgorithm, bitStrength)) {
|
if (!PGPainless.getPolicy().getPublicKeyAlgorithmPolicy().isAcceptable(publicKeyAlgorithm, bitStrength)) {
|
||||||
throw new KeyException.UnacceptableSigningKeyException(
|
throw new KeyException.UnacceptableSigningKeyException(
|
||||||
new KeyException.PublicKeyAlgorithmPolicyException(
|
new KeyException.PublicKeyAlgorithmPolicyException(
|
||||||
|
|
|
@ -43,11 +43,7 @@ public class ThirdPartyDirectKeySignatureBuilder extends AbstractSignatureBuilde
|
||||||
|
|
||||||
public PGPSignature build(PGPPublicKey key) throws PGPException {
|
public PGPSignature build(PGPPublicKey key) throws PGPException {
|
||||||
PGPSignatureGenerator signatureGenerator = buildAndInitSignatureGenerator();
|
PGPSignatureGenerator signatureGenerator = buildAndInitSignatureGenerator();
|
||||||
if (key.getKeyID() != publicSigningKey.getKeyID()) {
|
return signatureGenerator.generateCertification(key);
|
||||||
return signatureGenerator.generateCertification(publicSigningKey, key);
|
|
||||||
} else {
|
|
||||||
return signatureGenerator.generateCertification(key);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -539,10 +539,10 @@ public abstract class SignatureValidator {
|
||||||
try {
|
try {
|
||||||
signature.init(ImplementationFactory.getInstance().getPGPContentVerifierBuilderProvider(), signer);
|
signature.init(ImplementationFactory.getInstance().getPGPContentVerifierBuilderProvider(), signer);
|
||||||
boolean valid;
|
boolean valid;
|
||||||
if (signer.getKeyID() != signee.getKeyID()) {
|
if (signer.getKeyID() == signee.getKeyID() || signature.getSignatureType() == PGPSignature.DIRECT_KEY) {
|
||||||
valid = signature.verifyCertification(signer, signee);
|
|
||||||
} else {
|
|
||||||
valid = signature.verifyCertification(signee);
|
valid = signature.verifyCertification(signee);
|
||||||
|
} else {
|
||||||
|
valid = signature.verifyCertification(signer, signee);
|
||||||
}
|
}
|
||||||
if (!valid) {
|
if (!valid) {
|
||||||
throw new SignatureValidationException("Signature is not correct.");
|
throw new SignatureValidationException("Signature is not correct.");
|
||||||
|
|
|
@ -23,7 +23,7 @@ To start using pgpainless-sop in your code, include the following lines in your
|
||||||
...
|
...
|
||||||
dependencies {
|
dependencies {
|
||||||
...
|
...
|
||||||
implementation "org.pgpainless:pgpainless-sop:1.4.4"
|
implementation "org.pgpainless:pgpainless-sop:1.4.5"
|
||||||
...
|
...
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@ dependencies {
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.pgpainless</groupId>
|
<groupId>org.pgpainless</groupId>
|
||||||
<artifactId>pgpainless-sop</artifactId>
|
<artifactId>pgpainless-sop</artifactId>
|
||||||
<version>1.4.4</version>
|
<version>1.4.5</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
...
|
...
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
allprojects {
|
allprojects {
|
||||||
ext {
|
ext {
|
||||||
shortVersion = '1.4.5'
|
shortVersion = '1.4.5'
|
||||||
isSnapshot = true
|
isSnapshot = false
|
||||||
pgpainlessMinAndroidSdk = 10
|
pgpainlessMinAndroidSdk = 10
|
||||||
javaSourceCompatibility = 1.8
|
javaSourceCompatibility = 1.8
|
||||||
bouncyCastleVersion = '1.72'
|
bouncyCastleVersion = '1.72'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue