Fix build with newer Bazel.

Bazel 0.24.1 changed a few things around. Update to the new spelling of
WORKSPACE rules and the new built-in protobuf rules, which require protobuf
live at @com_google_protobuf and a newer protobuf. The newest protobuf, in
turn, needs two more dependencies.

While I'm here, also update BoringSSL.

Change-Id: I2ab85b316cefdd0694b1b7c56322bd4fa64b0ffb
diff --git a/BUILD b/BUILD
index 2f7de98..98fbf9a 100644
--- a/BUILD
+++ b/BUILD
@@ -1,12 +1,7 @@
-load(
-    "@protobuf//:protobuf.bzl",
-    "cc_proto_library",
-)
-
 cc_library(
     name = "roughtime_logging",
     hdrs = ["logging.h"],
-    deps = ["@protobuf//:protobuf"],
+    deps = ["@com_google_protobuf//:protobuf"],
 )
 
 cc_library(
@@ -69,10 +64,13 @@
 )
 
 cc_proto_library(
+    name = "config_cc_proto",
+    deps = [":config_proto"],
+)
+
+proto_library(
     name = "config_proto",
     srcs = ["config.proto"],
-    default_runtime = "@protobuf//:protobuf",
-    protoc = "@protobuf//:protoc",
 )
 
 cc_binary(
@@ -84,9 +82,9 @@
     ],
     deps = [
         ":client",
-        ":config_proto",
+        ":config_cc_proto",
         "@boringssl//:crypto",
-        "@protobuf//:protobuf",
+        "@com_google_protobuf//:protobuf",
     ],
 )
 
diff --git a/WORKSPACE b/WORKSPACE
index 6ea918a..0417bee 100644
--- a/WORKSPACE
+++ b/WORKSPACE
@@ -1,21 +1,47 @@
 workspace(name = "roughtime")
 
+load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
+load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
+
 git_repository(
     name = "boringssl",
-    commit = "9712e98fd90609a97e255eeaa5ae13c2db022620", # Sept 1st, 2016.
+    commit = "e534d74f5732e1aeebd514f05271d089c530c2f9", # April 11th, 2019.
     remote = "https://boringssl.googlesource.com/boringssl",
 )
 
 git_repository(
-    name = "protobuf",
-    commit = "v3.2.0",
-    remote = "https://github.com/google/protobuf",
+    name = "com_google_protobuf",
+    commit = "v3.7.1",
+    remote = "https://github.com/protocolbuffers/protobuf",
 )
 
-new_http_archive(
+# protobuf requires bazel-skylib and zlib.
+
+# bazel-skylib 0.8.0 released 2019.03.20 (https://github.com/bazelbuild/bazel-skylib/releases/tag/0.8.0)
+skylib_version = "0.8.0"
+http_archive(
+    name = "bazel_skylib",
+    type = "tar.gz",
+    url = "https://github.com/bazelbuild/bazel-skylib/releases/download/{}/bazel-skylib.{}.tar.gz".format (skylib_version, skylib_version),
+    sha256 = "2ef429f5d7ce7111263289644d233707dba35e39696377ebab8b0bc701f7818e",
+)
+
+bind(
+    name = "zlib",
+    actual = "@net_zlib//:zlib",
+)
+http_archive(
+    name = "net_zlib",
+    build_file = "@com_google_protobuf//:third_party/zlib.BUILD",
+    sha256 = "c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1",
+    strip_prefix = "zlib-1.2.11",
+    urls = ["https://zlib.net/zlib-1.2.11.tar.gz"],
+)
+
+http_archive(
     name = "gtest",
     url = "https://github.com/google/googletest/archive/release-1.7.0.tar.gz",
     sha256 = "f73a6546fdf9fce9ff93a5015e0333a8af3062a152a9ad6bcb772c96687016cc",
-    build_file = "gtest.BUILD",
+    build_file = "@//:gtest.BUILD",
     strip_prefix = "googletest-release-1.7.0",
 )