Home GnuPG
Diffusion GPGME 775e1eb923fa

gpgsm: Read all pending lines before waiting for more data

Description

gpgsm: Read all pending lines before waiting for more data

* src/engine-gpgsm.c (gpgsm_assuan_simple_command): Add a loop to read
all pending lines.

This fixes the problem that gpgme waited indefinitely for the completion
of the "simple command" if the reply consisted of more than one line.
For example, if an invalid recipient is sent to gpgsm then gpgsm
replies something like

S INV_RECP 10 798413A50E4C66292914361E8358AC45668F412A<LF>
ERR 50331746 Not trusted <GpgSM><LF>

gpgsm_assuan_simple_command read the first line and then waited forever
for more data sent by gpgsm.

Details