Skip to content
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

Merged

Conversation

timopollmeier
Copy link
Member

@timopollmeier timopollmeier commented Dec 18, 2019

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:

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.
@timopollmeier timopollmeier marked this pull request as ready for review December 18, 2019 11:22
{
struct gpgme_data_cbs *callbacks;

callbacks = malloc (sizeof (struct gpgme_data_cbs));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
callbacks = malloc (sizeof (struct gpgme_data_cbs));
callbacks = g_malloc0 (sizeof (struct gpgme_data_cbs));

Copy link
Contributor

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.

Copy link
Contributor

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 Show resolved Hide resolved
GString *trustlist_content;
GError *g_err;

g_err = NULL; gpgme_set_pinentry_mode (ctx, GPGME_PINENTRY_MODE_CANCEL);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
g_err = NULL; gpgme_set_pinentry_mode (ctx, GPGME_PINENTRY_MODE_CANCEL);
g_err = NULL;
gpgme_set_pinentry_mode (ctx, GPGME_PINENTRY_MODE_CANCEL);

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 6f4400c.

callbacks->read = gvm_gpgme_fread;
callbacks->write = gvm_gpgme_fwrite;

return gpgme_data_new_from_cbs (new_data, callbacks, file);
Copy link
Contributor

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?

Copy link
Contributor

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 8428f83.

@mattmundell mattmundell requested review from bjoernricks and a team December 24, 2019 13:21
@timopollmeier timopollmeier merged commit 9ac2f3c into greenbone:gvm-libs-11.0 Jan 6, 2020
@timopollmeier timopollmeier deleted the smime-trust-11.0 branch October 15, 2021 12:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants