pqc-thunderbird / rnp

Manual clone of the repository https://github.com/rnpgp/rnp
Other
0 stars 0 forks source link

when encrypting to a key with both a traditional v4 and PQC v4 encryption subkey, the traditional key is chosen #65

Closed falko-strenzke closed 7 months ago

falko-strenzke commented 7 months ago

created a key v4 key (choice '24' in the text UI):

sec   255/EdDSA 4b81f950dd8ae3ca 2024-04-24 [SC] [EXPIRES 2026-04-24]
      02435b9c335071704baa34184b81f950dd8ae3ca
uid           EdDSA 255-bit key <fstrenzke@localhost>
ssb   255/ECDH 9c38bf496cbee255 2024-04-24 [E] [EXPIRES 2026-04-24]
      0a66788bb8a2ac41c8a99dbd9c38bf496cbee255
ssb   9728/ML-KEM-768+X25519 2c38063dd6938ce3 2024-04-24 [E] [EXPIRES 2026-04-24]
      cada41b950c5d8363eda3e582c38063dd6938ce3

then encrypting to the primary key:

❯ ./src/rnp/rnp --encrypt --sign -r 4b81f950dd8ae3ca --armor Makefile

causes the ECDH encryption subkey to be used.

In this case, however, the PQC key should be prefered.

falko-strenzke commented 7 months ago

Just a note for test dev. Code for parsing out the subkey id from the output

            pqc_enc_subkey_match = re.search(r'ssb * [0-9]+/ML-KEM-[0-9]+\+[^ ]* *([0-9a-fA-F]+)', output)
            if pqc_enc_subkey_match:
                pqc_subkey_ids.append(pqc_enc_subkey_match.group(1))
                print("appended  found PQC subkey id = " + str(pqc_subkey_ids[-1]))
            else:
                pqc_subkey_ids.append(None)
falko-strenzke commented 7 months ago

fixed by #68