core: Do not crash if CMS plaintext is ignored
* src/engine-gpgsm.c (gpgsm_verify): Fix handling both plaintext and signed_text as NULL. -- Previously if plaintext was NULL and signed_text was NULL it would set MESSAGE_FD to NULL which resulted in a crash. Ignoring the plaintext of an opaque signature might make sense in some cases and engine-gpg handles it.
This commit is contained in:
parent
62c736ba76
commit
8f27511862
@ -2030,11 +2030,19 @@ gpgsm_verify (void *engine, gpgme_data_t sig, gpgme_data_t signed_text,
|
||||
err = gpgsm_set_fd (gpgsm, INPUT_FD, map_data_enc (gpgsm->input_cb.data));
|
||||
if (err)
|
||||
return err;
|
||||
if (plaintext)
|
||||
if (!signed_text)
|
||||
{
|
||||
/* Normal or cleartext signature. */
|
||||
gpgsm->output_cb.data = plaintext;
|
||||
err = gpgsm_set_fd (gpgsm, OUTPUT_FD, 0);
|
||||
if (plaintext)
|
||||
{
|
||||
gpgsm->output_cb.data = plaintext;
|
||||
err = gpgsm_set_fd (gpgsm, OUTPUT_FD, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* No output requested. */
|
||||
gpgsm_clear_fd (gpgsm, OUTPUT_FD);
|
||||
}
|
||||
gpgsm_clear_fd (gpgsm, MESSAGE_FD);
|
||||
}
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user