From 613578b69f8bada4c6aa791e56768e59b017b20c Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Mon, 16 May 2016 22:55:30 +0200 Subject: [PATCH] kernel: add srvtls and tlsclient to bootfs.proto for encrypting connection to the file server --- sys/src/9/boot/bootfs.proto | 2 ++ sys/src/9/boot/bootrc | 2 +- sys/src/9/boot/net.rc | 10 +++++++++- sys/src/9/sgi/bootfs.proto | 2 ++ 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/sys/src/9/boot/bootfs.proto b/sys/src/9/boot/bootfs.proto index 6b1366b37..3a5b1833d 100644 --- a/sys/src/9/boot/bootfs.proto +++ b/sys/src/9/boot/bootfs.proto @@ -37,6 +37,7 @@ $objtype sleep srv test + tlsclient unmount nusb usbd @@ -52,6 +53,7 @@ rc bin fstype diskparts + srvtls nusbrc 555 sys sys ../boot/nusbrc bootrc 555 sys sys ../boot/bootrc tmp diff --git a/sys/src/9/boot/bootrc b/sys/src/9/boot/bootrc index b8c96cc17..cf712609a 100755 --- a/sys/src/9/boot/bootrc +++ b/sys/src/9/boot/bootrc @@ -70,7 +70,7 @@ fn main{ if(~ $#nobootprompt 0){ echo showlocaldevs - ask bootargs ' is (tcp, il, local!device)' $"bootargs + ask bootargs ' is (tcp, tls, il, local!device)' $"bootargs } if not bootargs=$nobootprompt nobootprompt=() diff --git a/sys/src/9/boot/net.rc b/sys/src/9/boot/net.rc index fb399ef97..27458081a 100755 --- a/sys/src/9/boot/net.rc +++ b/sys/src/9/boot/net.rc @@ -48,6 +48,12 @@ fn connecttcp{ fs=$fs(1) } +fn connecttls{ + while(! ~ $#fs 0 && ! srvtls -q tcp!$fs(1)^!17020 boot) + fs=$fs(2-); + fs=$fs(1) +} + fn connectil{ while(! ~ $#fs 0 && ! srv -q il!$fs(1)^!17008 boot) fs=$fs(2-); @@ -55,5 +61,7 @@ fn connectil{ } mtcp=(confignet connecttcp) +mtls=(confignet connecttls) mil=(confignet connectil) -mt=(mtcp mil $mt) + +mt=(mtcp mtls mil $mt) diff --git a/sys/src/9/sgi/bootfs.proto b/sys/src/9/sgi/bootfs.proto index 3c691d2dd..3817482e7 100644 --- a/sys/src/9/sgi/bootfs.proto +++ b/sys/src/9/sgi/bootfs.proto @@ -27,6 +27,7 @@ $objtype sleep srv test + tlsclient unmount xd rc @@ -34,5 +35,6 @@ rc rcmain net.rc 555 sys sys ../boot/net.rc bin + srvtls bootrc 555 sys sys ../boot/bootrc tmp