rnpgp / rnp

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

RNP should use repgp interface #523

Open kriskwiatkowski opened 6 years ago

kriskwiatkowski commented 6 years ago

Description

I propose we extend repgp API so that it supports all PGP data processing (currently it's parsing only). To be done here is:

  1. repgp should be using stream data processing
  2. repgp should implement read and write (currently API offers only parsing API - so read)
  3. rnp(2).c should be small wrapper around API from repgp (to improve testing, re-usability and avoid code duplication).
  4. In repgp there are few functions which should be prefixed with repgp_ (for handle creation). That's a bug which must be fixed before this ticket is closed

This may be related partially to #490 (this should move all rnp_*** functions to repgp). Is it OK by everybody?

ronaldtse commented 6 years ago

@flowher sorry for the late reply. By "PGP data processing", do you mean that repgp should handle the reading and writing of OpenPGP packets?

If repgp can do all that, what's left of the use of rnp? rnp provides the data to write OpenPGP packets through repgp?

kriskwiatkowski commented 6 years ago

Yes, that would be my suggestion. The rnp would be just a light wrapper around librepgp - basically implementation of the main() function, attribute parsing, error handling, calling librepgp and everything else which is needed for rnp but not actual parsing/writing. The other rnp folder would contain common functionality used by all the other components (as it does today partially). The idea comes from the fact I don't see why we would need to differentiate between parsing and serializing. Actual implementation (location of files) for stream writing is already in librepgp anyway. I'm interested in opinions.

ronaldtse commented 6 years ago

The other part of rnp other than the OpenPGP packet format is the keystore stuff. I do agree that reading and writing of the packet format should be done in the same library.

What are your views, @dewyatt @ni4 @randombit?