summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorStuart Stock <stuart@int08h.com>2018-03-10 16:10:48 -0600
committerStuart Stock <stuart@int08h.com>2018-03-10 16:10:48 -0600
commit3959d7ba87f9acef068723be574ce381d4253097 (patch)
treea6fce6320ce96f26f9d43e00b00c247f876515da /src
parentafd7026bed14ae1f59da6e3e66fc61986bdca614 (diff)
downloadroughenough-3959d7ba87f9acef068723be574ce381d4253097.zip
Use a consistent version constant for server and client
Diffstat (limited to 'src')
-rw-r--r--src/bin/client.rs4
-rw-r--r--src/bin/server.rs7
-rw-r--r--src/lib.rs4
3 files changed, 7 insertions, 8 deletions
diff --git a/src/bin/client.rs b/src/bin/client.rs
index d5bd3d4..1c1da03 100644
--- a/src/bin/client.rs
+++ b/src/bin/client.rs
@@ -20,7 +20,7 @@ use std::iter::Iterator;
use std::collections::HashMap;
use std::net::{UdpSocket, ToSocketAddrs};
-use roughenough::{RtMessage, Tag, TREE_NODE_TWEAK, TREE_LEAF_TWEAK, CERTIFICATE_CONTEXT, SIGNED_RESPONSE_CONTEXT};
+use roughenough::{RtMessage, Tag, VERSION, TREE_NODE_TWEAK, TREE_LEAF_TWEAK, CERTIFICATE_CONTEXT, SIGNED_RESPONSE_CONTEXT};
use roughenough::sign::Verifier;
use clap::{Arg, App};
@@ -159,7 +159,7 @@ fn sha_512(prefix: &[u8], data: &[u8]) -> Vec<u8> {
fn main() {
let matches = App::new("roughenough client")
- .version("0.1.1")
+ .version(VERSION)
.arg(Arg::with_name("host")
.required(true)
.help("The Roughtime server to connect to")
diff --git a/src/bin/server.rs b/src/bin/server.rs
index 277e57e..045856f 100644
--- a/src/bin/server.rs
+++ b/src/bin/server.rs
@@ -70,8 +70,7 @@ use mio::timer::Timer;
use byteorder::{LittleEndian, WriteBytesExt};
use roughenough::{RtMessage, Tag, Error};
-use roughenough::{CERTIFICATE_CONTEXT, MIN_REQUEST_LENGTH, SIGNED_RESPONSE_CONTEXT, TREE_LEAF_TWEAK};
-use roughenough::hex::*;
+use roughenough::{VERSION, CERTIFICATE_CONTEXT, MIN_REQUEST_LENGTH, SIGNED_RESPONSE_CONTEXT, TREE_LEAF_TWEAK};
use roughenough::sign::Signer;
use ring::{digest, rand};
@@ -79,8 +78,6 @@ use ring::rand::SecureRandom;
use yaml_rust::YamlLoader;
-const SERVER_VERSION: &str = "0.2.0";
-
const MESSAGE: Token = Token(0);
const STATUS: Token = Token(1);
@@ -317,7 +314,7 @@ fn main() {
use log::Level;
simple_logger::init_with_level(Level::Info).unwrap();
- info!("Roughenough server v{} starting", SERVER_VERSION);
+ info!("Roughenough server v{} starting", VERSION);
let mut args = env::args();
if args.len() != 2 {
diff --git a/src/lib.rs b/src/lib.rs
index 26a5739..fbdfadb 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -57,13 +57,15 @@ mod error;
mod tag;
mod message;
-pub mod hex;
pub mod sign;
pub use error::Error;
pub use tag::Tag;
pub use message::RtMessage;
+/// Version of Roughenough
+pub const VERSION: &str = "0.3.0";
+
// Constants and magic numbers of the Roughtime protocol
/// Minimum size (in bytes) of a client request