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));
|
err = gpgsm_set_fd (gpgsm, INPUT_FD, map_data_enc (gpgsm->input_cb.data));
|
||||||
if (err)
|
if (err)
|
||||||
return err;
|
return err;
|
||||||
if (plaintext)
|
if (!signed_text)
|
||||||
{
|
{
|
||||||
/* Normal or cleartext signature. */
|
/* Normal or cleartext signature. */
|
||||||
|
if (plaintext)
|
||||||
|
{
|
||||||
gpgsm->output_cb.data = plaintext;
|
gpgsm->output_cb.data = plaintext;
|
||||||
err = gpgsm_set_fd (gpgsm, OUTPUT_FD, 0);
|
err = gpgsm_set_fd (gpgsm, OUTPUT_FD, 0);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* No output requested. */
|
||||||
|
gpgsm_clear_fd (gpgsm, OUTPUT_FD);
|
||||||
|
}
|
||||||
gpgsm_clear_fd (gpgsm, MESSAGE_FD);
|
gpgsm_clear_fd (gpgsm, MESSAGE_FD);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user