Skip to content

Commit

Permalink
fix(askar): default key derivation method (#1420)
Browse files Browse the repository at this point in the history
Signed-off-by: Timo Glastra <[email protected]>
  • Loading branch information
TimoGlastra authored Apr 4, 2023
1 parent fe10fb4 commit 7b59629
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/askar/src/wallet/AskarWallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ export class AskarWallet implements Wallet {
if (rekey) {
await this._store.rekey({
passKey: rekey,
keyMethod: keyDerivationMethodToStoreKeyMethod(rekeyDerivation ?? KeyDerivationMethod.Argon2IInt),
keyMethod: keyDerivationMethodToStoreKeyMethod(rekeyDerivation ?? KeyDerivationMethod.Argon2IMod),
})
}
this._session = await this._store.openSession()
Expand Down Expand Up @@ -823,7 +823,7 @@ export class AskarWallet implements Wallet {
profile: walletConfig.id,
// FIXME: Default derivation method should be set somewhere in either agent config or some constants
keyMethod: keyDerivationMethodToStoreKeyMethod(
walletConfig.keyDerivationMethod ?? KeyDerivationMethod.Argon2IInt
walletConfig.keyDerivationMethod ?? KeyDerivationMethod.Argon2IMod
),
passKey: walletConfig.key,
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export class IndySdkToAskarMigrationUpdater {
*/
private async migrate() {
const specUri = this.backupFile
const kdfLevel = this.walletConfig.keyDerivationMethod ?? 'ARGON2I_MOD'
const kdfLevel = this.walletConfig.keyDerivationMethod ?? KeyDerivationMethod.Argon2IMod
const walletName = this.walletConfig.id
const walletKey = this.walletConfig.key
const storageType = this.walletConfig.storage?.type ?? 'sqlite'
Expand Down Expand Up @@ -205,7 +205,7 @@ export class IndySdkToAskarMigrationUpdater {
await this.migrate()

const keyMethod = keyDerivationMethodToStoreKeyMethod(
this.walletConfig.keyDerivationMethod ?? KeyDerivationMethod.Argon2IInt
this.walletConfig.keyDerivationMethod ?? KeyDerivationMethod.Argon2IMod
)
this.store = await Store.open({ uri: `sqlite://${this.backupFile}`, passKey: this.walletConfig.key, keyMethod })

Expand Down

0 comments on commit 7b59629

Please sign in to comment.