Slobodan Pejic has uploaded the change for review![Open in Gerrit]()
Commit message
Add getCoseKeyType - missing function in secure payment confirmation.
Bug: 474614620
Change-Id: I7d1cb5bbefbeb63958434f3ff8147b7c67743aa4
Change diff
diff --git a/third_party/blink/web_tests/external/wpt/secure-payment-confirmation/utils-bbk.js b/third_party/blink/web_tests/external/wpt/secure-payment-confirmation/utils-bbk.js
index 45f7db1..aaf5774 100644
--- a/third_party/blink/web_tests/external/wpt/secure-payment-confirmation/utils-bbk.js
+++ b/third_party/blink/web_tests/external/wpt/secure-payment-confirmation/utils-bbk.js
@@ -9,6 +9,16 @@
return Uint8Array.from(base64urlDecode(encoded), c => c.charCodeAt(0));
}
+// Given the Uint8Array of the encoded CoseKey return the key type. Key types
+// are enumerated in https://www.iana.org/assignments/cose/cose.xhtml#key-type
+function getCoseKeyType(encodedCoseKey) {
+ const parsed = new Cbor(encodedCoseKey);
+ const cbor = parsed.getCBOR();
+ // The index 1 represents the key type, see
+ // https://www.iana.org/assignments/cose/cose.xhtml#key-common-parameters
+ return cbor[1];
+}
+
// The result of a browser bound key verification.
const BrowserBoundKeyVerificationResult = Object.freeze({
// No browser bound key was included.
Change information
Files:
- M third_party/blink/web_tests/external/wpt/secure-payment-confirmation/utils-bbk.js
Change size: S
Delta: 1 file changed, 10 insertions(+), 0 deletions(-)
Open in GerritRelated details
Attention set is empty
Gerrit-MessageType: newchange
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I7d1cb5bbefbeb63958434f3ff8147b7c67743aa4
Gerrit-Change-Number: 7418545
Gerrit-PatchSet: 1