Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 38fbeee

Browse files
author
curtain
committed
trace: add cookie decrypt trace log
1 parent de33c69 commit 38fbeee

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

‎src/plugins/chrome.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,15 @@ pub fn cookies() -> Result<Ident, crate::Error> {
6767
.load::<Cookies>(&conn)
6868
.expect("Loading cookies from google chrome failed.");
6969

70-
debug!("res {:?}", &res);
70+
// debug!("res {:?}", &res);
7171
if res.is_empty() {
7272
return Err(crate::Error::CookieError);
7373
}
7474

7575
// Get system password
7676
let ring = Entry::new("Chrome Safe Storage", "Chrome");
7777
let pass = ring.get_password().expect("Get Password failed");
78+
debug!("pass {}", pass);
7879

7980
// Decode cookies
8081
let mut m: HashMap<String, String> = HashMap::new();
@@ -129,6 +130,7 @@ fn decode_cookies(pass: &str, v: Vec<u8>) -> Result<String, crate::Error> {
129130

130131
/// Decrypt chrome cookie value with aes-128-cbc
131132
fn chrome_decrypt(v: Vec<u8>, key: [u8; 16]) -> Result<String, crate::Error> {
133+
trace!("key {:?}", key);
132134
// <space>: \u16
133135
let iv = vec![32_u8; 16];
134136
let mut decrypter = symm::Crypter::new(
@@ -148,5 +150,9 @@ fn chrome_decrypt(v: Vec<u8>, key: [u8; 16]) -> Result<String, crate::Error> {
148150
decrypter.finalize(&mut plaintext[count..])?;
149151
plaintext.retain(|x| x >= &20_u8);
150152

151-
Ok(String::from_utf8_lossy(&plaintext.to_vec()).to_string())
153+
let res = String::from_utf8_lossy(&plaintext.to_vec()).to_string();
154+
155+
trace!("decrypt result {}", res);
156+
157+
Ok(res)
152158
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /