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

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: Updated code to adapt to new changes + code review comments 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 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 static Status ErrorHmacImportBadLength(); 221 static Status ErrorHmacImportBadLength();
222 222
223 // Attempted to create a key (either by importKey(), generateKey(), or 223 // Attempted to create a key (either by importKey(), generateKey(), or
224 // unwrapKey()) however the key usages were not applicable for the key type 224 // unwrapKey()) however the key usages were not applicable for the key type
225 // and algorithm. 225 // and algorithm.
226 static Status ErrorCreateKeyBadUsages(); 226 static Status ErrorCreateKeyBadUsages();
227 227
228 // No usages were specified when creating a secret or private key. 228 // No usages were specified when creating a secret or private key.
229 static Status ErrorCreateKeyEmptyUsages(); 229 static Status ErrorCreateKeyEmptyUsages();
230 230
231 // No usages were specified when creating/importing a secret or private key.
232 static Status ErrorKeyEmptyUsages();
233
231 // An EC key imported using SPKI/PKCS8 format had the wrong curve specified in 234 // An EC key imported using SPKI/PKCS8 format had the wrong curve specified in
232 // the key. 235 // the key.
233 static Status ErrorImportedEcKeyIncorrectCurve(); 236 static Status ErrorImportedEcKeyIncorrectCurve();
234 237
235 // The "crv" member for a JWK did not match the expectations from importKey() 238 // The "crv" member for a JWK did not match the expectations from importKey()
236 static Status ErrorJwkIncorrectCrv(); 239 static Status ErrorJwkIncorrectCrv();
237 240
238 // The EC key failed validation (coordinates don't lie on curve, out of range, 241 // The EC key failed validation (coordinates don't lie on curve, out of range,
239 // etc.) 242 // etc.)
240 static Status ErrorEcKeyInvalid(); 243 static Status ErrorEcKeyInvalid();
(...skipping 30 matching lines...) Expand all
271 Type type_; 274 Type type_;
272 blink::WebCryptoErrorType error_type_; 275 blink::WebCryptoErrorType error_type_;
273 std::string error_details_; 276 std::string error_details_;
274 }; 277 };
275 278
276 } // namespace webcrypto 279 } // namespace webcrypto
277 280
278 } // namespace content 281 } // namespace content
279 282
280 #endif // CONTENT_CHILD_WEBCRYPTO_STATUS_H_ 283 #endif // CONTENT_CHILD_WEBCRYPTO_STATUS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698