diff options
author | Matthew Miller <matthew@millerti.me> | 2022-12-10 22:40:45 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-10 22:40:45 -0800 |
commit | 461b67c0c6fadfb55c1da6c9c8ab2693ba4c9a03 (patch) | |
tree | ae713d608966ac977390e7bbfbeab5ea79a191bc /packages/server/src/helpers/decodeAuthenticatorExtensions.test.ts | |
parent | 33528afe001d4aca62052dce204c0398c3127ffd (diff) | |
parent | 90dd7f247182329987a8e23f476d9280d8d5c265 (diff) |
Merge pull request #299 from MasterKale/feat/isomorphic
feat/isomorphic
Diffstat (limited to 'packages/server/src/helpers/decodeAuthenticatorExtensions.test.ts')
-rw-r--r-- | packages/server/src/helpers/decodeAuthenticatorExtensions.test.ts | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/packages/server/src/helpers/decodeAuthenticatorExtensions.test.ts b/packages/server/src/helpers/decodeAuthenticatorExtensions.test.ts index b9e66b5..6cc5e24 100644 --- a/packages/server/src/helpers/decodeAuthenticatorExtensions.test.ts +++ b/packages/server/src/helpers/decodeAuthenticatorExtensions.test.ts @@ -1,30 +1,28 @@ import { decodeAuthenticatorExtensions } from './decodeAuthenticatorExtensions'; +import { isoUint8Array } from './iso'; test('should decode authenticator extensions', () => { const extensions = decodeAuthenticatorExtensions( - Buffer.from( + isoUint8Array.fromHex( 'A16C6465766963655075624B6579A56364706B584DA5010203262001215820991AABED9D' + - 'E4271A9EDEAD8806F9DC96D6DCCD0C476253A5510489EC8379BE5B225820A0973CFDEDBB' + - '79E27FEF4EE7481673FB3312504DDCA5434CFD23431D6AD29EDA63736967584730450221' + - '00EFB38074BD15B8C82CF09F87FBC6FB3C7169EA4F1806B7E90937374302345B7A02202B' + - '7113040731A0E727D338D48542863CE65880AA79E5EA740AC8CCD94347988E656E6F6E63' + - '65406573636F70654100666161677569645000000000000000000000000000000000', - 'hex', + 'E4271A9EDEAD8806F9DC96D6DCCD0C476253A5510489EC8379BE5B225820A0973CFDEDBB' + + '79E27FEF4EE7481673FB3312504DDCA5434CFD23431D6AD29EDA63736967584730450221' + + '00EFB38074BD15B8C82CF09F87FBC6FB3C7169EA4F1806B7E90937374302345B7A02202B' + + '7113040731A0E727D338D48542863CE65880AA79E5EA740AC8CCD94347988E656E6F6E63' + + '65406573636F70654100666161677569645000000000000000000000000000000000', ), ); expect(extensions).toMatchObject({ devicePubKey: { - dpk: Buffer.from( + dpk: isoUint8Array.fromHex( 'A5010203262001215820991AABED9DE4271A9EDEAD8806F9DC96D6DCCD0C476253A5510489EC8379BE5B225820A0973CFDEDBB79E27FEF4EE7481673FB3312504DDCA5434CFD23431D6AD29EDA', - 'hex', ), - sig: Buffer.from( + sig: isoUint8Array.fromHex( '3045022100EFB38074BD15B8C82CF09F87FBC6FB3C7169EA4F1806B7E90937374302345B7A02202B7113040731A0E727D338D48542863CE65880AA79E5EA740AC8CCD94347988E', - 'hex', ), - nonce: Buffer.from('', 'hex'), - scope: Buffer.from('00', 'hex'), - aaguid: Buffer.from('00000000000000000000000000000000', 'hex'), + nonce: isoUint8Array.fromHex(''), + scope: isoUint8Array.fromHex('00'), + aaguid: isoUint8Array.fromHex('00000000000000000000000000000000'), }, }); }); |