- 
                Notifications
    
You must be signed in to change notification settings  - Fork 39
 
Description
Problem
I tried to use sequoia-chameleon-gnupg as a drop-in replacement for GnuPG.
python-gnupg tries to detect the gpg version before doing anything. Unfortunately, the regex for that is too restrictive:
https://github.com/vsajip/python-gnupg/blob/master/gnupg.py#L1019
VERSION_RE = re.compile(r'gpg \(GnuPG(?:/MacGPG2)?\) (\d+(\.\d+)*)'.encode('ascii'), re.I)Example output from gpg-sq:
gpg (GnuPG-compatible Sequoia Chameleon) 2.2.40
Sequoia gpg Chameleon 0.2.0
sequoia-openpgp 1.13.0
[…]
After patching the regex, my encryption smoke test went fine.
Preferred solution
Not sure where this should be fixed, at first glance gpg-sq's name is acceptable and the regex on the python-gnupg side should be relaxed. What is your opinion? Should i create an issue with the python-gnupg project?
Yeah, good question. So in the first line of the output, I'd very much mention that we are not GnuPG to reduce the risk of confusion in bug reports and such. At the same time, we are likely going to see this kind of version check or sanity check everywhere. In fact, I changed the version string we print to be more like GnuPG in the past.
I'd like the regex in python-gnupg be relaxed. In fact, if you propose a change there, please ask them to use the machine readable interface to check for the version:$ gpg --list-config --with-colons | grep cfg:version: cfg:version:2.2.40
Alternative solutions
The bare minimum would be to add gpg-sq to the regex.
References
Original issue on sequoia-chameleon-gnupg: https://gitlab.com/sequoia-pgp/sequoia-chameleon-gnupg/-/issues/14