Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(91)

Unified Diff: components/webcrypto/algorithms/ec.h

Issue 2163053002: [webcrypto] Check for empty key usages *after* key creation rather than before, to match the spec's… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/webcrypto/algorithms/asymmetric_key_util.cc ('k') | components/webcrypto/algorithms/ec.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/webcrypto/algorithms/ec.h
diff --git a/components/webcrypto/algorithms/ec.h b/components/webcrypto/algorithms/ec.h
index 1e9bd3e8b505dec5bde577905f1a7c13264eae1b..1484ad8114dbe1d212c607f171064ec1390b8c4a 100644
--- a/components/webcrypto/algorithms/ec.h
+++ b/components/webcrypto/algorithms/ec.h
@@ -32,45 +32,52 @@ class EcAlgorithm : public AlgorithmImplementation {
blink::WebCryptoKeyUsageMask usages,
GenerateKeyResult* result) const override;
- Status VerifyKeyUsagesBeforeImportKey(
- blink::WebCryptoKeyFormat format,
- blink::WebCryptoKeyUsageMask usages) const override;
+ Status ImportKey(blink::WebCryptoKeyFormat format,
+ const CryptoData& key_data,
+ const blink::WebCryptoAlgorithm& algorithm,
+ bool extractable,
+ blink::WebCryptoKeyUsageMask usages,
+ blink::WebCryptoKey* key) const override;
+ Status ExportKey(blink::WebCryptoKeyFormat format,
+ const blink::WebCryptoKey& key,
+ std::vector<uint8_t>* buffer) const override;
+
+ Status DeserializeKeyForClone(const blink::WebCryptoKeyAlgorithm& algorithm,
+ blink::WebCryptoKeyType type,
+ bool extractable,
+ blink::WebCryptoKeyUsageMask usages,
+ const CryptoData& key_data,
+ blink::WebCryptoKey* key) const override;
+
+ private:
Status ImportKeyPkcs8(const CryptoData& key_data,
const blink::WebCryptoAlgorithm& algorithm,
bool extractable,
blink::WebCryptoKeyUsageMask usages,
- blink::WebCryptoKey* key) const override;
+ blink::WebCryptoKey* key) const;
Status ImportKeySpki(const CryptoData& key_data,
const blink::WebCryptoAlgorithm& algorithm,
bool extractable,
blink::WebCryptoKeyUsageMask usages,
- blink::WebCryptoKey* key) const override;
+ blink::WebCryptoKey* key) const;
Status ImportKeyJwk(const CryptoData& key_data,
const blink::WebCryptoAlgorithm& algorithm,
bool extractable,
blink::WebCryptoKeyUsageMask usages,
- blink::WebCryptoKey* key) const override;
+ blink::WebCryptoKey* key) const;
Status ExportKeyPkcs8(const blink::WebCryptoKey& key,
- std::vector<uint8_t>* buffer) const override;
+ std::vector<uint8_t>* buffer) const;
Status ExportKeySpki(const blink::WebCryptoKey& key,
- std::vector<uint8_t>* buffer) const override;
+ std::vector<uint8_t>* buffer) const;
Status ExportKeyJwk(const blink::WebCryptoKey& key,
- std::vector<uint8_t>* buffer) const override;
+ std::vector<uint8_t>* buffer) const;
- Status DeserializeKeyForClone(const blink::WebCryptoKeyAlgorithm& algorithm,
- blink::WebCryptoKeyType type,
- bool extractable,
- blink::WebCryptoKeyUsageMask usages,
- const CryptoData& key_data,
- blink::WebCryptoKey* key) const override;
-
- private:
const blink::WebCryptoKeyUsageMask all_public_key_usages_;
const blink::WebCryptoKeyUsageMask all_private_key_usages_;
};
« no previous file with comments | « components/webcrypto/algorithms/asymmetric_key_util.cc ('k') | components/webcrypto/algorithms/ec.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698