mirror of
https://codeberg.org/PGPainless/sop-java.git
synced 2025-09-14 12:49:44 +02:00
Compare commits
3 commits
Author | SHA1 | Date | |
---|---|---|---|
3c974e1aa2 | |||
39ccac8623 | |||
239c7ac853 |
4 changed files with 12 additions and 11 deletions
|
@ -6,6 +6,9 @@ SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## 6.0.1
|
||||||
|
- `decrypt`: Do not throw `NoSignature` exception if `--verify-with` was provided, but `VERIFICATIONS` is empty
|
||||||
|
|
||||||
## 6.0.0
|
## 6.0.0
|
||||||
- Update implementation to [SOP Specification revision 06](https://www.ietf.org/archive/id/draft-dkg-openpgp-stateless-cli-06.html).
|
- Update implementation to [SOP Specification revision 06](https://www.ietf.org/archive/id/draft-dkg-openpgp-stateless-cli-06.html).
|
||||||
- Add option `--profile=XYZ` to `encrypt` subcommand
|
- Add option `--profile=XYZ` to `encrypt` subcommand
|
||||||
|
|
|
@ -115,11 +115,6 @@ public class DecryptCmd extends AbstractSopCmd {
|
||||||
|
|
||||||
private void writeVerifyOut(DecryptionResult result) throws IOException {
|
private void writeVerifyOut(DecryptionResult result) throws IOException {
|
||||||
if (verifyOut != null) {
|
if (verifyOut != null) {
|
||||||
if (result.getVerifications().isEmpty()) {
|
|
||||||
String errorMsg = getMsg("sop.error.runtime.no_verifiable_signature_found");
|
|
||||||
throw new SOPGPException.NoSignature(errorMsg);
|
|
||||||
}
|
|
||||||
|
|
||||||
try (OutputStream fileOut = getOutput(verifyOut)) {
|
try (OutputStream fileOut = getOutput(verifyOut)) {
|
||||||
PrintWriter writer = new PrintWriter(fileOut);
|
PrintWriter writer = new PrintWriter(fileOut);
|
||||||
for (Verification verification : result.getVerifications()) {
|
for (Verification verification : result.getVerifications()) {
|
||||||
|
|
|
@ -21,6 +21,7 @@ import sop.operation.Decrypt;
|
||||||
import sop.util.HexUtil;
|
import sop.util.HexUtil;
|
||||||
import sop.util.UTCUtil;
|
import sop.util.UTCUtil;
|
||||||
|
|
||||||
|
import javax.annotation.Nonnull;
|
||||||
import java.io.BufferedReader;
|
import java.io.BufferedReader;
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
@ -246,15 +247,17 @@ public class DecryptCmdTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@ExpectSystemExitWithStatus(SOPGPException.NoSignature.EXIT_CODE)
|
public void assertNoVerificationsIsOkay() throws SOPGPException.CannotDecrypt, SOPGPException.MissingArg, SOPGPException.BadData, IOException {
|
||||||
public void assertNoSignatureExceptionCausesExit3() throws SOPGPException.CannotDecrypt, SOPGPException.MissingArg, SOPGPException.BadData, IOException {
|
File tempFile = File.createTempFile("verify-with-", ".tmp");
|
||||||
|
File verifyOut = new File(tempFile.getParent(), "verifications.out");
|
||||||
|
verifyOut.deleteOnExit();
|
||||||
when(decrypt.ciphertext((InputStream) any())).thenReturn(new ReadyWithResult<DecryptionResult>() {
|
when(decrypt.ciphertext((InputStream) any())).thenReturn(new ReadyWithResult<DecryptionResult>() {
|
||||||
@Override
|
@Override
|
||||||
public DecryptionResult writeTo(OutputStream outputStream) throws SOPGPException.NoSignature {
|
public DecryptionResult writeTo(@Nonnull OutputStream outputStream) throws SOPGPException.NoSignature {
|
||||||
throw new SOPGPException.NoSignature();
|
return new DecryptionResult(null, Collections.emptyList());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
SopCLI.main(new String[] {"decrypt"});
|
SopCLI.main(new String[] {"decrypt", "--verify-with", tempFile.getAbsolutePath(), "--verifications-out", verifyOut.getAbsolutePath()});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
allprojects {
|
allprojects {
|
||||||
ext {
|
ext {
|
||||||
shortVersion = '6.0.1'
|
shortVersion = '6.0.1'
|
||||||
isSnapshot = true
|
isSnapshot = false
|
||||||
minAndroidSdk = 10
|
minAndroidSdk = 10
|
||||||
javaSourceCompatibility = 1.8
|
javaSourceCompatibility = 1.8
|
||||||
gsonVersion = '2.10.1'
|
gsonVersion = '2.10.1'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue