forked from mozilla/gecko-dev
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Backed out 2 changesets (bug 1816519, bug 1816520) for causing build …
…bustages on WinWebAuthnManager.cpp. CLOSED TREE Backed out changeset 1bae007bf17b (bug 1816520) Backed out changeset 96cdbead4d15 (bug 1816519)
- Loading branch information
Iulian Moraru
committed
Aug 31, 2023
1 parent
0a738f2
commit 6fa14be
Showing
26 changed files
with
805 additions
and
243 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ | ||
/* vim: set ts=8 sts=2 et sw=2 tw=80: */ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
* You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
||
#include "cbor-cpp/src/cbor.h" | ||
#include "mozilla/dom/WebAuthnCBORUtil.h" | ||
#include "mozilla/dom/WebAuthnUtil.h" | ||
|
||
namespace mozilla::dom { | ||
|
||
nsresult CBOREncodeNoneAttestationObj(const CryptoBuffer& aAuthDataBuf, | ||
/* out */ CryptoBuffer& aAttestationObj) { | ||
/* | ||
Attestation Object, encoded in CBOR (description is CDDL) | ||
$$attStmtType //= ( | ||
fmt: "none", | ||
attStmt: emptyMap | ||
) | ||
emptyMap = {} | ||
*/ | ||
cbor::output_dynamic cborAttOut; | ||
cbor::encoder encoder(cborAttOut); | ||
encoder.write_map(3); | ||
{ | ||
encoder.write_string("fmt"); | ||
encoder.write_string("none"); | ||
|
||
encoder.write_string("attStmt"); | ||
encoder.write_map(0); | ||
|
||
encoder.write_string("authData"); | ||
encoder.write_bytes(aAuthDataBuf.Elements(), aAuthDataBuf.Length()); | ||
} | ||
|
||
if (!aAttestationObj.Assign(cborAttOut.data(), cborAttOut.size())) { | ||
return NS_ERROR_OUT_OF_MEMORY; | ||
} | ||
return NS_OK; | ||
} | ||
|
||
} // namespace mozilla::dom |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ | ||
/* vim: set ts=8 sts=2 et sw=2 tw=80: */ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
||
#ifndef mozilla_dom_WebAuthnCBORUtil_h | ||
#define mozilla_dom_WebAuthnCBORUtil_h | ||
|
||
/* | ||
* Serialize and deserialize CBOR data formats for WebAuthn | ||
*/ | ||
|
||
#include "mozilla/dom/CryptoBuffer.h" | ||
|
||
namespace mozilla::dom { | ||
|
||
nsresult CBOREncodeNoneAttestationObj(const CryptoBuffer& aAuthDataBuf, | ||
/* out */ CryptoBuffer& aAttestationObj); | ||
|
||
} // namespace mozilla::dom | ||
#endif // mozilla_dom_WebAuthnCBORUtil_h |
This file contains 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
This file contains 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
Oops, something went wrong.