A suggestion for a new crypto callback system#147
A suggestion for a new crypto callback system#147dagle wants to merge 5 commits intojstedfast:masterfrom
Conversation
This suggestion tries to fix the following problems with the current implemtation. 1. It's not introspectable. 2. You can't get why the key was created. As mention in jstedfast#74 (comment) , this can be a problem. Maybe the flags should be bitflags 3. Callback data. Some crypto engines can require additional data or you just want to save some state.
|
The idea spawned with me wanting to try different cryptoengines, I implemented a gmime-sq The reason for trigger is not only do you might need to know why a cryptocontext should be created. I want this for being able to use it with my autocrypt-storage: sequioa-autocrypt (glib/gmime bindings coming soon), rather than using a gpg keyring to store my peers and keys. This way an implementation of decryption of an autoencrypted email could be engine agnostic. |
|
I'm open to having the crypto APIs be redesigned to allow for other drop-in crypto implementations. |
|
I don't understand why the password callback was made global - I think it should probably remain per-context. |
|
Moved it back the password function. It's now introspectable. Dunno how to rerun checks, seems to be something wrong with github atm. |
This pr is more of discussion and trying to fix some of the issues in gmime regarding crypto towards 4.0
This suggestion tries to fix the following problems with the current
implementation.
this can be a problem. Maybe the flags should be bitflags.
just want to save some state.