mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-08 17:19:48 +01:00
Clear passwords that don't decrypt (#159506)
If a password is not decrypted properly, then it should be removed from the secret storage because it's essentially dead. Fixes #151654
This commit is contained in:
committed by
GitHub
parent
1715e06bb2
commit
0d690b3a8f
@@ -65,9 +65,17 @@ export class MainThreadSecretState extends Disposable implements MainThreadSecre
|
||||
if (value.extensionId === extensionId) {
|
||||
return value.content;
|
||||
}
|
||||
} catch (e) {
|
||||
this.logService.error(e);
|
||||
throw new Error('Cannot get password');
|
||||
} catch (parseError) {
|
||||
this.logService.error(parseError);
|
||||
|
||||
// If we can't parse the decrypted value, then it's not a valid secret so we should try to delete it
|
||||
try {
|
||||
await this.credentialsService.deletePassword(fullKey, key);
|
||||
} catch (e) {
|
||||
this.logService.error(e);
|
||||
}
|
||||
|
||||
throw new Error('Unable to parse decrypted password');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user