mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2024-12-23 05:42:13 +03:00
More WebAuthn/FIDO2 server fixes.
This commit is contained in:
parent
4561468b05
commit
d63639fc62
@ -2022,8 +2022,10 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
|
|||||||
clientAttestationResponse.response.clientDataJSON = new Uint8Array(Buffer.from(clientAttestationResponse.response.clientDataJSON, 'base64')).buffer;
|
clientAttestationResponse.response.clientDataJSON = new Uint8Array(Buffer.from(clientAttestationResponse.response.clientDataJSON, 'base64')).buffer;
|
||||||
|
|
||||||
parent.f2l.attestationResult(clientAttestationResponse, attestationExpectations).then(function (regResult) {
|
parent.f2l.attestationResult(clientAttestationResponse, attestationExpectations).then(function (regResult) {
|
||||||
// If we register a WebAuthn/FIDO2 key, remove all U2F keys.
|
// Since we are registering a WebAuthn/FIDO2 key, remove all U2F keys (Type 1).
|
||||||
// TODO
|
var otphkeys2 = [];
|
||||||
|
for (var i = 0; i < user.otphkeys.length; i++) { if (user.otphkeys[i].type != 1) { otphkeys2.push(user.otphkeys[i]); } }
|
||||||
|
user.otphkeys = otphkeys2;
|
||||||
|
|
||||||
// Add the new WebAuthn/FIDO2 keys
|
// Add the new WebAuthn/FIDO2 keys
|
||||||
var keyIndex = parent.crypto.randomBytes(4).readUInt32BE(0);
|
var keyIndex = parent.crypto.randomBytes(4).readUInt32BE(0);
|
||||||
|
Loading…
Reference in New Issue
Block a user