Skip to content

Conversation

@racerxdl
Copy link

I added a function to sign data using a private key. It works, but I got bit disapointed since its faster calling shell exec with gpg2 than using this wrapper :( (50ms on gpg2 vs 350ms through this wrapper)

Still, thats a good info since it can be used for decrypt stuff as well.

@kiddouk
Copy link
Owner

kiddouk commented Feb 9, 2018

Thanks for this PR and apologies for the time it took for me to respond. I will review soon.


static gpgme_error_t passphrase_cb (void *opaque, const char *uid_hint, const char *passphrase_info, int last_was_bad, int fd) {
int res;
char pass[255];
Copy link
Owner

Choose a reason for hiding this comment

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

I fear a nice buffer overflow here.

Copy link
Author

Choose a reason for hiding this comment

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

Hmm makes sense, its copying from opaque but not checking the length. I will fix it.

Copy link
Author

Choose a reason for hiding this comment

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

Fixed!

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.

2 participants