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

Side by Side Diff: content/child/webcrypto/status.h

Issue 777403004: [WebCrypto] Throw syntaxError if keyUsage is empty in ImportKey (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_CHILD_WEBCRYPTO_STATUS_H_ 5 #ifndef CONTENT_CHILD_WEBCRYPTO_STATUS_H_
6 #define CONTENT_CHILD_WEBCRYPTO_STATUS_H_ 6 #define CONTENT_CHILD_WEBCRYPTO_STATUS_H_
7 7
8 #include <string> 8 #include <string>
9 #include "content/common/content_export.h" 9 #include "content/common/content_export.h"
10 #include "third_party/WebKit/public/platform/WebCrypto.h" 10 #include "third_party/WebKit/public/platform/WebCrypto.h"
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 static Status ErrorGenerateHmacKeyLengthZero(); 216 static Status ErrorGenerateHmacKeyLengthZero();
217 217
218 // Attempted to create a key (either by importKey(), generateKey(), or 218 // Attempted to create a key (either by importKey(), generateKey(), or
219 // unwrapKey()) however the key usages were not applicable for the key type 219 // unwrapKey()) however the key usages were not applicable for the key type
220 // and algorithm. 220 // and algorithm.
221 static Status ErrorCreateKeyBadUsages(); 221 static Status ErrorCreateKeyBadUsages();
222 222
223 // No usages were specified when creating a secret or private key. 223 // No usages were specified when creating a secret or private key.
224 static Status ErrorCreateKeyEmptyUsages(); 224 static Status ErrorCreateKeyEmptyUsages();
225 225
226 // No usages were specified when importing a key.
227 static Status ErrorImportKeyEmptyUsages();
eroman 2014/12/09 21:04:46 Why not use ErrorCreateKeyEmptyUsages() which is a
Habib Virji 2014/12/15 18:48:55 Was keeping it different as error message, explici
228
226 // An EC key imported using SPKI/PKCS8 format had the wrong curve specified in 229 // An EC key imported using SPKI/PKCS8 format had the wrong curve specified in
227 // the key. 230 // the key.
228 static Status ErrorImportedEcKeyIncorrectCurve(); 231 static Status ErrorImportedEcKeyIncorrectCurve();
229 232
230 // The "crv" member for a JWK did not match the expectations from importKey() 233 // The "crv" member for a JWK did not match the expectations from importKey()
231 static Status ErrorJwkIncorrectCrv(); 234 static Status ErrorJwkIncorrectCrv();
232 235
233 // The EC key failed validation (coordinates don't lie on curve, out of range, 236 // The EC key failed validation (coordinates don't lie on curve, out of range,
234 // etc.) 237 // etc.)
235 static Status ErrorEcKeyInvalid(); 238 static Status ErrorEcKeyInvalid();
(...skipping 30 matching lines...) Expand all
266 Type type_; 269 Type type_;
267 blink::WebCryptoErrorType error_type_; 270 blink::WebCryptoErrorType error_type_;
268 std::string error_details_; 271 std::string error_details_;
269 }; 272 };
270 273
271 } // namespace webcrypto 274 } // namespace webcrypto
272 275
273 } // namespace content 276 } // namespace content
274 277
275 #endif // CONTENT_CHILD_WEBCRYPTO_STATUS_H_ 278 #endif // CONTENT_CHILD_WEBCRYPTO_STATUS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698