From 5dad675b88678c3a54a79711b65c151cd1d05f79 Mon Sep 17 00:00:00 2001 From: Stuart Stock Date: Sat, 17 Feb 2018 18:53:01 -0600 Subject: [PATCH] Change examples and readme to point at roughtime.int08h.com --- README.md | 15 ++++++++++++++- .../java/nearenough/examples/NettyClient.java | 16 ++++++++-------- src/main/java/nearenough/examples/NioClient.java | 16 ++++++++-------- 3 files changed, 30 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 2cc419b..9d64294 100644 --- a/README.md +++ b/README.md @@ -14,11 +14,24 @@ time synchronisation in a secure way that doesn't depend on any particular time a way that, if a time server does misbehave, clients end up with cryptographic proof of it. It was created by Adam Langley and Robert Obryk. -## Links +## Resources * [Nearenough Github repo](https://github.com/int08h/nearenough) * [Roughtime project](https://roughtime.googlesource.com/roughtime) * My blog posts [describing Roughtime features](https://int08h.com/post/to-catch-a-lying-timeserver/) and exploring the [Nearenough API and details of Roughtime messages](https://int08h.com/post/roughtime-message-anatomy/). + +### Public int08h.com Roughtime Server + +A publicly accessible Roughtime server is available at `roughtime.int08h.com` port `2002`. The +server's long-term public key is `016e6e0284d24c37c6e4d7d8d5b4e1d3c1949ceaa545bf875616c9dce0c9bec1` +and can verified by querying the server's DNS `TXT` record: + +```bash +$ dig -t txt roughtime.int08h.com +... +;; ANSWER SECTION: +roughtime.int08h.com. 1799 IN TXT "016e6e0284d24c37c6e4d7d8d5b4e1d3c1949ceaa545bf875616c9dce0c9bec1" +``` ## Building Gradle is used to build Nearenough. Run the tests: diff --git a/src/main/java/nearenough/examples/NettyClient.java b/src/main/java/nearenough/examples/NettyClient.java index 040de9e..bb5413a 100644 --- a/src/main/java/nearenough/examples/NettyClient.java +++ b/src/main/java/nearenough/examples/NettyClient.java @@ -40,13 +40,13 @@ */ public final class NettyClient { - // Hostname and port of the public Google Roughtime server - private static final String GOOGLE_SERVER_HOST = "roughtime.sandbox.google.com"; - private static final int GOOGLE_SERVER_PORT = 2002; + // Hostname and port of the public int08h.com Roughtime server + private static final String INT08H_SERVER_HOST = "roughtime.int08h.com"; + private static final int INT08H_SERVER_PORT = 2002; - // Long-term public key of the public Google Roughtime server - private static final byte[] GOOGLE_SERVER_PUBKEY = hexToBytes( - "7ad3da688c5c04c635a14786a70bcf30224cc25455371bf9d4a2bfb64b682534" + // Long-term public key of the public int08h.com Roughtime server + private static final byte[] INT08H_SERVER_PUBKEY = hexToBytes( + "016e6e0284d24c37c6e4d7d8d5b4e1d3c1949ceaa545bf875616c9dce0c9bec1" ); private static final class RequestHandler extends SimpleChannelInboundHandler { @@ -59,7 +59,7 @@ public RequestHandler(InetSocketAddress addr) { // Creates a new RoughtimeClient. // Behind the scenes SecureRandom will be used to generate a unique nonce. - this.client = new RoughtimeClient(GOOGLE_SERVER_PUBKEY); + this.client = new RoughtimeClient(INT08H_SERVER_PUBKEY); } @Override @@ -133,7 +133,7 @@ public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) { } public static void main(String[] args) throws InterruptedException { - InetSocketAddress addr = new InetSocketAddress(GOOGLE_SERVER_HOST, GOOGLE_SERVER_PORT); + InetSocketAddress addr = new InetSocketAddress(INT08H_SERVER_HOST, INT08H_SERVER_PORT); System.out.printf("Sending request to %s\n", addr); diff --git a/src/main/java/nearenough/examples/NioClient.java b/src/main/java/nearenough/examples/NioClient.java index ef147ee..3591b14 100644 --- a/src/main/java/nearenough/examples/NioClient.java +++ b/src/main/java/nearenough/examples/NioClient.java @@ -33,18 +33,18 @@ */ public final class NioClient { - // Hostname and port of the public Google Roughtime server - private static final String GOOGLE_SERVER_HOST = "roughtime.sandbox.google.com"; - private static final int GOOGLE_SERVER_PORT = 2002; + // Hostname and port of the public int08h.com Roughtime server + private static final String INT08H_SERVER_HOST = "roughtime.int08h.com"; + private static final int INT08H_SERVER_PORT = 2002; - // Long-term public key of the public Google Roughtime server - private static final byte[] GOOGLE_SERVER_PUBKEY = hexToBytes( - "7ad3da688c5c04c635a14786a70bcf30224cc25455371bf9d4a2bfb64b682534" + // Long-term public key of the public int08h.com Roughtime server + private static final byte[] INT08H_SERVER_PUBKEY = hexToBytes( + "016e6e0284d24c37c6e4d7d8d5b4e1d3c1949ceaa545bf875616c9dce0c9bec1" ); @SuppressWarnings("Duplicates") public static void main(String[] args) throws IOException, InterruptedException { - InetSocketAddress addr = new InetSocketAddress(GOOGLE_SERVER_HOST, GOOGLE_SERVER_PORT); + InetSocketAddress addr = new InetSocketAddress(INT08H_SERVER_HOST, INT08H_SERVER_PORT); System.out.printf("Sending request to %s\n", addr); // Nonblocking NIO UDP channel for the remote Roughtime server @@ -52,7 +52,7 @@ public static void main(String[] args) throws IOException, InterruptedException channel.configureBlocking(false); // Create a new RoughtimeClient instance - RoughtimeClient client = new RoughtimeClient(GOOGLE_SERVER_PUBKEY); + RoughtimeClient client = new RoughtimeClient(INT08H_SERVER_PUBKEY); // Create a request message RtMessage request = client.createRequest();