This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The code below was largely taken from: | |
// https://github.com/strangerlabs/webauthn/blob/9959cb2b5f87692b8b1fecd799dd4029a3bf61b1/src/Webauthn.js#L501 | |
const crypto = require("crypto"); | |
const base64url = require("base64url"); | |
const cbor = require("cbor"); | |
function parseAttestationObject(attestationObject) { | |
const attestationObjectBuffer = base64url.toBuffer(attestationObject); | |
return cbor.decodeAllSync(attestationObjectBuffer)[0]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Source of https://www.npmjs.com/package/physical-cpu-count | |
'use strict' | |
const os = require('os') | |
const childProcess = require('child_process') | |
function exec (command) { | |
const output = childProcess.execSync(command, {encoding: 'utf8'}) | |
return output |