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

Side by Side Diff: content/renderer/webcrypto/webcrypto_util.cc

Issue 165373008: [webcrypto] Reject AES-GCM tag lengths other than 32, 64, 96, 104, 112, 120, 128. (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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #include "content/renderer/webcrypto/webcrypto_util.h" 5 #include "content/renderer/webcrypto/webcrypto_util.h"
6 6
7 #include "base/base64.h" 7 #include "base/base64.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "third_party/WebKit/public/platform/WebCryptoAlgorithm.h" 9 #include "third_party/WebKit/public/platform/WebCryptoAlgorithm.h"
10 #include "third_party/WebKit/public/platform/WebCryptoAlgorithmParams.h" 10 #include "third_party/WebKit/public/platform/WebCryptoAlgorithmParams.h"
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 Status Status::ErrorUnsupported() { 114 Status Status::ErrorUnsupported() {
115 return Status("The requested operation is unsupported"); 115 return Status("The requested operation is unsupported");
116 } 116 }
117 117
118 Status Status::ErrorUnexpected() { 118 Status Status::ErrorUnexpected() {
119 return Status("Something unexpected happened..."); 119 return Status("Something unexpected happened...");
120 } 120 }
121 121
122 Status Status::ErrorInvalidAesGcmTagLength() { 122 Status Status::ErrorInvalidAesGcmTagLength() {
123 return Status( 123 return Status(
124 "The tag length is invalid: either too large or not a multiple " 124 "The tag length is invalid: Must be 32, 64, 96, 104, 112, 120, or 128 "
125 "of 8 bits"); 125 "bits");
126 } 126 }
127 127
128 Status Status::ErrorGenerateKeyPublicExponent() { 128 Status Status::ErrorGenerateKeyPublicExponent() {
129 return Status("The \"publicExponent\" is either empty, zero, or too large"); 129 return Status("The \"publicExponent\" is either empty, zero, or too large");
130 } 130 }
131 131
132 Status Status::ErrorMissingAlgorithmImportRawKey() { 132 Status Status::ErrorMissingAlgorithmImportRawKey() {
133 return Status( 133 return Status(
134 "The key's algorithm must be specified when importing " 134 "The key's algorithm must be specified when importing "
135 "raw-formatted key."); 135 "raw-formatted key.");
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 return 128; 321 return 128;
322 default: 322 default:
323 NOTREACHED(); 323 NOTREACHED();
324 return 0; 324 return 0;
325 } 325 }
326 } 326 }
327 327
328 } // namespace webcrypto 328 } // namespace webcrypto
329 329
330 } // namespace content 330 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698