mirror of
https://github.com/pgpainless/pgpainless.git
synced 2024-11-06 04:26:00 +01:00
Throw UnacceptableAlgEx for unencrypted encData
This commit is contained in:
parent
0d62cea8a5
commit
8fb8aa1a30
1 changed files with 6 additions and 1 deletions
|
@ -480,7 +480,10 @@ public class OpenPgpMessageInputStream extends DecryptionStream {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean decryptPKESKAndStream(SubkeyIdentifier subkeyIdentifier, PublicKeyDataDecryptorFactory decryptorFactory, PGPPublicKeyEncryptedData pkesk) throws IOException {
|
private boolean decryptPKESKAndStream(SubkeyIdentifier subkeyIdentifier,
|
||||||
|
PublicKeyDataDecryptorFactory decryptorFactory,
|
||||||
|
PGPPublicKeyEncryptedData pkesk)
|
||||||
|
throws IOException, UnacceptableAlgorithmException {
|
||||||
try {
|
try {
|
||||||
InputStream decrypted = pkesk.getDataStream(decryptorFactory);
|
InputStream decrypted = pkesk.getDataStream(decryptorFactory);
|
||||||
SessionKey sessionKey = new SessionKey(pkesk.getSessionKey(decryptorFactory));
|
SessionKey sessionKey = new SessionKey(pkesk.getSessionKey(decryptorFactory));
|
||||||
|
@ -495,6 +498,8 @@ public class OpenPgpMessageInputStream extends DecryptionStream {
|
||||||
IntegrityProtectedInputStream integrityProtected = new IntegrityProtectedInputStream(decrypted, pkesk, options);
|
IntegrityProtectedInputStream integrityProtected = new IntegrityProtectedInputStream(decrypted, pkesk, options);
|
||||||
nestedInputStream = new OpenPgpMessageInputStream(buffer(integrityProtected), options, encryptedData, policy);
|
nestedInputStream = new OpenPgpMessageInputStream(buffer(integrityProtected), options, encryptedData, policy);
|
||||||
return true;
|
return true;
|
||||||
|
} catch (UnacceptableAlgorithmException e) {
|
||||||
|
throw e;
|
||||||
} catch (PGPException e) {
|
} catch (PGPException e) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue