int08h/roughenough

Support base64 public keys

Closed this issue · 2 comments

Some prominent public servers publish pubkeys as base64:

% host -t TXT roughtime.cloudflare.com
roughtime.cloudflare.com descriptive text "gD63hSj3ScS+wuOeGrubXlq35N1c5Lby/S+T7MNTjxo="

while roughenough currently only supports hex encoded ones:

% roughenough-client -p0 roughtime.cloudflare.com 2002 -k "gD63hSj3ScS+wuOeGrubXlq35N1c5Lby/S+T7MNTjxo="
thread 'main' panicked at 'Error parsing public key!: DecodeError { position: 0, kind: Symbol }', src/bin/roughenough-client.rs:384:14

They probably should be supported?

The draft RFC also publishes base64 so I'm not actually sure where the hex format came from?

I opened #31 to do this

PR #31 has been merged, thank you.

The draft RFC also publishes base64](https://www.ietf.org/archive/id/draft-ietf-ntp-roughtime-05.html#section-9-2) so I'm not actually sure where the hex format came from?

My fault. About 5 years ago when I wrote roughenough there wasn't any convention or standard. So I just used hex in the TXT record. 🤷