Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
kpcyrd committed Mar 28, 2022
1 parent c0cb584 commit 35c6501
Show file tree
Hide file tree
Showing 8 changed files with 707 additions and 523 deletions.
1,172 changes: 680 additions & 492 deletions Cargo.lock

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -72,17 +72,17 @@ semver = "1"
bytes = "0.4"
bytesize = "1.0"
ipnetwork = "0.18"
strum = "0.23"
strum_macros = "0.23"
strum = "0.24"
strum_macros = "0.24"
embedded-triple = "0.1.0"
humansize = "1.1.0"

digest = "0.9"
md-5 = "0.9"
sha-1 = "0.9"
sha2 = "0.9"
sha3 = "0.9"
hmac = "0.11"
digest = "0.10"
md-5 = "0.10"
sha-1 = "0.10"
sha2 = "0.10"
sha3 = "0.10"
hmac = "0.12"

walkdir = "2.2"
nude = "0.3"
Expand Down
14 changes: 7 additions & 7 deletions sn0int-std/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,25 +31,25 @@ pem = "1"
url = "2.0"
tungstenite = { version = "0.13", default-features = false }
kuchiki = "0.8.0"
maxminddb = "0.21"
x509-parser = "0.12"
der-parser = "6"
maxminddb = "0.22"
x509-parser = "0.13"
der-parser = "7"
publicsuffix = { version="2", default-features=false }
xml-rs = "0.8"
geo = "0.18"
geo = "0.19"
bytes = "0.4"
base64 = "0.13"
chrono = { version = "0.4", features = ["serde"] }
mqtt-protocol = "0.11"
sodiumoxide = { version="0.2.5", features=["use-pkg-config"] }

image = "0.23.0"
image = "0.23"
kamadak-exif = "0.5.1"
img_hash_median = "4.0.0"

bs58 = "0.4"
digest = "0.9"
blake2 = "0.9"
digest = "0.10"
blake2 = "0.10"

[dev-dependencies]
env_logger = "0.9"
Expand Down
4 changes: 2 additions & 2 deletions sn0int-std/src/blobs.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use bytes::Bytes;
use blake2::VarBlake2b;
use blake2::Blake2bVar;
use digest::{Update, VariableOutput};
use serde::ser::{Serialize, Serializer};
use serde::de::{self, Deserialize, Deserializer};
Expand All @@ -21,7 +21,7 @@ impl Blob {
}

pub fn hash(bytes: &[u8]) -> String {
let mut h = VarBlake2b::new(32).unwrap();
let mut h = Blake2bVar::new(32).unwrap();
h.update(bytes);
let output = h.finalize_boxed();
Self::encode_hash(&output)
Expand Down
6 changes: 3 additions & 3 deletions sn0int-std/src/geoip/models.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ pub struct Continent {
}

impl Continent {
fn from_maxmind(continent: geoip2::model::Continent) -> Option<Self> {
fn from_maxmind(continent: geoip2::city::Continent) -> Option<Self> {
let code = continent.code?;
let name = from_geoip_model_names(continent.names)?;

Expand All @@ -90,7 +90,7 @@ pub struct Country {
}

impl Country {
fn from_maxmind(country: geoip2::model::Country) -> Option<Self> {
fn from_maxmind(country: geoip2::city::Country) -> Option<Self> {
let code = country.iso_code?;
let name = from_geoip_model_names(country.names)?;

Expand All @@ -108,7 +108,7 @@ pub struct Location {
}

impl Location {
fn from_maxmind(location: &geoip2::model::Location) -> Option<Self> {
fn from_maxmind(location: &geoip2::city::Location) -> Option<Self> {
let latitude = match location.latitude {
Some(latitude) => latitude,
_ => return None,
Expand Down
4 changes: 2 additions & 2 deletions src/keyring.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ impl KeyRing {
pub fn insert(&mut self, key: KeyName, secret: Option<String>) -> Result<()> {
// get the namespace or create a new one
let mut x = self.keys.remove(&key.namespace)
.unwrap_or_else(HashMap::new);
.unwrap_or_default();
// insert key into namespace
x.insert(key.name, secret);
// add namespace backinto keyring
Expand Down Expand Up @@ -176,7 +176,7 @@ impl KeyRing {

pub fn grant_access(&mut self, module: &Module, namespace: String) {
let mut grants = self.grants.remove(&namespace)
.unwrap_or_else(HashSet::new);
.unwrap_or_default();
grants.insert(module.id());
self.grants.insert(namespace, grants);
}
Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ fn run_run(gargs: &Args, args: &args::Run, config: &Config) -> Result<()> {
.to_str()
.ok_or_else(|| format_err!("Failed to decode filename"))?;

Module::load(&path.to_path_buf(), "anonymous", filename, true)
Module::load(path, "anonymous", filename, true)
.context(format!("Failed to parse {:?}", path))?
} else {
rl.library().get(module)?
Expand Down
12 changes: 4 additions & 8 deletions src/runtime/hashes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ use crate::errors::*;
use crate::engine::ctx::State;
use crate::engine::structs::{byte_array, lua_bytes};
use crate::hlua::{self, AnyLuaValue};
use digest::{Digest, Update, BlockInput, FixedOutput, Reset};
use digest::generic_array::ArrayLength;
use hmac::{Hmac, Mac, NewMac};
use digest::{Digest, core_api::BlockSizeUser};
use hmac::{Mac, SimpleHmac};
use std::sync::Arc;


Expand Down Expand Up @@ -57,15 +56,12 @@ pub fn sha3_512(lua: &mut hlua::Lua, state: Arc<dyn State>) {
}

fn hmac<D>(secret: AnyLuaValue, msg: AnyLuaValue) -> Result<AnyLuaValue>
where
D: Update + BlockInput + FixedOutput + Reset + Default + Clone,
D::BlockSize: ArrayLength<u8> + Clone,
D::OutputSize: ArrayLength<u8>,
where D: Digest + BlockSizeUser
{
let secret = byte_array(secret)?;
let msg = byte_array(msg)?;

let mut mac = match Hmac::<D>::new_from_slice(&secret) {
let mut mac = match SimpleHmac::<D>::new_from_slice(&secret) {
Ok(mac) => mac,
Err(_) => bail!("Invalid key length"),
};
Expand Down

0 comments on commit 35c6501

Please sign in to comment.