Open antonsviridenko opened 1 year ago
@antonsviridenko Could you please clarify why this may be needed? I do not remember when this was added, maybe there were some misunderstanding or so on. There is no GPG21 key store format: GnuPG has 2 ways of storing keys. Old format via plain pubring.gpg
/secring.gpg
(i.e. _GPG/_GPG) and a new one, with pubring.kbx
/private-keys-v1.d
(i.e. _KBX/_G10)
P.S. So, as for me, more correct solution would be to remove _GPG21
define from the codebase :)
P.S. So, as for me, more correct solution would be to remove _GPG21 define from the codebase :)
I agree
Description
Parameter description for
rnp_ffi_create()
says:so it is reasonable to assume that
should be accepted too. But CLI and test code replaces literal value "GPG21" passed as a keystore format to KBX for public and G10 for private instead, in these two places: https://github.com/rnpgp/rnp/blob/master/src/rnp/fficli.cpp#L1928 https://github.com/rnpgp/rnp/blob/master/src/tests/support.cpp#L537 So this way CLI can accept "GPG21" keystore format, but
rnp_ffi_create()
is never called or tested with RNP_KEYSTORE_GPG21 in current codebase.Steps to Reproduce
Call
rnp_ffi_create()
withpub_fomat
andsec_format
set toRNP_KEYSTORE_GPG21
.Expected Behavior
Either function should accept this value, or documentation should be updated.
Actual Behavior
RNP_ERROR_BAD_PARAMETERS
is returned. Helper functionparse_ks_format
recognizes only 3 keystore formats from 4 defined.