rnpgp / rnp

RNP: high performance C++ OpenPGP library used by Mozilla Thunderbird
https://www.rnpgp.org
Other
192 stars 54 forks source link

Possible rare incompatibility with GnuPG during symmetric decryption. #1379

Open ni4 opened 3 years ago

ni4 commented 3 years ago

Description

Encryption cli test failed once with the following log:

2021-01-08T16:35:03.3109500Z /Users/runner/work/rnp/rnp/builds/rnp-build/src/rnp/rnp --homedir /var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/rnpctmphpe5v797/.rnp --pass-fd 4 --decrypt /var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/rnpctmphpe5v797/cleartext.gpg --output /var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/rnpctmphpe5v797/cleartext.rnp
2021-01-08T16:35:03.3110820Z 
2021-01-08T16:35:03.3111020Z 
2021-01-08T16:35:03.3113260Z /tmp/rnp-local-installs/gpg-install/bin/gpg --homedir /var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/rnpctmphpe5v797/.gpg -c --cipher-algo blowfish -z 9 --s2k-count 65536 --batch --passphrase password --output /var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/rnpctmphpe5v797/cleartext.gpg /var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/rnpctmphpe5v797/cleartext.txt
2021-01-08T16:35:03.3114790Z 
2021-01-08T16:35:03.3114970Z 
2021-01-08T16:35:03.3116990Z /Users/runner/work/rnp/rnp/builds/rnp-build/src/rnp/rnp --homedir /var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/rnpctmphpe5v797/.rnp --pass-fd 4 --decrypt /var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/rnpctmphpe5v797/cleartext.gpg --output /var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/rnpctmphpe5v797/cleartext.rnp
2021-01-08T16:35:03.3118320Z 
2021-01-08T16:35:03.3118520Z 
2021-01-08T16:35:03.3121000Z /tmp/rnp-local-installs/gpg-install/bin/gpg --homedir /var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/rnpctmphpe5v797/.gpg --armor -c --cipher-algo blowfish -z 9 --s2k-count 65536 --batch --passphrase password --output /var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/rnpctmphpe5v797/cleartext.gpg /var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/rnpctmphpe5v797/cleartext.txt
2021-01-08T16:35:03.3122740Z gpg: cipher_encrypt: key not set
2021-01-08T16:35:03.3123210Z gpg: cipher_encrypt: key not set
2021-01-08T16:35:03.3123670Z gpg: cipher_encrypt: key not set
2021-01-08T16:35:03.3124120Z gpg: cipher_encrypt: key not set
2021-01-08T16:35:03.3124420Z 
2021-01-08T16:35:03.3126760Z /Users/runner/work/rnp/rnp/builds/rnp-build/src/rnp/rnp --homedir /var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/rnpctmphpe5v797/.rnp --pass-fd 4 --decrypt /var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/rnpctmphpe5v797/cleartext.gpg --output /var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/rnpctmphpe5v797/cleartext.rnp
2021-01-08T16:35:03.3129010Z [encrypted_decrypt_cfb_header() /Users/runner/work/rnp/rnp/src/librepgp/stream-parse.cpp:1305] checksum check failed
2021-01-08T16:35:03.3130580Z [init_encrypted_src() /Users/runner/work/rnp/rnp/src/librepgp/stream-parse.cpp:2087] failed to obtain decrypting key or password
2021-01-08T16:35:03.3131220Z 
2021-01-08T16:35:03.3131490Z ERROR
2021-01-08T16:35:03.3132590Z test_sym_encryption__rnp_aead (__main__.Encryption) ... /tmp/rnp-local-installs/gpg-install/bin/gpg --version
2021-01-08T16:35:03.3133150Z 
2021-01-08T16:35:03.3133450Z gpg (GnuPG) 2.2.24
2021-01-08T16:35:03.3133790Z libgcrypt 1.8.7
2021-01-08T16:35:03.3134270Z Copyright (C) 2020 Free Software Foundation, Inc.
2021-01-08T16:35:03.3134990Z License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>
2021-01-08T16:35:03.3135750Z This is free software: you are free to change and redistribute it.
2021-01-08T16:35:03.3136400Z There is NO WARRANTY, to the extent permitted by law.

Exception/trace:

2021-01-08T16:35:03.5200320Z ======================================================================
2021-01-08T16:35:03.5200830Z ERROR: test_sym_encryption__gpg_to_rnp (__main__.Encryption)
2021-01-08T16:35:03.5201860Z ----------------------------------------------------------------------
2021-01-08T16:35:03.5202440Z Traceback (most recent call last):
2021-01-08T16:35:03.5203110Z   File "/Users/runner/work/rnp/rnp/src/tests/cli_tests.py", line 1896, in test_sym_encryption__gpg_to_rnp
2021-01-08T16:35:03.5203810Z     rnp_sym_encryption_gpg_to_rnp(size, cipher, z)
2021-01-08T16:35:03.5204510Z   File "/Users/runner/work/rnp/rnp/src/tests/cli_tests.py", line 606, in rnp_sym_encryption_gpg_to_rnp
2021-01-08T16:35:03.5205140Z     rnp_decrypt_file(dst, dec)
2021-01-08T16:35:03.5205740Z   File "/Users/runner/work/rnp/rnp/src/tests/cli_tests.py", line 308, in rnp_decrypt_file
2021-01-08T16:35:03.5206780Z     raise_err('rnp decryption failed', out + err)
2021-01-08T16:35:03.5207420Z   File "/Users/runner/work/rnp/rnp/src/tests/cli_common.py", line 35, in raise_err
2021-01-08T16:35:03.5208170Z     raise CLIError(msg, log)
2021-01-08T16:35:03.5208760Z cli_common.CLIError: <unprintable CLIError object>
dkg commented 3 years ago

For future failures like this, it would be great to include a copy of the artifacts produced, and a description of the environment (platform, etc) that produced them.

ni4 commented 3 years ago

@dkg thanks, filed an issue. This should be easier now with GHA.