On 15/09/18 21:15, Daniel Golle wrote:
For now, this is acceptable. In the long run we should store keys in their native fixed-length binary representation rather than using usign's base64 encoded text strings -- however, that requires changes to usign as well, so for now fixing ucert to work with usign ascii i/o is the way to go. Please resend you patch including a patch description and SoB line, so it can be merged.
Patch updated as requested. thanks, Mike
>From 674dae87b999578578268b9d26454ef4f5f039a9 Mon Sep 17 00:00:00 2001 From: Mike McCormack <m...@atratus.org> Date: Sat, 18 Aug 2018 16:04:57 +1000 Subject: [PATCH] ucert: Add patch to workaround short read 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 <m...@atratus.org> --- package/system/ucert/patches/0001-Fix-cert-length.patch | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 package/system/ucert/patches/0001-Fix-cert-length.patch diff --git a/package/system/ucert/patches/0001-Fix-cert-length.patch b/package/system/ucert/patches/0001-Fix-cert-length.patch new file mode 100644 index 0000000000..8ccf4561fb --- /dev/null +++ b/package/system/ucert/patches/0001-Fix-cert-length.patch @@ -0,0 +1,15 @@ +--- a/usign-exec.c 2018-08-09 03:48:11.000000000 +1000 ++++ b/usign-exec.c 2018-08-18 16:03:41.393546235 +1000 +@@ -156,9 +156,10 @@ + 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'; -- 2.11.0
_______________________________________________ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel