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

Unified Diff: content/renderer/webcrypto/webcrypto_util.h

Issue 141853006: [webcrypto] Validate JWK import of AES keys: key length must match algorithm. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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 | « content/renderer/webcrypto/webcrypto_impl_unittest.cc ('k') | content/renderer/webcrypto/webcrypto_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/webcrypto/webcrypto_util.h
diff --git a/content/renderer/webcrypto/webcrypto_util.h b/content/renderer/webcrypto/webcrypto_util.h
index 28b4b2c1d61f525c5f1e12cdb4c8ecd19d72d5c8..fc2a9b957efa4782058165ea00a6879e22a62938 100644
--- a/content/renderer/webcrypto/webcrypto_util.h
+++ b/content/renderer/webcrypto/webcrypto_util.h
@@ -83,16 +83,16 @@ class CONTENT_EXPORT Status {
// specified by the Web Crypto import operation.
static Status ErrorJwkUsageInconsistent();
- // The "k" parameter was either missing, could not be parsed as a base-64
- // encoded string, or the decoded bytes were empty.
+ // The "k" parameter was either missing or could not be parsed as a base-64
+ // encoded string.
static Status ErrorJwkDecodeK();
- // The "n" parameter was either missing, could not be parsed as a base-64
- // encoded string, or the decoded bytes were empty.
+ // The "n" parameter was either missing or could not be parsed as a base-64
+ // encoded string.
static Status ErrorJwkDecodeN();
- // The "e" parameter was either missing, could not be parsed as a base-64
- // encoded string, or the decoded bytes were empty.
+ // The "e" parameter was either missing or could not be parsed as a base-64
+ // encoded string.
static Status ErrorJwkDecodeE();
// TODO(eroman): Private key import through JWK is not yet supported.
@@ -102,6 +102,12 @@ class CONTENT_EXPORT Status {
// unrecognized.
static Status ErrorJwkUnrecognizedKty();
+ // The amount of key data provided was incompatible with the selected
+ // algorithm. For instance if the algorith name was A128CBC then EXACTLY
+ // 128-bits of key data must have been provided. If 192-bits of key data were
+ // given that is an error.
+ static Status ErrorJwkIncorrectKeyLength();
+
// ------------------------------------
// Other errors
// ------------------------------------
« no previous file with comments | « content/renderer/webcrypto/webcrypto_impl_unittest.cc ('k') | content/renderer/webcrypto/webcrypto_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698