hash the guest user password
All checks were successful
Build and Test / wii-sports-club (push) Successful in 4m7s
Build and Test / minecraft-wiiu (push) Successful in 4m16s
Build and Test / fast-racing-neo (push) Successful in 4m25s
Build and Test / mario-tennis (push) Successful in 4m27s
Build and Test / sonic-transformed (push) Successful in 4m31s
Build and Test / wii-u-chat (push) Successful in 4m33s
Build and Test / puyopuyo (push) Successful in 4m40s
Build and Test / friends (push) Successful in 4m47s
Build and Test / splatoon (push) Successful in 4m49s
Build and Test / splatoon-testfire (push) Successful in 4m51s
Build and Test / super-mario-maker (push) Successful in 5m10s
All checks were successful
Build and Test / wii-sports-club (push) Successful in 4m7s
Build and Test / minecraft-wiiu (push) Successful in 4m16s
Build and Test / fast-racing-neo (push) Successful in 4m25s
Build and Test / mario-tennis (push) Successful in 4m27s
Build and Test / sonic-transformed (push) Successful in 4m31s
Build and Test / wii-u-chat (push) Successful in 4m33s
Build and Test / puyopuyo (push) Successful in 4m40s
Build and Test / friends (push) Successful in 4m47s
Build and Test / splatoon (push) Successful in 4m49s
Build and Test / splatoon-testfire (push) Successful in 4m51s
Build and Test / super-mario-maker (push) Successful in 5m10s
This commit is contained in:
parent
db6589d361
commit
96a8bbe470
1 changed files with 33 additions and 2 deletions
|
|
@ -1,3 +1,4 @@
|
|||
use md5::{Digest, Md5};
|
||||
use macros::RmcSerialize;
|
||||
|
||||
use rnex_core::PID;
|
||||
|
|
@ -11,16 +12,46 @@ pub struct Account {
|
|||
|
||||
impl Account {
|
||||
pub fn new(pid: PID, username: &str, passwd: &str) -> Self {
|
||||
let iteration_count = 65000;
|
||||
// we do one iteration out here to ensure the key is always 16 bytes
|
||||
|
||||
let mut key: [u8; 16] = {
|
||||
let mut md5 = Md5::new();
|
||||
md5.update(passwd);
|
||||
md5.finalize().try_into().unwrap()
|
||||
};
|
||||
|
||||
for _ in 1..iteration_count {
|
||||
let mut md5 = Md5::new();
|
||||
md5.update(key);
|
||||
key = md5.finalize().try_into().unwrap();
|
||||
}
|
||||
|
||||
Self {
|
||||
kerbros_password: passwd.as_bytes().into(),
|
||||
kerbros_password: key.into(),
|
||||
username: username.into(),
|
||||
pid,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn new_raw_password(pid: PID, username: &str, passwd: &[u8]) -> Self {
|
||||
let iteration_count = 65000;
|
||||
// we do one iteration out here to ensure the key is always 16 bytes
|
||||
|
||||
let mut key: [u8; 16] = {
|
||||
let mut md5 = Md5::new();
|
||||
md5.update(passwd);
|
||||
md5.finalize().try_into().unwrap()
|
||||
};
|
||||
|
||||
for _ in 1..iteration_count {
|
||||
let mut md5 = Md5::new();
|
||||
md5.update(key);
|
||||
key = md5.finalize().try_into().unwrap();
|
||||
}
|
||||
|
||||
Self {
|
||||
kerbros_password: passwd.into(),
|
||||
kerbros_password: key.into(),
|
||||
username: username.into(),
|
||||
pid,
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue