-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix trust and file handling for S/MIME (11.0) #309
Fix trust and file handling for S/MIME (11.0) #309
Conversation
The certificates used for S/MIME encryption are now added to the GPG trust list automatically because users cannot always confirm trust. Also, a data buffer with custom I/O functions is used to write the encrypted data because gpgme_data_new_from_stream can cause problems when trying to write afterwards.
util/gpgmeutils.c
Outdated
{ | ||
struct gpgme_data_cbs *callbacks; | ||
|
||
callbacks = malloc (sizeof (struct gpgme_data_cbs)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
callbacks = malloc (sizeof (struct gpgme_data_cbs)); | |
callbacks = g_malloc0 (sizeof (struct gpgme_data_cbs)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We usually use the glib wrapper, which checks the malloc return.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in c126b85.
util/gpgmeutils.c
Outdated
GString *trustlist_content; | ||
GError *g_err; | ||
|
||
g_err = NULL; gpgme_set_pinentry_mode (ctx, GPGME_PINENTRY_MODE_CANCEL); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
g_err = NULL; gpgme_set_pinentry_mode (ctx, GPGME_PINENTRY_MODE_CANCEL); | |
g_err = NULL; | |
gpgme_set_pinentry_mode (ctx, GPGME_PINENTRY_MODE_CANCEL); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in 6f4400c.
util/gpgmeutils.c
Outdated
callbacks->read = gvm_gpgme_fread; | ||
callbacks->write = gvm_gpgme_fwrite; | ||
|
||
return gpgme_data_new_from_cbs (new_data, callbacks, file); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is callbacks freed? Should callbacks->release be set to do this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternatively callbacks could be passed in from the caller, so it doesn't need to be freed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in 8428f83.
The certificates used for S/MIME encryption are now added to the GPG
trust list automatically because users cannot always confirm trust.
Also, a data buffer with custom I/O functions is used to write the
encrypted data because gpgme_data_new_from_stream can cause problems
when trying to write afterwards.
Checklist: