Merge pull request 'Update Rust crate sha2 to 0.11.0' (#32) from renovate/sha2-0.x into main
Some checks failed
Build and Test / account (push) Has been cancelled
Some checks failed
Build and Test / account (push) Has been cancelled
Reviewed-on: #32
This commit is contained in:
commit
bd85e5905d
4 changed files with 35 additions and 30 deletions
39
Cargo.lock
generated
39
Cargo.lock
generated
|
|
@ -34,14 +34,14 @@ dependencies = [
|
|||
"p256",
|
||||
"prost",
|
||||
"quick-xml",
|
||||
"rand 0.8.5",
|
||||
"rand 0.10.1",
|
||||
"reqwest",
|
||||
"rocket",
|
||||
"rocket_cors",
|
||||
"sentry",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"sha2",
|
||||
"sha2 0.11.0",
|
||||
"sha256",
|
||||
"sqlx",
|
||||
"thiserror 2.0.18",
|
||||
|
|
@ -607,12 +607,6 @@ version = "1.0.0"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
|
||||
|
||||
[[package]]
|
||||
name = "cfg_aliases"
|
||||
version = "0.2.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724"
|
||||
|
||||
[[package]]
|
||||
name = "chacha20"
|
||||
version = "0.10.0"
|
||||
|
|
@ -989,7 +983,7 @@ dependencies = [
|
|||
"num-traits",
|
||||
"pkcs8",
|
||||
"rfc6979",
|
||||
"sha2",
|
||||
"sha2 0.10.9",
|
||||
"signature",
|
||||
"zeroize",
|
||||
]
|
||||
|
|
@ -2142,7 +2136,7 @@ dependencies = [
|
|||
"ecdsa",
|
||||
"elliptic-curve",
|
||||
"once_cell",
|
||||
"sha2",
|
||||
"sha2 0.10.9",
|
||||
"signature",
|
||||
]
|
||||
|
||||
|
|
@ -2565,7 +2559,7 @@ dependencies = [
|
|||
"ecdsa",
|
||||
"elliptic-curve",
|
||||
"primeorder",
|
||||
"sha2",
|
||||
"sha2 0.10.9",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
@ -3634,6 +3628,17 @@ dependencies = [
|
|||
"digest 0.10.7",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "sha2"
|
||||
version = "0.11.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "446ba717509524cb3f22f17ecc096f10f4822d76ab5c0b9822c5f9c284e825f4"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"cpufeatures 0.3.0",
|
||||
"digest 0.11.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "sha256"
|
||||
version = "1.6.0"
|
||||
|
|
@ -3643,7 +3648,7 @@ dependencies = [
|
|||
"async-trait",
|
||||
"bytes",
|
||||
"hex",
|
||||
"sha2",
|
||||
"sha2 0.10.9",
|
||||
"tokio",
|
||||
]
|
||||
|
||||
|
|
@ -3795,7 +3800,7 @@ dependencies = [
|
|||
"percent-encoding",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"sha2",
|
||||
"sha2 0.10.9",
|
||||
"smallvec",
|
||||
"thiserror 2.0.18",
|
||||
"tokio",
|
||||
|
|
@ -3832,7 +3837,7 @@ dependencies = [
|
|||
"quote",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"sha2",
|
||||
"sha2 0.10.9",
|
||||
"sqlx-core",
|
||||
"sqlx-mysql",
|
||||
"sqlx-postgres",
|
||||
|
|
@ -3875,8 +3880,8 @@ dependencies = [
|
|||
"rand 0.8.5",
|
||||
"rsa",
|
||||
"serde",
|
||||
"sha1 0.10.6",
|
||||
"sha2",
|
||||
"sha1",
|
||||
"sha2 0.10.9",
|
||||
"smallvec",
|
||||
"sqlx-core",
|
||||
"stringprep",
|
||||
|
|
@ -3915,7 +3920,7 @@ dependencies = [
|
|||
"rand 0.8.5",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"sha2",
|
||||
"sha2 0.10.9",
|
||||
"smallvec",
|
||||
"sqlx-core",
|
||||
"stringprep",
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ once_cell = "1.20.3"
|
|||
serde_json = "1.0.139"
|
||||
chrono = { version = "0.4.39", features = ["serde"] }
|
||||
argon2 = "0.5.3"
|
||||
sha2 = "0.10.8"
|
||||
sha2 = "0.11.0"
|
||||
bytemuck = { version = "1.21.0", features = ["derive"] }
|
||||
base64 = "0.22.1"
|
||||
hex = "0.4.3"
|
||||
|
|
@ -45,7 +45,7 @@ juniper_rocket = "0.10.0"
|
|||
|
||||
prost = "0.14.0"
|
||||
lettre = "0.11.15"
|
||||
rand = "0.8.5"
|
||||
rand = { version = "0.10.0", features = ["std"] }
|
||||
reqwest = "0.13.0"
|
||||
binrw = "0.15.1"
|
||||
ecdsa = { version = "0.16.9", features = ["pem", "std", "verifying"] }
|
||||
|
|
@ -55,4 +55,4 @@ k256 = "0.13.4"
|
|||
dsa = "0.6.3"
|
||||
openssl = "0.10.78"
|
||||
time = "0.3.47"
|
||||
hickory-resolver = { version = "0.24", features = ["tokio-runtime"] }
|
||||
hickory-resolver = { version = "0.24", features = ["tokio-runtime"] }
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ use openssl::ecdsa::EcdsaSig;
|
|||
use openssl::error::ErrorStack;
|
||||
use openssl::nid::Nid;
|
||||
use openssl::pkey::Public;
|
||||
use rand::Rng;
|
||||
use rand::prelude::*;
|
||||
use rocket::http::Status;
|
||||
use rocket::request::{FromRequest, Outcome};
|
||||
use rocket::{Request, async_trait};
|
||||
|
|
@ -81,9 +81,9 @@ pub struct _CertificatePid {
|
|||
fn generate_nintendo_hash(pid: i32, text_password: &str) -> String {
|
||||
let mut sha = Sha256::new();
|
||||
|
||||
sha.write_all(&bytes_of(&pid)).unwrap();
|
||||
sha.write_all(&[0x02, 0x65, 0x43, 0x46]).unwrap();
|
||||
sha.write_all(text_password.as_bytes()).unwrap();
|
||||
sha.update(&bytes_of(&pid));
|
||||
sha.update(&[0x02, 0x65, 0x43, 0x46]);
|
||||
sha.update(text_password.as_bytes());
|
||||
|
||||
hex::encode(&sha.finalize()[..])
|
||||
}
|
||||
|
|
@ -193,18 +193,18 @@ pub async fn read_bearer_auth_token(connection: &Pool, token: &str) -> Option<Us
|
|||
}
|
||||
|
||||
pub fn generate_nex_password() -> String {
|
||||
let mut rng = rand::thread_rng();
|
||||
let mut rng = rand::rng();
|
||||
let mut output = String::with_capacity(16);
|
||||
|
||||
while output.len() < 16 {
|
||||
let offset: u8 = rng.gen_range(0..62);
|
||||
let offset: u8 = rng.random_range(0..62);
|
||||
|
||||
let character = if offset < 10 {
|
||||
(offset + b'0') as char
|
||||
} else if offset < 36 {
|
||||
(offset + 55) as char
|
||||
(offset + 55) as char // A-Z
|
||||
} else {
|
||||
(offset + 61) as char
|
||||
(offset + 61) as char // a-z
|
||||
};
|
||||
|
||||
output.push(character);
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ use crate::nnid::timezones::{OFFSET_FROM_TIMEZONE};
|
|||
use crate::Pool;
|
||||
use crate::xml::{Xml, YesNoVal};
|
||||
use crate::email::send_verification_email;
|
||||
use rand::Rng;
|
||||
use rand::prelude::*;
|
||||
// Not in use currently.
|
||||
//use mii::{get_image_png, get_image_tga};
|
||||
use crate::mii_util::get_mii_img_url;
|
||||
|
|
@ -118,7 +118,7 @@ pub async fn create_account(database: &State<Pool>, data: Xml<AccountCreationDat
|
|||
|
||||
let pid = next_pid(database).await;
|
||||
|
||||
let verification_code: i32 = rand::thread_rng().gen_range(100_000..1_000_000);
|
||||
let verification_code: i32 = rand::rng().random_range(100_000..1_000_000);
|
||||
|
||||
let AccountCreationData {
|
||||
user_id,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue