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

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

Issue 698363002: webcrypto: Add ECDSA algorithm (chromium-side) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@extract_more
Patch Set: sigh, more android pedantry Created 6 years, 1 month 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/child/webcrypto/status.h ('k') | content/child/webcrypto/test/ecdsa_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/webcrypto/status.cc
diff --git a/content/child/webcrypto/status.cc b/content/child/webcrypto/status.cc
index 9910cffa2f2506b9544952351042ce890b74dc75..d0a6caff87748164d931edaa78c1d1888beff065 100644
--- a/content/child/webcrypto/status.cc
+++ b/content/child/webcrypto/status.cc
@@ -4,6 +4,9 @@
#include "content/child/webcrypto/status.h"
+#include "base/format_macros.h"
+#include "base/strings/stringprintf.h"
+
namespace content {
// TODO(eroman): The error text for JWK uses the terminology "property" however
@@ -249,6 +252,34 @@ Status Status::ErrorCreateKeyBadUsages() {
"Cannot create a key using the specified key usages.");
}
+Status Status::ErrorImportedEcKeyIncorrectCurve() {
+ return Status(
+ blink::WebCryptoErrorTypeData,
+ "The imported EC key specifies a different curve than requested");
+}
+
+Status Status::ErrorJwkIncorrectCrv() {
+ return Status(
+ blink::WebCryptoErrorTypeData,
+ "The JWK's \"crv\" member specifies a different curve than requested");
+}
+
+Status Status::ErrorEcKeyInvalid() {
+ return Status(blink::WebCryptoErrorTypeData,
+ "The imported EC key is invalid");
+}
+
+Status Status::JwkOctetStringWrongLength(const std::string& member_name,
+ size_t expected_length,
+ size_t actual_length) {
+ return Status(
+ blink::WebCryptoErrorTypeData,
+ base::StringPrintf(
+ "The JWK's \"%s\" member defines an octet string of length %" PRIuS
+ " bytes but should be %" PRIuS,
+ member_name.c_str(), actual_length, expected_length));
+}
+
Status::Status(blink::WebCryptoErrorType error_type,
const std::string& error_details_utf8)
: type_(TYPE_ERROR),
« no previous file with comments | « content/child/webcrypto/status.h ('k') | content/child/webcrypto/test/ecdsa_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698