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

Unified Diff: net/third_party/mozilla_security_manager/nsPKCS12Blob.cpp

Issue 3189014: NSS cert database cleanups (Closed) Base URL: git://codf21.jail/chromium.git
Patch Set: indentation, terminology, syntax Created 10 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/base/cert_database_nss_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/third_party/mozilla_security_manager/nsPKCS12Blob.cpp
diff --git a/net/third_party/mozilla_security_manager/nsPKCS12Blob.cpp b/net/third_party/mozilla_security_manager/nsPKCS12Blob.cpp
index ab20b22d1f6f9a13583b68cfd3d5de7a5c7f560a..eac7ace1960b0f22ed281c2c3bcd1c3b67db98f2 100644
--- a/net/third_party/mozilla_security_manager/nsPKCS12Blob.cpp
+++ b/net/third_party/mozilla_security_manager/nsPKCS12Blob.cpp
@@ -42,6 +42,7 @@
#include <p12plcy.h>
#include <secerr.h>
+#include "base/crypto/scoped_nss_types.h"
#include "base/logging.h"
#include "base/nss_util_internal.h"
#include "base/string_util.h"
@@ -260,14 +261,14 @@ void EnsurePKCS12Init() {
int nsPKCS12Blob_Import(const char* pkcs12_data,
size_t pkcs12_len,
const string16& password) {
- PK11SlotInfo *slot = base::GetDefaultNSSKeySlot();
- if (!slot) {
+ base::ScopedPK11Slot slot(base::GetDefaultNSSKeySlot());
+ if (!slot.get()) {
LOG(ERROR) << "Couldn't get Internal key slot!";
return net::ERR_PKCS12_IMPORT_FAILED;
}
int rv = nsPKCS12Blob_ImportHelper(pkcs12_data, pkcs12_len, password, false,
- slot);
+ slot.get());
// When the user entered a zero length password:
// An empty password should be represented as an empty
@@ -278,10 +279,8 @@ int nsPKCS12Blob_Import(const char* pkcs12_data,
// without giving a user prompt when trying the different empty password flavors.
if (rv == net::ERR_PKCS12_IMPORT_BAD_PASSWORD && password.size() == 0) {
rv = nsPKCS12Blob_ImportHelper(pkcs12_data, pkcs12_len, password, true,
- slot);
+ slot.get());
}
-
- PK11_FreeSlot(slot);
return rv;
}
« no previous file with comments | « net/base/cert_database_nss_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698