Skip to content

Commit 0d8de96

Browse files
njlieNathan Lie
and
Nathan Lie
authored
feat(auth): update interaction hash method (interledger#1908)
Co-authored-by: Nathan Lie <[email protected]>
1 parent 5715d4c commit 0d8de96

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packages/auth/src/interaction/routes.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ describe('Interaction Routes', (): void => {
295295
const grantRequestUrl = config.authServerDomain + `/`
296296

297297
const data = `${clientNonce}\n${interactNonce}\n${interactRef}\n${grantRequestUrl}`
298-
const hash = crypto.createHash('sha3-512').update(data).digest('base64')
298+
const hash = crypto.createHash('sha-256').update(data).digest('base64')
299299
clientRedirectUri.searchParams.set('hash', hash)
300300
assert.ok(interactRef)
301301
clientRedirectUri.searchParams.set('interact_ref', interactRef)

packages/auth/src/interaction/routes.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ async function finishInteraction(
256256
// https://datatracker.ietf.org/doc/html/draft-ietf-gnap-core-protocol#section-4.2.3
257257
const data = `${clientNonce}\n${interactNonce}\n${interactRef}\n${grantRequestUrl}`
258258

259-
const hash = crypto.createHash('sha3-512').update(data).digest('base64')
259+
const hash = crypto.createHash('sha-256').update(data).digest('base64')
260260
clientRedirectUri.searchParams.set('hash', hash)
261261
clientRedirectUri.searchParams.set('interact_ref', interactRef)
262262
ctx.redirect(clientRedirectUri.toString())

0 commit comments

Comments
 (0)