Commit Graph

51 Commits

Author SHA1 Message Date
Paul Schaub e390389c0a Reuse compliance 2021-10-07 16:28:31 +02:00
Paul Schaub 76a0a6479a
Remove unused OPS methods 2021-10-03 14:12:26 +02:00
Paul Schaub 0e1d6cb5a1
Rename DetachedSignature -> DetachedSignatureCheck 2021-10-03 13:47:20 +02:00
Paul Schaub 7bc35dcba3
Add regression test for PGPUtil.getDecoderStream mistaking plaintext for base64 encoded data 2021-10-01 15:21:42 +02:00
Paul Schaub f7a7035059
Workaround for PGPUtil accidentally mistaking plain data for base64 encoded data. 2021-10-01 15:04:37 +02:00
Paul Schaub 8ec8a55f10
Add ConsumerOptions.setIgnoreMDCErrors()
This method can be used to make PGPainless ignore certain MDC related errors or mishabits.
Use of this options is discouraged, but may come in handy in some situations.

Fixes #190
2021-10-01 13:54:51 +02:00
Paul Schaub 1aa6541766 Merge branch 'key_generator_rework' 2021-09-20 14:50:02 +02:00
Paul Schaub ce645fc429
Postpone decryption of PKESK if secret key passphrase is missing and try next PKESK first before passphrase retrieval using callback
Fixes #186
2021-09-15 16:33:03 +02:00
Paul Schaub 21f424551b Simplify KeySpecBuilder 2021-09-13 19:46:18 +02:00
Paul Schaub 90a00e0541 Move signature verification to dedicated streams 2021-09-07 14:02:07 +02:00
Paul Schaub ba0e5eb3fe
Improve readability of DecryptionStreamFactory 2021-09-06 17:15:17 +02:00
Paul Schaub e81ee648d8
Clean DecryptionStream: We only ever have one IntegrityProtectedInputStream at most 2021-09-06 15:14:13 +02:00
Paul Schaub 97c8ff8312
Throw WrongConsumingMethodException when processing Cleartext Signed Messages with Inband Signature verification API and vice versa 2021-08-29 13:35:27 +02:00
Paul Schaub 1124c6fd15 Wip: Configure logback logging 2021-08-26 15:03:20 +02:00
Paul Schaub 200e00990b Remove unused class and move detached sig initialization in own method 2021-08-23 14:27:02 +02:00
Paul Schaub 829068d5a8 Switch from JUL logging to SLF4J 2021-08-23 14:20:25 +02:00
Paul Schaub 5a9b8a2c50
Verify notBefore and notAfter on any message signatures 2021-08-18 12:55:24 +02:00
Paul Schaub 099b160656
Native support for notBefore and notAfter signature creation time constraints 2021-08-17 14:47:07 +02:00
Paul Schaub e5b15fe0c2 Use String-formatting in Logger statements 2021-08-15 15:46:41 +02:00
Paul Schaub fb16db5db4
Improve handling of signatures with missing issuerKeyId packets 2021-07-31 22:24:39 +02:00
Paul Schaub 107e53c03e
Fully drain ArmoredInputStreams to verify CRC checksum.
Fixes #159 (for real this time)
2021-07-27 15:09:59 +02:00
Paul Schaub 8cf5347b52 Base PGPainlessCLI on new sop-java module
* Rename pgpainless-sop -> pgpainless-cli
* Introduce sop-java (implementation-independent SOP API)
* Introduce sop-java-picocli (CLI frontend for sop-java)
* Introduce pgpainless-sop (implementation of sop-java using PGPainless)
* Rework pgpainless-cli (plugs pgpainless-sop into sop-java-picocli)
2021-07-15 17:03:56 +02:00
Paul Schaub 6a90c4303e
OpenPgpMetadat: identify verified sigs by SubkeyIdentifier 2021-07-04 13:08:24 +02:00
Paul Schaub 715d055b41
Add documentation and deprecate old methods 2021-06-15 17:56:36 +02:00
Paul Schaub 8f425cd31d
Fix parsing of non-OpenPGP messages when handling detached signatures 2021-06-15 17:35:58 +02:00
Paul Schaub 70c4dcd1d2
Begin introducing new Decryption API 2021-06-15 17:08:40 +02:00
Paul Schaub 13c7572c8c
Restore functionality of MissingPublicKeyCallback + JUnit test it 2021-05-29 12:19:12 +02:00
Paul Schaub ea03c66400
Throw MissingDecryptionMethodException when missing decryption key or -passphrase 2021-05-28 23:20:25 +02:00
Paul Schaub 197cfab0d6
Respect symmetric algorithm policy during decryption and throw UnacceptableAlgorithmException if policy is violated 2021-05-17 13:47:46 +02:00
Paul Schaub 5a56949dd7
Throw WrongPassphraseException when wrong passphrase is provided to unlock secret key 2021-05-14 13:18:34 +02:00
Paul Schaub 64cc9ecca4 Proper Signature Verification 2021-04-30 09:49:19 +02:00
Paul Schaub 6ee8a9416f
Prevent decryption of messages using SED instead of SEIP packets and create dedicated exceptions for MDC related errors 2021-04-27 12:27:25 +02:00
Paul Schaub 2c4a3fca6a
Introduce OpenPgpMetadata.FileInfo class for setting/getting file name, mod date, encoding... 2021-04-25 00:28:48 +02:00
Paul Schaub 81393a7285
Abort decryption process at a depth of 16 nested packets 2021-02-19 21:37:54 +01:00
Paul Schaub ea89289852
Check MDC when stream is closed 2021-02-17 21:04:05 +01:00
Paul Schaub d2a581de9b
Fix decryption of messages with Wildcard recipient
Fixes #76
2021-02-17 20:20:10 +01:00
Paul Schaub 506a8b18af
Reject NULL encryption algorithm when decrypting messages
Fixes #77
2021-02-17 20:07:54 +01:00
Paul Schaub 63bf5a8e69
Add support for decryption with hidden recipients 2021-01-09 16:16:17 +01:00
Paul Schaub 1c1f9d49ab
Introduce ImplementationFactory 2020-12-27 01:56:18 +01:00
Paul Schaub c7ede0fc8a
Add junit test for symmetric decryption 2020-12-26 23:36:33 +01:00
Paul Schaub 7d374f10a7
Allow encryption and decryption using symmetric passphrases in the main API 2020-12-26 19:04:27 +01:00
Paul Schaub ff8c6d8b6d Fix NPE when signing key is not found during signature verification 2020-12-16 20:11:45 +01:00
Paul Schaub 65b670740e Add support for detached signatures 2020-08-24 14:56:42 +02:00
Paul Schaub 2902c81b6c
Simplify integrity protection assignment of resultBuilder 2020-01-10 18:31:27 +01:00
Paul Schaub dd976b7319
Add hint about mutli assignment 2020-01-10 18:30:48 +01:00
Paul Schaub db09a0ffbe
First Refactoring of DecryptionStreamFactory 2020-01-10 17:12:13 +01:00
Paul Schaub 530a22ba0e
Improve tests and add signatures to result 2020-01-10 15:12:04 +01:00
Florian Schmaus 8abea678ca Tune down the INFO logging, use debug log level where sensible
Libraries should usually stay silent if everything works as
expected. Most of the INFO log levels call sites of pgpainless
actually are more of debug log level call sites. Hence this commit
changes most of them to use a debug log level.
2019-04-18 08:19:19 +02:00
Paul Schaub b89d3562ac
Add @Nullable, @Nonnull annotations through findbugs 2018-07-31 20:09:16 +02:00
Paul Schaub 9017fcaba0
Rename PainlessResult -> OpenPpgMetadata 2018-07-23 16:23:23 +02:00