tftpd needs to handle the transfer size option when faking up
/etc/random.seed.

Without this, clients that query the size receive 0 as response,
preventing efiboot from loading random.seed.

ok?

Index: tftpd.c
===================================================================
RCS file: /cvs/src/usr.sbin/tftpd/tftpd.c,v
retrieving revision 1.40
diff -u -p -r1.40 tftpd.c
--- tftpd.c     7 Nov 2017 14:15:38 -0000       1.40
+++ tftpd.c     25 Jan 2018 12:49:39 -0000
@@ -973,6 +973,8 @@ validate_access(struct tftp_client *clie
 
                buf = client->buf + sizeof(client->buf) - 512;
                arc4random_buf(buf, 512);
+               if (options != NULL && options[OPT_TSIZE].o_request)
+                       options[OPT_TSIZE].o_reply = 512;
                client->file = fmemopen(buf, 512, "r");
                if (client->file == NULL)
                        return (errno + 100);
-- 
Christian "naddy" Weisgerber                          [email protected]

Reply via email to