You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Kotlin decryption. Test decryption errors after moving to use PGPainless for the message decryption #1360
It would be nice to have such tests. I think it's very important to prevent security bugs (for example after upgrading PGPainless to a newer version). We should be sure that a received content is parsed to expected blocks and Android shows the expected UI.
Yes. All error scenarios that are interesting are represented in flowcrypt.compatibility account as email messages, so we can extract them from there (as you have done)
tests/decrypt error label should have most of them. If you see any that are (expected) errors and not labeled that way, feel free to add the label, so that they are all in one place.
changed the title [-]Test decryption errors after moving to use PGPainless for the message decryption[/-][+]Kotlin decryption. Test decryption errors after moving to use PGPainless for the message decryption[/+]on Sep 17, 2021
tests/decrypt error label should have most of them. If you see any that are (expected) errors and not labeled that way, feel free to add the label, so that they are all in one place.
For now, I see the following decryption errors
1. WRONG CHECKSUM - Message is either badly formatted or not compatible with FlowCrypt
2. NO_MDC - Security threat. The message is missing integrity checks (MDC)
3. BAD_MDC - Security threat. Opening this message is dangerous because it was modified in transit
4. KEY_MISMATCH - Message encrypted for public keys that don't match(An active account doesn't have a right private key). A message encrypted for another public key (only one public key used, the sender public key)
5. FORMAT - take any armored message, remove some lines from the middle, and then try to read it.
OTHER - when it throws some exception we don't recognize.
It's all good for now. For the mdc checks missing/wrong, eventually we'll show the content of the decrypted message instead of the armor, but that is already filed for later #1363 (comment)
You can extract message with subject encrypted - MDC hash mismatch - modification detected - should fail from compatibility account
it requires adding keys(with a passphrase) of flowcrypt.compatibility to the Android emulator. I don't like that idea. The best would be to create a PGP message with BAD_MDC for flowcrypt.test accounts. If it sounds too difficult I think we can leave it as is(or for later). We handle BAD_MDC via JUnit tests(PGPainless). On Android(Instrumentation tests with UI), we have tests for all decryption errors, except BAD_MDC(we handle it, but don't have a UI test)
Activity
DenBond7 commentedon Jul 22, 2021
I'm talking about things like this one
DenBond7 commentedon Jul 22, 2021
@tomholub It would be nice to create a list of the decryption errors that we would like to handle. I think it will be useful for all platforms
tomholub commentedon Jul 22, 2021
Yes. All error scenarios that are interesting are represented in flowcrypt.compatibility account as email messages, so we can extract them from there (as you have done)
tomholub commentedon Jul 22, 2021
tests/decrypt errorlabel should have most of them. If you see any that are (expected) errors and not labeled that way, feel free to add the label, so that they are all in one place.[-]Test decryption errors after moving to use PGPainless for the message decryption[/-][+]Kotlin decryption. Test decryption errors after moving to use PGPainless for the message decryption[/+]DenBond7 commentedon Sep 23, 2021
For now, I see the following decryption errors
tomholub commentedon Sep 23, 2021
5 and 6 are the same thing - should be returning KEY_MISMATCH error
Also there is FORMAT error - take any armored message, remove some lines from the middle, and then try to read it.
This one doesn't really sound like an error.
DenBond7 commentedon Sep 23, 2021
Updated
tomholub commentedon Sep 23, 2021
On browser extension I also have "other" when it throws some exception I don't recognize.
tomholub commentedon Sep 23, 2021
I suppose you have something similar
DenBond7 commentedon Sep 23, 2021
Updated
DenBond7 commentedon Sep 24, 2021
@tomholub Please look at the following screenshots. Do they look good?
WRONG CHECKSUM
NO_MDC
BAD_MDC
KEY_MISMATCH
FORMAT
tomholub commentedon Sep 24, 2021
It's all good for now. For the mdc checks missing/wrong, eventually we'll show the content of the decrypted message instead of the armor, but that is already filed for later #1363 (comment)
else good
Renamed some methods.| #1360
Updated .docker-mailserver/maildata_source. Added new keys to test NO…
Updated flowcrypt/flowcrypt-email-server to 0.0.6.| #1360
DenBond7 commentedon Sep 25, 2021
@tomholub Do you know how to reproduce this error? I need to have it for flowcrypt.test
DenBond7 commentedon Sep 25, 2021
For history. To reproduce this error we can use an old version of GnuPG. For example GnuPG 1.4
via
gpg --encrypt --sign --armor --disable-mdc -r fingerprintwe can create a PGP message without MDC like this oneI've used the following link to set up GnuPG on docker
tomholub commentedon Sep 25, 2021
You can extract message with subject
encrypted - MDC hash mismatch - modification detected - should failfrom compatibility accounttomholub commentedon Sep 25, 2021
NO_MDC is different from BAD_MDC. First case there is no checksum, in second case there is checksum but it's wrong.
Added a test for NO_MDC.| #1360
DenBond7 commentedon Sep 25, 2021
it requires adding keys(with a passphrase) of
flowcrypt.compatibilityto the Android emulator. I don't like that idea. The best would be to create a PGP message with BAD_MDC forflowcrypt.testaccounts. If it sounds too difficult I think we can leave it as is(or for later). We handleBAD_MDCviaJUnittests(PGPainless). On Android(Instrumentation tests with UI), we have tests for all decryption errors, exceptBAD_MDC(we handle it, but don't have a UI test)tomholub commentedon Sep 25, 2021
sounds ok to me to leave it for now
Issue 1360 decryption errors tests (#1481)