mirror of
https://git.eta.st/eta/rsp6-decoder.git
synced 2024-11-21 15:05:41 +00:00
parse magic and reference
This commit is contained in:
parent
d1de3f3137
commit
18f0d19e6b
11
src/main.rs
11
src/main.rs
@ -57,7 +57,18 @@ fn main() -> anyhow::Result<()> {
|
||||
println!("[+] Loaded {} public keys!", iks.keys.len());
|
||||
println!("[+] Reading ticket.dat...");
|
||||
let ticket = fs::read_to_string("./ticket.dat")?;
|
||||
if ticket.len() < 16 {
|
||||
return Err(anyhow!("ticket too short"));
|
||||
}
|
||||
if &ticket[0..2] != "06" {
|
||||
return Err(anyhow!(
|
||||
"ticket isn't a RSP6 ticket: magic was {}",
|
||||
&ticket[0..2]
|
||||
));
|
||||
}
|
||||
let issuer_id = &ticket[13..15];
|
||||
let ticket_reference = format!("{}{}", issuer_id, &ticket[2..11]);
|
||||
println!("[+] RSP6 ticket, reference {}", ticket_reference);
|
||||
println!("[+] Ticket issuer: {}", issuer_id);
|
||||
let ticket = base26_decode(&ticket[15..]);
|
||||
let keys = iks
|
||||
|
Loading…
Reference in New Issue
Block a user