mirror of
https://git.ethanthesleepy.one/ethanaobrien/ew
synced 2026-07-12 08:42:20 +08:00
Update dependencies
This commit is contained in:
878
Cargo.lock
generated
878
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
15
Cargo.toml
15
Cargo.toml
@@ -5,25 +5,26 @@ edition = "2024"
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
actix-web = "4.13"
|
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"]}
|
clap = { version = "4.5.59", features = ["derive"]}
|
||||||
base64 = "0.22.1"
|
base64 = "0.22.1"
|
||||||
rand = "0.10.0"
|
rand = "0.10.0"
|
||||||
lazy_static = "1.5.0"
|
lazy_static = "1.5.0"
|
||||||
hex = "0.4.3"
|
hex = "0.4.3"
|
||||||
hmac = "0.12.1"
|
hmac = "0.13.0"
|
||||||
md5 = "0.8.0"
|
md5 = "0.8.0"
|
||||||
urlencoding = "2.1.3"
|
urlencoding = "2.1.3"
|
||||||
sha1 = "0.10.6"
|
sha1 = "0.11.0"
|
||||||
substring = "1.4.5"
|
substring = "1.4.5"
|
||||||
uuid = { version = "1.21.0", features = ["v7"] }
|
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"
|
mime = "0.3.17"
|
||||||
sha2 = "0.10.9"
|
sha2 = "0.11.0"
|
||||||
include-flate-codegen = "0.3.1"
|
include-flate-codegen = "0.3.1"
|
||||||
libflate = "2.2.1"
|
libflate = "2.2.1"
|
||||||
cbc = { version = "0.1.2", features = ["alloc"] }
|
cbc = { version = "0.2.0", features = ["alloc"] }
|
||||||
aes = "0.8.4"
|
aes = "0.9.0"
|
||||||
pem = "3.0.6"
|
pem = "3.0.6"
|
||||||
ureq = "3.2.0"
|
ureq = "3.2.0"
|
||||||
mime_guess = "2.0.5"
|
mime_guess = "2.0.5"
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
use base64::{Engine as _, engine::general_purpose};
|
use base64::{Engine as _, engine::general_purpose};
|
||||||
use rand::RngExt;
|
use rand::RngExt;
|
||||||
use aes::cipher::BlockEncryptMut;
|
use aes::cipher::{block_padding::Pkcs7, BlockModeEncrypt, BlockModeDecrypt, KeyIvInit};
|
||||||
use aes::cipher::{block_padding::Pkcs7, BlockDecryptMut, KeyIvInit};
|
|
||||||
|
|
||||||
type Aes256CbcEnc = cbc::Encryptor<aes::Aes256>;
|
type Aes256CbcEnc = cbc::Encryptor<aes::Aes256>;
|
||||||
type Aes256CbcDec = cbc::Decryptor<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 decryption_iv = &base64_buffer[..IV_LENGTH];
|
||||||
let mut ciphertext = base64_buffer[IV_LENGTH..].to_vec();
|
let mut ciphertext = base64_buffer[IV_LENGTH..].to_vec();
|
||||||
|
|
||||||
let decrypted_data = Aes256CbcDec::new(KEY.as_bytes().into(), decryption_iv.into())
|
let decrypted_data = Aes256CbcDec::new(&KEY.as_bytes().try_into().unwrap(), decryption_iv.try_into().unwrap())
|
||||||
.decrypt_padded_mut::<Pkcs7>(&mut ciphertext).ok()
|
.decrypt_padded::<Pkcs7>(&mut ciphertext).ok()
|
||||||
.ok_or(String::from("uhoh"))?;
|
.ok_or(String::from("uhoh"))?;
|
||||||
|
|
||||||
Ok(String::from_utf8(decrypted_data.to_vec()).unwrap())
|
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> {
|
pub fn encrypt_packet(input: &str) -> Result<String, String> {
|
||||||
let encryption_iv = generate_random_iv();
|
let encryption_iv = generate_random_iv();
|
||||||
|
|
||||||
let encrypted = Aes256CbcEnc::new(KEY.as_bytes().into(), encryption_iv.as_slice().into())
|
let encrypted = Aes256CbcEnc::new(KEY.as_bytes().try_into().unwrap(), encryption_iv.as_slice().try_into().unwrap())
|
||||||
.encrypt_padded_vec_mut::<Pkcs7>(input.as_bytes());
|
.encrypt_padded_vec::<Pkcs7>(input.as_bytes());
|
||||||
|
|
||||||
let mut result = encryption_iv.to_vec();
|
let mut result = encryption_iv.to_vec();
|
||||||
result.extend_from_slice(&encrypted);
|
result.extend_from_slice(&encrypted);
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ use std::collections::HashMap;
|
|||||||
use sha1::Sha1;
|
use sha1::Sha1;
|
||||||
use substring::Substring;
|
use substring::Substring;
|
||||||
use jzon::{object, JsonValue};
|
use jzon::{object, JsonValue};
|
||||||
use hmac::{Hmac, Mac};
|
use hmac::{Hmac, Mac, KeyInit};
|
||||||
use rusqlite::params;
|
use rusqlite::params;
|
||||||
use lazy_static::lazy_static;
|
use lazy_static::lazy_static;
|
||||||
|
|
||||||
|
|||||||
@@ -277,7 +277,7 @@ fn _a_sha1(t: &str) -> String {
|
|||||||
let mut hasher = Sha1::new();
|
let mut hasher = Sha1::new();
|
||||||
hasher.update(t.as_bytes());
|
hasher.update(t.as_bytes());
|
||||||
let result = hasher.finalize();
|
let result = hasher.finalize();
|
||||||
format!("{:X}", result)
|
hex::encode_upper(result)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn generate_passcode_sha1(transfer_id: String, transfer_code: String) -> String {
|
fn generate_passcode_sha1(transfer_id: String, transfer_code: String) -> String {
|
||||||
|
|||||||
Reference in New Issue
Block a user