Skip to content

Commit

Permalink
Update filenames and clear seedPassphrase in the right place
Browse files Browse the repository at this point in the history
  • Loading branch information
robbiecarlton committed Sep 27, 2024
1 parent 17db038 commit 6c3e707
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions gen-web/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@
passwordCheckInputArea: document.querySelector('#password-check-form-item'),
formErrorMessage: document.querySelector('#form-error-message'),
downloadFileName: document.querySelector('#download-file'),
downloadFileNameAgain: document.querySelector('#download-file-again'),
backupDownloadFileName: document.querySelector('#backup-download-file'),
}

const nextButtonLoaderColumn = document.querySelector('#next-button-loader-column')
Expand Down Expand Up @@ -225,9 +227,6 @@
// we need the passphrase as a Uint8Array
const pw = (new TextEncoder()).encode(seedPassphrase)

// clear passphrase from memory
seedPassphrase = null

revocation = master.derive(REVOCATION_KEY_DEVICE_NUMBER, {
bundleType: 'revocation'
})
Expand Down Expand Up @@ -457,6 +456,8 @@
}
} else if (stepTracker === 5) {
inlineVariables.downloadFileName.innerHTML = genConfigFileName(deviceID)
inlineVariables.downloadFileNameAgain.innerHTML = genConfigFileName(deviceID)
inlineVariables.backupDownloadFileName.innerHTML = genConfigFileName(deviceID, { isBackup: true })
verifyDownloadComplete()
}
}
Expand Down Expand Up @@ -592,6 +593,10 @@

// clear our secrets
deviceRoot.zero()

// clear passphrase from memory
seedPassphrase = null

} catch (e) {
inlineVariables.formErrorMessage.innerHTML = errorMessages.generateConfig
throw new Error(`Error executing generateBlob with an error. Error: ${e}`)
Expand Down

0 comments on commit 6c3e707

Please sign in to comment.