diff options
author | Sebastian <sebasjm@gmail.com> | 2023-12-27 15:59:46 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2023-12-27 15:59:46 -0300 |
commit | 4e6631071e1f69db697334cccba77e09f393507e (patch) | |
tree | 0d81bf73d5bb10fe56d123046626be9da3662582 /packages/taler-util/src/http-client/officer-account.ts | |
parent | 8fb8506b274c07440895c8412586b3745aa8fa1b (diff) | |
download | wallet-core-4e6631071e1f69db697334cccba77e09f393507e.tar.xz |
use seed from exchange
Diffstat (limited to 'packages/taler-util/src/http-client/officer-account.ts')
-rw-r--r-- | packages/taler-util/src/http-client/officer-account.ts | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/packages/taler-util/src/http-client/officer-account.ts b/packages/taler-util/src/http-client/officer-account.ts index 4b2529e20..76477f398 100644 --- a/packages/taler-util/src/http-client/officer-account.ts +++ b/packages/taler-util/src/http-client/officer-account.ts @@ -1,4 +1,5 @@ import { + EncryptionNonce, LockedAccount, OfficerAccount, OfficerId, @@ -10,6 +11,7 @@ import { encodeCrock, encryptWithDerivedKey, getRandomBytesF, + kdf, stringToBytes } from "@gnu-taler/taler-util"; @@ -53,13 +55,19 @@ export async function unlockOfficerAccount( */ export async function createNewOfficerAccount( password: string, + extraNonce: EncryptionNonce, ): Promise<OfficerAccount & { safe: LockedAccount }> { const { eddsaPriv, eddsaPub } = createEddsaKeyPair(); const key = stringToBytes(password); + const localRnd = getRandomBytesF(24) + const mergedRnd: EncryptionNonce = extraNonce ? + kdf(24, extraNonce, localRnd) : + localRnd; + const protectedPrivKey = await encryptWithDerivedKey( - getRandomBytesF(24), + mergedRnd, key, eddsaPriv, password, |