date-proxy-watcher: PAC proxy format to tlsdated

Translate Chrome's PAC format to tlsdated proxy format:
  DIRECT -> none
  PROXY host:port -> http://host:port
  SOCKS host:port -> socks4://host:port
  SOCKS5 host:port -> socks5://host:port
  HTTPS host:port -> https://host:port

At present, the emitted proxy "host:port" does not match the expected
format in tlsdated.conf and lacks scheme annotation. This breaks tlsdated
proxy use.

BUG=chromium:271644
TEST=merged onto a Aug1 build. Restarted date watcher and updated the proxy in OOBE.  tlsdated was restarted properly with -x http://blah and -x socks://blagh
     tested http with a local squid proxy and I was able to get the correct time.

Change-Id: I50f2317da0e022ac7be82773e0c8bcc9b129f121
Reviewed-on: https://gerrit.chromium.org/gerrit/65883
Reviewed-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Elly Jones <ellyjones@chromium.org>
Tested-by: Will Drewry <wad@chromium.org>
Commit-Queue: Will Drewry <wad@chromium.org>
(cherry picked from commit 55dabe50bb8f68c828d7074ff9565281334b5d6c)
Reviewed-on: https://gerrit.chromium.org/gerrit/66108
Reviewed-by: Will Drewry <wad@chromium.org>
1 file changed