From 4b559b4ddffc0b7f688019bcb80658f05e063af7 Mon Sep 17 00:00:00 2001 From: "rvargas@google.com" Date: Thu, 14 Apr 2011 17:37:14 +0000 Subject: Move crypto files out of base, to a top level directory. src/crypto is now an independent project that contains our cryptographic primitives (except md5 and sha1). This removes the base dependency from nss, openssl and sqlite. BUG=76996 TEST=none Review URL: http://codereview.chromium.org/6805019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@81611 0039d316-1c4b-4281-b951-d872f2087c98 --- net/third_party/mozilla_security_manager/nsKeygenHandler.cpp | 10 +++++----- .../mozilla_security_manager/nsNSSCertificateDB.cpp | 8 ++++---- net/third_party/mozilla_security_manager/nsPKCS12Blob.cpp | 3 +-- 3 files changed, 10 insertions(+), 11 deletions(-) (limited to 'net/third_party') diff --git a/net/third_party/mozilla_security_manager/nsKeygenHandler.cpp b/net/third_party/mozilla_security_manager/nsKeygenHandler.cpp index c00e58a..51e4861 100644 --- a/net/third_party/mozilla_security_manager/nsKeygenHandler.cpp +++ b/net/third_party/mozilla_security_manager/nsKeygenHandler.cpp @@ -49,7 +49,7 @@ #include "base/base64.h" #include "base/logging.h" -#include "base/nss_util.h" +#include "crypto/nss_util.h" #include "googleurl/src/gurl.h" namespace { @@ -136,7 +136,7 @@ std::string GenKeyAndSignChallenge(int key_size_in_bits, VLOG(1) << "Creating key pair..."; { - base::AutoNSSWriteLock lock; + crypto::AutoNSSWriteLock lock; privateKey = PK11_GenerateKeyPair(slot, keyGenMechanism, keyGenParams, @@ -159,7 +159,7 @@ std::string GenKeyAndSignChallenge(int key_size_in_bits, // example.com", but localize it. const std::string& label = url.host(); { - base::AutoNSSWriteLock lock; + crypto::AutoNSSWriteLock lock; PK11_SetPublicKeyNickname(publicKey, label.c_str()); PK11_SetPrivateKeyNickname(privateKey, label.c_str()); } @@ -235,7 +235,7 @@ std::string GenKeyAndSignChallenge(int key_size_in_bits, // On successful keygen we need to keep the private key, of course, // or we won't be able to use the client certificate. if (!isSuccess || !stores_key) { - base::AutoNSSWriteLock lock; + crypto::AutoNSSWriteLock lock; PK11_DestroyTokenObject(privateKey->pkcs11Slot, privateKey->pkcs11ID); } SECKEY_DestroyPrivateKey(privateKey); @@ -243,7 +243,7 @@ std::string GenKeyAndSignChallenge(int key_size_in_bits, if (publicKey) { if (!isSuccess || !stores_key) { - base::AutoNSSWriteLock lock; + crypto::AutoNSSWriteLock lock; PK11_DestroyTokenObject(publicKey->pkcs11Slot, publicKey->pkcs11ID); } SECKEY_DestroyPublicKey(publicKey); diff --git a/net/third_party/mozilla_security_manager/nsNSSCertificateDB.cpp b/net/third_party/mozilla_security_manager/nsNSSCertificateDB.cpp index f8d4a45..a430889 100644 --- a/net/third_party/mozilla_security_manager/nsNSSCertificateDB.cpp +++ b/net/third_party/mozilla_security_manager/nsNSSCertificateDB.cpp @@ -42,9 +42,9 @@ #include #include -#include "base/crypto/scoped_nss_types.h" #include "base/logging.h" -#include "base/nss_util_internal.h" +#include "crypto/nss_util_internal.h" +#include "crypto/scoped_nss_types.h" #include "net/base/net_errors.h" #include "net/base/x509_certificate.h" #include "net/third_party/mozilla_security_manager/nsNSSCertTrust.h" @@ -56,7 +56,7 @@ bool ImportCACerts(const net::CertificateList& certificates, net::X509Certificate* root, unsigned int trustBits, net::CertDatabase::ImportCertFailureList* not_imported) { - base::ScopedPK11Slot slot(base::GetPublicNSSKeySlot()); + crypto::ScopedPK11Slot slot(crypto::GetPublicNSSKeySlot()); if (!slot.get()) { LOG(ERROR) << "Couldn't get internal key slot!"; return false; @@ -163,7 +163,7 @@ bool ImportCACerts(const net::CertificateList& certificates, // Based on nsNSSCertificateDB::ImportServerCertificate. bool ImportServerCert(const net::CertificateList& certificates, net::CertDatabase::ImportCertFailureList* not_imported) { - base::ScopedPK11Slot slot(base::GetPublicNSSKeySlot()); + crypto::ScopedPK11Slot slot(crypto::GetPublicNSSKeySlot()); if (!slot.get()) { LOG(ERROR) << "Couldn't get internal key slot!"; return false; diff --git a/net/third_party/mozilla_security_manager/nsPKCS12Blob.cpp b/net/third_party/mozilla_security_manager/nsPKCS12Blob.cpp index 0cf9562..1175ca0 100644 --- a/net/third_party/mozilla_security_manager/nsPKCS12Blob.cpp +++ b/net/third_party/mozilla_security_manager/nsPKCS12Blob.cpp @@ -42,11 +42,10 @@ #include #include -#include "base/crypto/scoped_nss_types.h" #include "base/lazy_instance.h" #include "base/logging.h" -#include "base/nss_util_internal.h" #include "base/string_util.h" +#include "crypto/nss_util_internal.h" #include "net/base/net_errors.h" #include "net/base/x509_certificate.h" -- cgit v1.1