1
0
Fork 0
mirror of https://github.com/dani-garcia/vaultwarden.git synced 2025-05-29 23:13:57 +00:00

Update dependencies and fix some warnings

This commit is contained in:
Daniel García 2019-04-11 15:32:38 +02:00
parent d89bd707a8
commit 621f607297
No known key found for this signature in database
GPG key ID: FC8A7D14C3CD543A
7 changed files with 98 additions and 49 deletions

View file

@ -787,7 +787,6 @@ fn _duo_api_request(method: &str, path: &str, params: &str) -> EmptyResult {
use std::str::FromStr;
use chrono::Utc;
use reqwest::{header::*, Client, Method};
let ik = CONFIG.duo_ikey().unwrap();

View file

@ -2,7 +2,7 @@
// PBKDF2 derivation
//
use ring::{digest, pbkdf2};
use ring::{digest, pbkdf2, hmac};
static DIGEST_ALG: &digest::Algorithm = &digest::SHA256;
const OUTPUT_LEN: usize = digest::SHA256_OUTPUT_LEN;
@ -24,7 +24,6 @@ pub fn verify_password_hash(secret: &[u8], salt: &[u8], previous: &[u8], iterati
//
pub fn hmac_sign(key: &str, data:&str) -> String {
use data_encoding::HEXLOWER;
use ring::{digest, hmac};
let key = hmac::SigningKey::new(&digest::SHA1, key.as_bytes());
let signature = hmac::sign(&key, data.as_bytes());

View file

@ -72,9 +72,7 @@ use crate::error::MapResult;
/// Database methods
impl Cipher {
pub fn to_json(&self, host: &str, user_uuid: &str, conn: &DbConn) -> Value {
use super::Attachment;
use crate::util::format_date;
use serde_json;
let attachments = Attachment::find_by_cipher(&self.uuid, conn);
let attachments_json: Vec<Value> = attachments.iter().map(|c| c.to_json(host)).collect();

View file

@ -113,8 +113,6 @@ use crate::error::MapResult;
/// Database methods
impl User {
pub fn to_json(&self, conn: &DbConn) -> Value {
use super::{TwoFactor, UserOrganization};
let orgs = UserOrganization::find_by_user(&self.uuid, conn);
let orgs_json: Vec<Value> = orgs.iter().map(|c| c.to_json(&conn)).collect();
let twofactor_enabled = !TwoFactor::find_by_user(&self.uuid, conn).is_empty();