Paul Schaub
3f8653cf2e
Fix CRCing test and fully depend on new stream for decryption
2022-11-23 20:40:40 +01:00
Paul Schaub
977f8c4101
Rename automaton package to syntax_check
2022-11-23 20:40:40 +01:00
Paul Schaub
a27c0ff36e
Add detailled logging to OpenPgpMessageInputStream
2022-11-23 20:40:40 +01:00
Paul Schaub
a9993fd866
Throw UnacceptableAlgEx for unencrypted encData
2022-11-23 20:40:40 +01:00
Paul Schaub
3d5916c545
Implement custom decryptor factories in pda
2022-11-23 20:40:40 +01:00
Paul Schaub
a39c6bc881
Identify custom decryptor factories by subkey id
2022-11-23 20:40:40 +01:00
Paul Schaub
cfd3f77491
Make map final
2022-11-23 20:40:40 +01:00
Paul Schaub
228918f96b
Change HardwareSecurity DecryptionCallback to emit key-id
2022-11-23 20:40:40 +01:00
Paul Schaub
529c64cf43
Implement exploratory support for custom decryption factories
...
This may enable decryption of messages with hardware-backed keys
2022-11-23 20:40:40 +01:00
Paul Schaub
d39d062a0d
WIP: Explore Hardware Decryption
2022-11-23 20:40:40 +01:00
Paul Schaub
7da34c8329
Work on postponed keys
2022-11-23 20:40:40 +01:00
Paul Schaub
d3f07a2250
Reuse *SignatureCheck class
2022-11-23 20:40:40 +01:00
Paul Schaub
dfbb01d61c
Enfore max recursion depth and fix CRC test
2022-11-23 20:40:40 +01:00
Paul Schaub
7097d44916
Fix NPEs and expose decryption keys
2022-11-23 20:40:40 +01:00
Paul Schaub
6fd705b1dc
Fix checkstyle issues
2022-11-23 20:40:40 +01:00
Paul Schaub
fbcde13df3
Reinstate integrity-protection and fix tests
...
Integrity Protection is now checked when reading from the stream,
not only when closing.
2022-11-23 20:40:40 +01:00
Paul Schaub
654493dfcc
Properly expose signatures
2022-11-23 20:40:40 +01:00
Paul Schaub
a9f77ea100
Cleaning up and collect signature verifications
2022-11-23 20:40:40 +01:00
Paul Schaub
43c369f1f9
It was the buffering.
2022-11-23 20:40:40 +01:00
Paul Schaub
bdc968dd43
Create TeeBCPGInputStream to move teeing logic out of OpenPgpMessageInputStream
2022-11-23 20:40:40 +01:00
Paul Schaub
e420678076
2/3 the way to working sig verification
2022-11-23 20:40:40 +01:00
Paul Schaub
5e37d8038a
WIP: So close to working notarizations
2022-11-23 20:40:39 +01:00
Paul Schaub
18b1fadeb6
Suppress DefaultCharset warning
2022-11-23 20:40:03 +01:00
Paul Schaub
2ce4486e89
Convert links in javadoc to html
2022-11-23 20:40:03 +01:00
Paul Schaub
527aab922e
Fix ModificationDetectionException by not calling PGPUtil.getDecoderStream()
2022-11-23 20:40:03 +01:00
Paul Schaub
ec28ba2924
SIGNATURE VERIFICATION IN OPENPGP SUCKS BIG TIME
2022-11-23 20:40:03 +01:00
Paul Schaub
4e44691ef6
Wip
2022-11-23 20:40:03 +01:00
Paul Schaub
45555bf82d
Wip: Work on OPS verification
2022-11-23 20:40:03 +01:00
Paul Schaub
e25f6e1712
Fix checkstyle issues
2022-11-23 20:40:03 +01:00
Paul Schaub
5c93eb3705
Wip: Introduce MessageMetadata class
2022-11-23 20:40:03 +01:00
Paul Schaub
efdf2bca0d
WIP: Play around with TeeInputStreams
2022-11-23 20:40:03 +01:00
Paul Schaub
7537c9520c
WIP: Add LayerMetadata class
2022-11-23 20:40:03 +01:00
Paul Schaub
54d7d0c7ae
Implement experimental signature verification (correctness only)
2022-11-23 20:40:03 +01:00
Paul Schaub
9366700895
Add read(b,off,len)
2022-11-23 20:40:03 +01:00
Paul Schaub
7b9db97212
Clean close() method
2022-11-23 20:40:03 +01:00
Paul Schaub
0753f4d38a
Work on getting signature verification to function again
2022-11-23 20:40:03 +01:00
Paul Schaub
d81c0d4400
Fix tests
2022-11-23 20:40:02 +01:00
Paul Schaub
e86062c427
WIP: Replace nesting with independent instancing
2022-11-23 20:40:02 +01:00
Paul Schaub
bf8949d7f4
WIP: Implement custom PGPDecryptionStream
2022-11-23 20:40:02 +01:00
Paul Schaub
bc73d26118
Add Pushdown Automaton for checking OpenPGP message syntax
...
The automaton implements what is described in
https://github.com/pgpainless/pgpainless/blob/main/misc/OpenPGPMessageFormat.md
However, some differences exist to adopt it to BouncyCastle
Part of #237
2022-11-23 20:40:02 +01:00
Paul Schaub
609bb4556a
Use ImplementationFactory.getSessionKeyDataDecryptorFactory() method
2022-09-13 20:26:13 +02:00
Paul Schaub
31c4570d10
Move finalization of signatures into own method
2022-09-07 13:48:59 +02:00
Paul Schaub
0bafc410a0
Add missing parseAndCombineSignatures call
...
For some reason this was missing from the single-byte read() method
of the SignatureInputStream, causing issues if draining the stream
byte by byte
2022-09-05 15:41:58 +02:00
Paul Schaub
bc24c4626a
Add ConsumerOptions.get() factory method
2022-08-29 13:00:50 +02:00
Paul Schaub
0c28c7a389
symmetrically encrypted messages are still encrypted
2022-06-23 11:46:19 +02:00
Paul Schaub
75455f1a3c
Add OpenPgpMetadata.isCleartextSigned and use it in sop to determine if message was cleartext signed
2022-06-19 17:31:48 +02:00
Paul Schaub
2d60650cc6
Progress on SOP04 support
2022-06-19 16:59:42 +02:00
Paul Schaub
64a50266f1
Test for detection of uncompressed, signed messages, and improve decryption of seip messages
2022-05-05 12:43:44 +02:00
Paul Schaub
826331917f
Add comments to unexhaustive parsing method
2022-05-05 11:15:19 +02:00
Paul Schaub
69f84f24b6
Implement heavy duty packet inspection to figure out nature of data
2022-05-04 20:55:29 +02:00
Paul Schaub
230725f6ff
Add option to force handling of data as non-openpgp
2022-04-22 21:33:13 +02:00
Paul Schaub
46f69b9fa5
Introduce OpenPgpInputStream to distinguish between armored, binary and non-OpenPGP data
2022-04-22 20:53:44 +02:00
Paul Schaub
58dee0d970
Fix javadoc warnings
2022-04-02 18:56:05 +02:00
Paul Schaub
e8b03834cb
Annotate fromId(code) methods with Nullable and add Nonnull requireFromId(code) methods
2022-03-22 15:09:09 +01:00
Paul Schaub
1753cef10e
Simplify handling of cleartext-signed data
2022-02-23 18:45:29 +01:00
Paul Schaub
a3f9311d9a
Add some comments to messy DecryptionStreamFactory code
2022-02-19 14:48:17 +01:00
Paul Schaub
e8da3b30d8
Yet another patch for ASCII armor detection -.-
2022-02-15 14:23:03 +01:00
Paul Schaub
f3cf3456ab
ConsumerOptions.setIsCleartextSigned -> return this
2022-02-15 14:22:57 +01:00
Paul Schaub
458b4f1f78
Fix detection of unarmored data in detached signature verification
2022-02-11 14:07:29 +01:00
Paul Schaub
b1bde161b4
Fix typos and wording
2021-12-28 13:53:25 +01:00
Paul Schaub
ce7b69269b
Various code cleanup
2021-12-28 13:32:50 +01:00
Paul Schaub
59f1a85887
Fix more code issues
2021-12-28 12:30:52 +01:00
Paul Schaub
a66b45c3d2
Further sourcing of PGPObjectFactory from ImplementationProvider
2021-12-14 15:03:45 +01:00
Paul Schaub
bff2b3fbfe
Clarify nesting depth exceeded error message
2021-12-14 13:14:56 +01:00
Paul Schaub
5108b81252
Add test to ensure PGPainless will refuse to decrypt message with incapable key
2021-12-13 12:43:08 +01:00
Paul Schaub
80e12db8b6
Prevent message decryption using non-encryption key
2021-12-13 12:27:32 +01:00
Paul Schaub
710f676dc3
Rename MAX_RECURSION_DEPTH constant to avoid confusion
2021-12-13 01:03:20 +01:00
Paul Schaub
c55fd2e552
Implement decryption with - and access of session keys
2021-12-02 12:42:02 +01:00
Paul Schaub
16e283f3a6
Fix unvalid cursor mark for large cleartext signed messages
...
Fixes #219 , #220
2021-11-24 14:51:16 +01:00
Paul Schaub
352f099d8a
Refactoring: Move signature verification stuff to consumer subpacket
2021-11-16 13:40:33 +01:00
Paul Schaub
59c9ec341e
Hide distinction between clearsigned and inline signed message verification
2021-11-02 12:12:29 +01:00
Paul Schaub
bd67d9c0fa
Rename EncryptionPurpose.STORAGE_AND_COMMUNICATION -> ANY
2021-11-02 11:30:44 +01:00
Paul Schaub
cf1881a140
Fix detection of non-armored data
2021-10-30 15:00:04 +02:00
Paul Schaub
3a9473ad6c
V5 Key-readyness: Replace usages of OpenPgpV4Fingerprint with abstract super class
2021-10-27 17:38:25 +02:00
Paul Schaub
bc2afea7ed
Add toString() methods for SignatureVerification & failure
2021-10-27 17:11:40 +02:00
Paul Schaub
aed06fc832
Add MessageInspector.determineEncryptionInfo(String)
2021-10-27 15:54:34 +02:00
Paul Schaub
5c3fa28946
Fix Kleopatra Interoperability
...
The cause of this issue was that we skipped the first (proper) PKESK and instead tried to decrypt
the wildcard PKESKs.
Furthermore, we had an issue in MessageInspector which read past the PKESK packets
2021-10-27 13:26:49 +02:00
Paul Schaub
963a8170da
Fix decryption of signed messages created with PGPainless < 0.2.10
2021-10-23 16:44:40 +02:00
Paul Schaub
f05be3dc30
Fix prematurely throwing of MissingPassphraseException
2021-10-19 18:13:23 +02:00
Paul Schaub
dc0b96278e
Add javadoc
2021-10-18 16:19:12 +02:00
Paul Schaub
2ad917d27c
Add ConsumerOptions.setMissingKeyPassphraseStrategy()
...
This allows switching missing passphrase handling from interactive mode
(fire callbacks to prompt user for missing key passphrases) to non-interactive mode
(throw MissingPassphraseException with all keys with missing passphrase in it).
Fixes #193
2021-10-18 16:01:19 +02:00
Paul Schaub
4e16cf13c5
Remove unused subclass
2021-10-12 15:31:38 +02:00
Paul Schaub
33f516efe8
Fix detection of signed messages when verification keys are missing
...
Fixes #187 , supersedes #189
2021-10-08 14:03:12 +02:00
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
5869996059
Add isSignedOnly() to MessageInspector
...
This method can be used to determine, whether the message was created using gpg --sign --armor.
It will return false if the message is signed and encrypted, since we cannot determine signed status while the message is encrypted.
Fixes #188
2021-10-01 14:12:10 +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
ece5897bae
CleartextSignedMessage processing: Reuse normal processing API
2021-09-27 11:47:54 +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
81379a5176
Add MessageInspector utility class which can be used to determine encryption keys for a message
2021-09-14 21:49:02 +02:00
Paul Schaub
21f424551b
Simplify KeySpecBuilder
2021-09-13 19:46:18 +02:00
Paul Schaub
0a45f4de9e
Add documentation to SignatureVerification class
2021-09-13 18:18:50 +02:00
Paul Schaub
f28232893c
Refactoring: Move cleartext signed message processing to decryption_verification
2021-09-13 18:09:53 +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