int08h / roughenough

A Roughtime secure time sync client and server written in Rust
https://int08h.com/post/roughenough-a-rust-roughtime-server/
Apache License 2.0
122 stars 20 forks source link

Support base64 public keys #30

Closed valpackett closed 2 years ago

valpackett commented 2 years ago

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?

lachesis commented 2 years ago

I opened #31 to do this

int08h commented 2 years ago

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. :shrug: