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

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

Issue 184753002: Fix memory leak from use of SECKEY_ConvertToPublicKey(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add suppression file Created 6 years, 9 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 | « no previous file | tools/valgrind/memcheck/suppressions.txt » ('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/renderer/webcrypto/platform_crypto.h" 5 #include "content/renderer/webcrypto/platform_crypto.h"
6 6
7 #include <cryptohi.h> 7 #include <cryptohi.h>
8 #include <pk11pub.h> 8 #include <pk11pub.h>
9 #include <sechash.h> 9 #include <sechash.h>
10 10
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 public_exponent.byte_length())); 434 public_exponent.byte_length()));
435 return true; 435 return true;
436 default: 436 default:
437 return false; 437 return false;
438 } 438 }
439 } 439 }
440 440
441 bool CreatePrivateKeyAlgorithm(const blink::WebCryptoAlgorithm& algorithm, 441 bool CreatePrivateKeyAlgorithm(const blink::WebCryptoAlgorithm& algorithm,
442 SECKEYPrivateKey* key, 442 SECKEYPrivateKey* key,
443 blink::WebCryptoKeyAlgorithm* key_algorithm) { 443 blink::WebCryptoKeyAlgorithm* key_algorithm) {
444 return CreatePublicKeyAlgorithm( 444 crypto::ScopedSECKEYPublicKey public_key(SECKEY_ConvertToPublicKey(key));
445 algorithm, SECKEY_ConvertToPublicKey(key), key_algorithm); 445 return CreatePublicKeyAlgorithm(algorithm, public_key.get(), key_algorithm);
446 } 446 }
447 447
448 } // namespace 448 } // namespace
449 449
450 Status ImportKeyRaw(const blink::WebCryptoAlgorithm& algorithm, 450 Status ImportKeyRaw(const blink::WebCryptoAlgorithm& algorithm,
451 const CryptoData& key_data, 451 const CryptoData& key_data,
452 bool extractable, 452 bool extractable,
453 blink::WebCryptoKeyUsageMask usage_mask, 453 blink::WebCryptoKeyUsageMask usage_mask,
454 blink::WebCryptoKey* key) { 454 blink::WebCryptoKey* key) {
455 455
(...skipping 642 matching lines...) Expand 10 before | Expand all | Expand 10 after
1098 key_algorithm, 1098 key_algorithm,
1099 usage_mask); 1099 usage_mask);
1100 return Status::Success(); 1100 return Status::Success();
1101 } 1101 }
1102 1102
1103 } // namespace platform 1103 } // namespace platform
1104 1104
1105 } // namespace webcrypto 1105 } // namespace webcrypto
1106 1106
1107 } // namespace content 1107 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | tools/valgrind/memcheck/suppressions.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698