Skip to content

Commit

Permalink
Merge pull request #596 from xmtp/np/fix-hmac-address-null
Browse files Browse the repository at this point in the history
fix: HMAC keys correctly fetch address so that keys are correct
  • Loading branch information
nplasterer authored Apr 19, 2024
2 parents e5fe7f0 + 7e7b659 commit 0469a1c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/keystore/InMemoryKeystore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ export default class InMemoryKeystore implements KeystoreInterface {
const thirtyDayPeriodsSinceEpoch = Math.floor(
Date.now() / 1000 / 60 / 60 / 24 / 30
)
const info = `${thirtyDayPeriodsSinceEpoch}-${this.accountAddress}`
const info = `${thirtyDayPeriodsSinceEpoch}-${await this.getAccountAddress()}`
const hmac = await generateHmacSignature(
keyMaterial,
new TextEncoder().encode(info),
Expand Down Expand Up @@ -631,7 +631,7 @@ export default class InMemoryKeystore implements KeystoreInterface {
thirtyDayPeriodsSinceEpoch,
thirtyDayPeriodsSinceEpoch + 1,
].map(async (value) => {
const info = `${value}-${this.accountAddress}`
const info = `${value}-${await this.getAccountAddress()}`
const hmacKey = await hkdfHmacKey(
keyMaterial,
new TextEncoder().encode(info)
Expand Down

0 comments on commit 0469a1c

Please sign in to comment.