Updated dependencies

refactor
Dennis Schwerdel 2018-08-16 12:15:09 +02:00
parent 381bdf654d
commit c8c5a7e901
7 changed files with 667 additions and 197 deletions

772
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -8,37 +8,36 @@ description = "Deduplicating backup tool"
lto = true lto = true
[dependencies] [dependencies]
serde = "1.0" serde = "^1.0"
rmp-serde = "0.13" rmp-serde = "^0.13"
serde_yaml = "0.7" serde_yaml = "~0.7"
serde_utils = "0.6" serde_utils = "~0.6"
serde_bytes = "0.10" serde_bytes = "~0.10"
squash-sys = "0.9" squash-sys = "~0.10"
quick-error = "1.1" quick-error = "^1.1"
blake2-rfc = "0.2" blake2-rfc = "~0.2"
murmurhash3 = "0.0.5" murmurhash3 = "~0.0.5"
chrono = "0.4" chrono = "~0.4"
clap = "^2.24" clap = "^2.24"
log = "0.4" log = "~0.4"
byteorder = "1.0" byteorder = "^1.0"
ansi_term = "0.11" ansi_term = "~0.11"
sodiumoxide = "0.0.16" sodiumoxide = { git = "https://github.com/sodiumoxide/sodiumoxide" }
libsodium-sys = "0.0.16" filetime = "~0.2"
filetime = "0.1" regex = "^1.0"
regex = "0.2" fuse = "~0.3"
fuse = "0.3" lazy_static = "^1.0"
lazy_static = "1.0" rand = "~0.5"
rand = "0.4" tar = "~0.4"
tar = "0.4" xattr = "~0.2"
xattr = "0.2" crossbeam = "~0.4"
crossbeam = "0.3" pbr = "^1.0"
pbr = "1.0" users = "~0.7"
users = "0.6" time = "~0.1"
time = "*" libc = "~0.2"
libc = "0.2" runtime-fmt = "~0.3"
runtime-fmt = "0.3" locale_config = "~0.2.2"
locale_config = "^0.2.2" mmap = "~0.1"
mmap = "0.1"
[features] [features]
default = [] default = []

View File

@ -289,7 +289,7 @@ impl Inode {
} }
} }
} }
let time = FileTime::from_seconds_since_1970(self.timestamp as u64, 0); let time = FileTime::from_unix_time(self.timestamp, 0);
if let Err(err) = filetime::set_file_times(&full_path, time, time) { if let Err(err) = filetime::set_file_times(&full_path, time, time) {
tr_warn!("Failed to set file time on {:?}: {}", full_path, err); tr_warn!("Failed to set file time on {:?}: {}", full_path, err);
} }

View File

@ -21,7 +21,6 @@ extern crate clap;
extern crate log; extern crate log;
extern crate byteorder; extern crate byteorder;
extern crate sodiumoxide; extern crate sodiumoxide;
extern crate libsodium_sys;
extern crate ansi_term; extern crate ansi_term;
extern crate filetime; extern crate filetime;
extern crate regex; extern crate regex;

View File

@ -5,7 +5,7 @@ use std::sync::{Mutex, Condvar, Arc};
use std::{mem, fs, thread}; use std::{mem, fs, thread};
use std::path::{Path, PathBuf}; use std::path::{Path, PathBuf};
use crossbeam::sync::MsQueue; use crossbeam::queue::MsQueue;
pub struct BundleUploader { pub struct BundleUploader {

View File

@ -284,9 +284,7 @@ impl CompressionStream {
impl Drop for CompressionStream { impl Drop for CompressionStream {
fn drop(&mut self) { fn drop(&mut self) {
unsafe { unsafe {
//squash_object_unref(self.stream as *mut ::std::os::raw::c_void); squash_object_unref(self.stream as *mut ::std::os::raw::c_void);
use libc;
squash_object_unref(self.stream as *mut libc::c_void);
} }
} }
} }

View File

@ -7,10 +7,10 @@ use std::sync::{RwLock, Once, ONCE_INIT};
use serde_yaml; use serde_yaml;
use serde_bytes::ByteBuf; use serde_bytes::ByteBuf;
use libsodium_sys;
use sodiumoxide; use sodiumoxide;
use sodiumoxide::crypto::sealedbox; use sodiumoxide::crypto::sealedbox;
use sodiumoxide::crypto::box_; use sodiumoxide::crypto::box_;
use sodiumoxide::crypto::box_::curve25519xsalsa20poly1305::{keypair_from_seed, Seed};
use sodiumoxide::crypto::pwhash; use sodiumoxide::crypto::pwhash;
pub use sodiumoxide::crypto::box_::{SecretKey, PublicKey}; pub use sodiumoxide::crypto::box_::{SecretKey, PublicKey};
@ -20,7 +20,7 @@ use util::*;
static INIT: Once = ONCE_INIT; static INIT: Once = ONCE_INIT;
fn sodium_init() { fn sodium_init() {
INIT.call_once(|| if !sodiumoxide::init() { INIT.call_once(|| if sodiumoxide::init().is_err() {
tr_panic!("Failed to initialize sodiumoxide"); tr_panic!("Failed to initialize sodiumoxide");
}); });
} }
@ -277,20 +277,12 @@ impl Crypto {
pwhash::OPSLIMIT_INTERACTIVE, pwhash::OPSLIMIT_INTERACTIVE,
pwhash::MEMLIMIT_INTERACTIVE pwhash::MEMLIMIT_INTERACTIVE
).unwrap(); ).unwrap();
let mut seed = [0u8; 32]; let seed = if let Some(seed) = Seed::from_slice(&key[key.len()-32..]) {
let offset = key.len() - seed.len(); seed
for (i, b) in seed.iter_mut().enumerate() { } else {
*b = key[i + offset]; tr_panic!("Seed failed");
} };
let mut pk = [0u8; 32]; keypair_from_seed(&seed)
let mut sk = [0u8; 32];
if unsafe { libsodium_sys::crypto_box_seed_keypair(&mut pk, &mut sk, &seed) } != 0 {
tr_panic!("Libsodium failed");
}
(
PublicKey::from_slice(&pk).unwrap(),
SecretKey::from_slice(&sk).unwrap()
)
} }
} }