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

Unified Diff: content/renderer/webcrypto/webcrypto_impl_openssl.cc

Issue 25906002: [webcrypto] Add JWK import for HMAC and AES-CBC key. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 7 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
Index: content/renderer/webcrypto/webcrypto_impl_openssl.cc
diff --git a/content/renderer/webcrypto/webcrypto_impl_openssl.cc b/content/renderer/webcrypto/webcrypto_impl_openssl.cc
index 83ae45c20e400460fd4a4dc12d6c581d37b5f6c9..269152a768c5842a2e4fc94cb9e3c3b877d33017 100644
--- a/content/renderer/webcrypto/webcrypto_impl_openssl.cc
+++ b/content/renderer/webcrypto/webcrypto_impl_openssl.cc
@@ -13,6 +13,7 @@
#include <openssl/rand.h>
#include "base/logging.h"
+#include "content/renderer/webcrypto/webcrypto_util.h"
#include "crypto/openssl_util.h"
#include "crypto/secure_util.h"
#include "third_party/WebKit/public/platform/WebArrayBuffer.h"
@@ -151,7 +152,7 @@ bool AesCbcEncryptDecrypt(CipherOperation cipher_operation,
static_cast<unsigned>(final_output_chunk_len);
DCHECK_LE(final_output_len, output_max_len);
- WebCryptoImpl::ShrinkBuffer(buffer, final_output_len);
+ ShrinkBuffer(buffer, final_output_len);
return true;
}
@@ -319,14 +320,10 @@ bool WebCryptoImpl::ImportKeyInternal(
return false;
}
- // TODO(padolph): Need to split handling for symmetric (raw or jwk format) and
- // asymmetric (jwk, spki, or pkcs8 format) keys.
+ // TODO(padolph): Need to split handling for symmetric (raw format) and
+ // asymmetric (spki or pkcs8 format) keys.
// Currently only supporting symmetric.
- // TODO(padolph): jwk handling. Define precedence between jwk contents and
- // this method's parameters, e.g. 'alg' in jwk vs algorithm.id(). Who wins if
- // they differ? (jwk, probably)
-
// Symmetric keys are always type secret
WebKit::WebCryptoKeyType type = WebKit::WebCryptoKeyTypeSecret;

Powered by Google App Engine
This is Rietveld 408576698