Update dependencies

This commit is contained in:
Ethan O'Brien
2026-05-02 15:59:40 -05:00
parent ad0009baf6
commit d017fc43bb
5 changed files with 389 additions and 519 deletions

878
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -5,25 +5,26 @@ edition = "2024"
[dependencies]
actix-web = "4.13"
rusqlite = { version = "0.38.0", features = ["bundled"] }
rusqlite = { version = "0.39.0", features = ["bundled"] }
clap = { version = "4.5.59", features = ["derive"]}
base64 = "0.22.1"
rand = "0.10.0"
lazy_static = "1.5.0"
hex = "0.4.3"
hmac = "0.12.1"
hmac = "0.13.0"
md5 = "0.8.0"
urlencoding = "2.1.3"
sha1 = "0.10.6"
sha1 = "0.11.0"
substring = "1.4.5"
uuid = { version = "1.21.0", features = ["v7"] }
rsa = { version = "0.9.10", features = ["sha1"] }
# This needs to be on 0.10.* to be able to bump other crates. This is probably fine
rsa = { version = "0.10.0-rc.18", features = ["sha1"] }
mime = "0.3.17"
sha2 = "0.10.9"
sha2 = "0.11.0"
include-flate-codegen = "0.3.1"
libflate = "2.2.1"
cbc = { version = "0.1.2", features = ["alloc"] }
aes = "0.8.4"
cbc = { version = "0.2.0", features = ["alloc"] }
aes = "0.9.0"
pem = "3.0.6"
ureq = "3.2.0"
mime_guess = "2.0.5"

View File

@@ -1,7 +1,6 @@
use base64::{Engine as _, engine::general_purpose};
use rand::RngExt;
use aes::cipher::BlockEncryptMut;
use aes::cipher::{block_padding::Pkcs7, BlockDecryptMut, KeyIvInit};
use aes::cipher::{block_padding::Pkcs7, BlockModeEncrypt, BlockModeDecrypt, KeyIvInit};
type Aes256CbcEnc = cbc::Encryptor<aes::Aes256>;
type Aes256CbcDec = cbc::Decryptor<aes::Aes256>;
@@ -18,8 +17,8 @@ pub fn decrypt_packet(base64_input: &str) -> Result<String, String> {
let decryption_iv = &base64_buffer[..IV_LENGTH];
let mut ciphertext = base64_buffer[IV_LENGTH..].to_vec();
let decrypted_data = Aes256CbcDec::new(KEY.as_bytes().into(), decryption_iv.into())
.decrypt_padded_mut::<Pkcs7>(&mut ciphertext).ok()
let decrypted_data = Aes256CbcDec::new(&KEY.as_bytes().try_into().unwrap(), decryption_iv.try_into().unwrap())
.decrypt_padded::<Pkcs7>(&mut ciphertext).ok()
.ok_or(String::from("uhoh"))?;
Ok(String::from_utf8(decrypted_data.to_vec()).unwrap())
@@ -28,8 +27,8 @@ pub fn decrypt_packet(base64_input: &str) -> Result<String, String> {
pub fn encrypt_packet(input: &str) -> Result<String, String> {
let encryption_iv = generate_random_iv();
let encrypted = Aes256CbcEnc::new(KEY.as_bytes().into(), encryption_iv.as_slice().into())
.encrypt_padded_vec_mut::<Pkcs7>(input.as_bytes());
let encrypted = Aes256CbcEnc::new(KEY.as_bytes().try_into().unwrap(), encryption_iv.as_slice().try_into().unwrap())
.encrypt_padded_vec::<Pkcs7>(input.as_bytes());
let mut result = encryption_iv.to_vec();
result.extend_from_slice(&encrypted);

View File

@@ -4,7 +4,7 @@ use std::collections::HashMap;
use sha1::Sha1;
use substring::Substring;
use jzon::{object, JsonValue};
use hmac::{Hmac, Mac};
use hmac::{Hmac, Mac, KeyInit};
use rusqlite::params;
use lazy_static::lazy_static;

View File

@@ -277,7 +277,7 @@ fn _a_sha1(t: &str) -> String {
let mut hasher = Sha1::new();
hasher.update(t.as_bytes());
let result = hasher.finalize();
format!("{:X}", result)
hex::encode_upper(result)
}
fn generate_passcode_sha1(transfer_id: String, transfer_code: String) -> String {