usign occasionally writes 16 characters then exits without writing a LF,
leaving ucert hanging waiting for more input. Accept 16 characters
or more rather than 17 to work around the short read.
Signed-off-by: Mike McCormack <mike@atratus.org>
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
waitpid(pid, &status, 0);
status = WEXITSTATUS(status);
if (fingerprint && !WEXITSTATUS(status)) {
+ ssize_t r;
memset(fingerprint, 0, 17);
- read(fds[0], fingerprint, 17);
- if (fingerprint[16] != '\n')
+ r = read(fds[0], fingerprint, 17);
+ if (r < 16)
status = -1;
fingerprint[16] = '\0';