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

Side by Side Diff: crypto/ec_signature_creator_nss.cc

Issue 9302016: Fix an SECItem leak in the new ECSignatureCreator class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "crypto/ec_signature_creator.h" 5 #include "crypto/ec_signature_creator.h"
6 6
7 #include <cryptohi.h> 7 #include <cryptohi.h>
8 #include <pk11pub.h> 8 #include <pk11pub.h>
9 #include <secerr.h> 9 #include <secerr.h>
10 #include <sechash.h> 10 #include <sechash.h>
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 // Sign the secret data and save it to |result|. 86 // Sign the secret data and save it to |result|.
87 SECStatus rv = 87 SECStatus rv =
88 SignData(arena.get(), result, &secret, key_->key(), HASH_AlgSHA1); 88 SignData(arena.get(), result, &secret, key_->key(), HASH_AlgSHA1);
89 if (rv != SECSuccess) { 89 if (rv != SECSuccess) {
90 DLOG(ERROR) << "DerSignData: " << PORT_GetError(); 90 DLOG(ERROR) << "DerSignData: " << PORT_GetError();
91 return false; 91 return false;
92 } 92 }
93 93
94 // Copy the signed data into the output vector. 94 // Copy the signed data into the output vector.
95 signature->assign(result->data, result->data + result->len); 95 signature->assign(result->data, result->data + result->len);
96 SECITEM_FreeItem(result, PR_FALSE);
agl 2012/01/31 15:40:55 Thanks for catching this, but there's an underlyin
Ryan Hamilton 2012/01/31 16:37:16 No kidding? Thanks for catching this. As per wtc
96 return true; 97 return true;
97 } 98 }
98 99
99 } // namespace crypto 100 } // namespace crypto
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698