Skip to content

Commit

Permalink
fix null OAuthToken field in SDA accounts causing migrations to crash…
Browse files Browse the repository at this point in the history
… and burn (#227)
  • Loading branch information
dyc3 authored Jun 25, 2023
1 parent 93a5fe6 commit d2ba7d8
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/accountmanager/legacy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ pub struct Session {
#[serde(default, rename = "WebCookie")]
pub web_cookie: Option<String>,
#[serde(default, rename = "OAuthToken")]
pub token: String,
pub token: Option<String>,
#[serde(rename = "SteamID")]
pub steam_id: u64,
}
Expand Down
4 changes: 4 additions & 0 deletions src/accountmanager/migrate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,10 @@ mod tests {
manifest: "src/fixtures/maFiles/compat/no-webcookie/manifest.json",
passkey: None,
},
Test {
manifest: "src/fixtures/maFiles/compat/null-oauthtoken/manifest.json",
passkey: None,
},
];
for case in cases {
eprintln!("testing: {:?}", case);
Expand Down
17 changes: 17 additions & 0 deletions src/fixtures/maFiles/compat/null-oauthtoken/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"encrypted": false,
"first_run": true,
"entries": [
{
"encryption_iv": null,
"encryption_salt": null,
"filename": "nulloauthtoken.maFile",
"steamid": 1234
}
],
"periodic_checking": false,
"periodic_checking_interval": 5,
"periodic_checking_checkall": false,
"auto_confirm_market_transactions": false,
"auto_confirm_trades": false
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"shared_secret":"zvIayp3JPvtvX/QGHqsqKBk/44s=","serial_number":"kljasfhds","revocation_code":"R12345","uri":"otpauth://totp/Steam:example?secret=ASDF&issuer=Steam","server_time":1602522478,"account_name":"example","token_gid":"jkkjlhkhjgf","identity_secret":"kjsdlwowiqe=","secret_1":"sklduhfgsdlkjhf=","status":1,"device_id":"android:99d2ad0e-4bad-4247-b111-26393aae0be3","fully_enrolled":true,"Session":{"SessionID":"a;lskdjf","SteamLogin":"983498437543","SteamLoginSecure":"dlkjdsl;j%7C%32984730298","WebCookie":"asdk;lf;dsjlkfd","OAuthToken":null,"SteamID":1234}}

0 comments on commit d2ba7d8

Please sign in to comment.