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

Side by Side Diff: content/child/webcrypto/webcrypto_impl.cc

Issue 282903002: [webcrypto] Remove RSA-ES support (2 of 3) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase and merge conflicts (yuck) Created 6 years, 7 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
« no previous file with comments | « content/child/webcrypto/status.h ('k') | content/child/webcrypto/webcrypto_util.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "content/child/webcrypto/webcrypto_impl.h" 5 #include "content/child/webcrypto/webcrypto_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/lazy_instance.h" 8 #include "base/lazy_instance.h"
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 if (status.IsError()) { 130 if (status.IsError()) {
131 CompleteWithError(status, result); 131 CompleteWithError(status, result);
132 } else { 132 } else {
133 result->completeWithKey(key); 133 result->completeWithKey(key);
134 } 134 }
135 } 135 }
136 136
137 bool IsAlgorithmAsymmetric(const blink::WebCryptoAlgorithm& algorithm) { 137 bool IsAlgorithmAsymmetric(const blink::WebCryptoAlgorithm& algorithm) {
138 // TODO(padolph): include all other asymmetric algorithms once they are 138 // TODO(padolph): include all other asymmetric algorithms once they are
139 // defined, e.g. EC and DH. 139 // defined, e.g. EC and DH.
140 return (algorithm.id() == blink::WebCryptoAlgorithmIdRsaEsPkcs1v1_5 || 140 return webcrypto::IsAlgorithmRsa(algorithm.id());
141 algorithm.id() == blink::WebCryptoAlgorithmIdRsaSsaPkcs1v1_5 ||
142 algorithm.id() == blink::WebCryptoAlgorithmIdRsaOaep);
143 } 141 }
144 142
145 // Gets a task runner for the current thread. The current thread is either: 143 // Gets a task runner for the current thread. The current thread is either:
146 // 144 //
147 // * The main Blink thread 145 // * The main Blink thread
148 // * A Blink web worker thread 146 // * A Blink web worker thread
149 // 147 //
150 // A different mechanism is needed for posting to these threads. The main 148 // A different mechanism is needed for posting to these threads. The main
151 // thread has an associated message loop and can simply use 149 // thread has an associated message loop and can simply use
152 // base::ThreadTaskRunnerHandle. Whereas the web worker threads are managed by 150 // base::ThreadTaskRunnerHandle. Whereas the web worker threads are managed by
(...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after
739 &key); 737 &key);
740 } 738 }
741 739
742 bool WebCryptoImpl::serializeKeyForClone( 740 bool WebCryptoImpl::serializeKeyForClone(
743 const blink::WebCryptoKey& key, 741 const blink::WebCryptoKey& key,
744 blink::WebVector<unsigned char>& key_data) { 742 blink::WebVector<unsigned char>& key_data) {
745 return webcrypto::SerializeKeyForClone(key, &key_data); 743 return webcrypto::SerializeKeyForClone(key, &key_data);
746 } 744 }
747 745
748 } // namespace content 746 } // namespace content
OLDNEW
« no previous file with comments | « content/child/webcrypto/status.h ('k') | content/child/webcrypto/webcrypto_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698