(match: BrowserMatch)
| 455 | } |
| 456 | |
| 457 | async function getDerivedKeys(match: BrowserMatch): Promise<Map<string, Buffer>> { |
| 458 | if (match.platform === 'darwin') { |
| 459 | const password = await getMacKeychainPassword(match.browser.keychainService); |
| 460 | return new Map([ |
| 461 | ['v10', getCachedDerivedKey(`darwin:${match.browser.keychainService}:v10`, password, 1003)], |
| 462 | ]); |
| 463 | } |
| 464 | |
| 465 | if (match.platform === 'win32') { |
| 466 | const key = await getWindowsAesKey(match.browser); |
| 467 | return new Map([['v10', key]]); |
| 468 | } |
| 469 | |
| 470 | const keys = new Map<string, Buffer>(); |
| 471 | keys.set('v10', getCachedDerivedKey('linux:v10', 'peanuts', 1)); |
| 472 | |
| 473 | const linuxPassword = await getLinuxSecretPassword(match.browser); |
| 474 | if (linuxPassword) { |
| 475 | keys.set( |
| 476 | 'v11', |
| 477 | getCachedDerivedKey(`linux:${match.browser.keychainService}:v11`, linuxPassword, 1), |
| 478 | ); |
| 479 | } |
| 480 | return keys; |
| 481 | } |
| 482 | |
| 483 | async function getWindowsAesKey(browser: BrowserInfo): Promise<Buffer> { |
| 484 | const cacheKey = `win32:${browser.keychainService}`; |
no test coverage detected