rnpgp / rnp

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

Ambiguous naming of 3DES/TRIPLEDES algorithm #1533

Closed antonsviridenko closed 3 years ago

antonsviridenko commented 3 years ago

Description

3DES algorithm is defined in RNP header as https://github.com/rnpgp/rnp/blob/master/include/rnp/rnp.h#L2727 "TRIPLEDES", so if user wants to use this algorithm (weak and not recommended for modern use), option argument --cipher tripledes should be passed. But cli_tests source lists this algorithm as '3DES' in multiple places https://github.com/rnpgp/rnp/blob/master/src/tests/cli_tests.py#L1562

It does not make tests fail but most likely testing does not achieve intended purposes, 3DES algorithm is not selected but default symmetric algorithm is used instead.

Expected Behavior

Simplest way is just to rename '3DES' => 'TRIPLEDES' in cli_tests.py But I think it is better to have this algorithm available using both names, seems like '3DES' is used more frequently according to google results. Btw why it was named 'TRIPLEDES' in RNP sources in the first place?

ni4 commented 3 years ago

"Tripledes" most likely was used historically, not sure were it came from. I think we should not update FFI API with multiple value variants, i.e. keep strategy "one string - one algo". However we may add some function on CLI layer, like cli_normalize_feature_value(), which would check predefined dictionary and return value in the form which is used in FFI. I.e. "aes-128" -> "AES128", "3-DES" -> "TRIPLEDES", "3DES" -> "TRIPLEDES" and so on.