Closed randombit closed 6 years ago
This is very interesting. Apparently pgp_write_symm_enc_data
wasn't even used in NetPGP (https://github.com/riboseinc/netpgp/search?utf8=%E2%9C%93&q=pgp_write_symm_enc_data&type=) so let' just simply remove it.
I suspect it was an enhancement in progress done previously but never actually made useful.
This is fixed number of commits ago.
Working on #132 I noticed that
pgp_write_symm_enc_data
seems wrong. It creates a cipher object withpgp_crypt_any
and then - without setting a key or IV - callspgp_encrypt_init
: https://github.com/riboseinc/rnp/blob/master/src/lib/create.c#L1302This will end up keying the cipher with uninitialized data!
It appears this function is not used/called anywhere (probably good, considering). Also, I notice this function seems to be the only caller of
pgp_encrypt_se
, so likely that function also can be removed.pgp_decrypt_se
also appears unused.I think all of these functions can be removed entirely but maybe there is something worth salvaging - I'm not entirely sure what these functions are trying to do, or if the same functionality is replicated elsewhere in the lib.