diff options
author | Matthew Miller <matthew@millerti.me> | 2022-07-28 10:15:46 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-28 10:15:46 -0700 |
commit | 9e260901cf3ae69b40f50b7a1fd4ac5388186a08 (patch) | |
tree | f7fe58214818bae6bec73a759087cf3d4a53c1a7 /packages/server/src/helpers/parseAuthenticatorData.ts | |
parent | 522f00d9ae613ff1f51f0c1aca85a6ae129381c5 (diff) | |
parent | 2b9f082fc129566b97ec6f72cf390c25f55647ac (diff) |
Merge pull request #232 from MasterKale/linting-catch-up
Run `npm run lint`
Diffstat (limited to 'packages/server/src/helpers/parseAuthenticatorData.ts')
-rw-r--r-- | packages/server/src/helpers/parseAuthenticatorData.ts | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/packages/server/src/helpers/parseAuthenticatorData.ts b/packages/server/src/helpers/parseAuthenticatorData.ts index b130a5e..c2128e0 100644 --- a/packages/server/src/helpers/parseAuthenticatorData.ts +++ b/packages/server/src/helpers/parseAuthenticatorData.ts @@ -1,6 +1,9 @@ import cbor from 'cbor'; import { decodeCborFirst } from './decodeCbor'; -import { decodeAuthenticatorExtensions, AuthenticationExtensionsAuthenticatorOutputs } from './decodeAuthenticatorExtensions'; +import { + decodeAuthenticatorExtensions, + AuthenticationExtensionsAuthenticatorOutputs, +} from './decodeAuthenticatorExtensions'; /** * Make sense of the authData buffer contained in an Attestation @@ -22,12 +25,12 @@ export function parseAuthenticatorData(authData: Buffer): ParsedAuthenticatorDat // Bit positions can be referenced here: // https://www.w3.org/TR/webauthn-2/#flags const flags = { - up: !!(flagsInt & 1 << 0), // User Presence - uv: !!(flagsInt & 1 << 2), // User Verified - be: !!(flagsInt & 1 << 3), // Backup Eligibility - bs: !!(flagsInt & 1 << 4), // Backup State - at: !!(flagsInt & 1 << 6), // Attested Credential Data Present - ed: !!(flagsInt & 1 << 7), // Extension Data Present + up: !!(flagsInt & (1 << 0)), // User Presence + uv: !!(flagsInt & (1 << 2)), // User Verified + be: !!(flagsInt & (1 << 3)), // Backup Eligibility + bs: !!(flagsInt & (1 << 4)), // Backup State + at: !!(flagsInt & (1 << 6)), // Attested Credential Data Present + ed: !!(flagsInt & (1 << 7)), // Extension Data Present flagsInt, }; |