Change examples and readme to point at roughtime.int08h.com

This commit is contained in:
Stuart Stock
2018-02-17 18:53:01 -06:00
parent 6479d79287
commit 5dad675b88
3 changed files with 30 additions and 17 deletions

View File

@ -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:

View File

@ -40,13 +40,13 @@ import nearenough.protocol.RtWire;
*/
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<DatagramPacket> {
@ -59,7 +59,7 @@ public final class NettyClient {
// 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 final class NettyClient {
}
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);

View File

@ -33,18 +33,18 @@ import nearenough.protocol.RtWire;
*/
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 final class NioClient {
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();