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

Unified Diff: content/child/webcrypto/status.h

Issue 282133002: [webcryto] Validate key usages during key creation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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
Index: content/child/webcrypto/status.h
diff --git a/content/child/webcrypto/status.h b/content/child/webcrypto/status.h
index 69f40be7c4f3e374532b33b0f6a66573979e7836..5b45e76c21aa1ccf7aaf10afacd12d8a2d4bb022 100644
--- a/content/child/webcrypto/status.h
+++ b/content/child/webcrypto/status.h
@@ -19,11 +19,6 @@ namespace webcrypto {
//
// As such, it is important that errors DO NOT reveal any sensitive material
// (like key bytes).
-//
-// Care must be taken with what errors are reported back to Blink when doing
-// compound operations like unwrapping a JWK key. In this case, errors
-// generated by the JWK import are not appropriate to report since the wrapped
-// JWK is not visible to the caller.
class CONTENT_EXPORT Status {
public:
Status() : type_(TYPE_ERROR) {}
@@ -188,6 +183,11 @@ class CONTENT_EXPORT Status {
// zero, or it was not a multiple of 8 bits.
static Status ErrorGenerateKeyLength();
+ // Attempted to create a key (either by importKey(), generateKey(), or
+ // unwrapKey()) however the key usages were not applicable for the key type
+ // and algorithm.
+ static Status ErrorCreateKeyBadUsages();
+
private:
enum Type { TYPE_ERROR, TYPE_SUCCESS };

Powered by Google App Engine
This is Rietveld 408576698