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

Unified Diff: chrome/browser/chromeos/ownership/owner_settings_service_chromeos.cc

Issue 1106103003: Don't use RSAPrivateKey in NSS integration code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ocsp-refactor
Patch Set: pneubeck comments Created 5 years, 8 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
Index: chrome/browser/chromeos/ownership/owner_settings_service_chromeos.cc
diff --git a/chrome/browser/chromeos/ownership/owner_settings_service_chromeos.cc b/chrome/browser/chromeos/ownership/owner_settings_service_chromeos.cc
index a96f0aab78e77370c4e8a1185c3974d22f99774d..4a36a9dd698a2c5799fd878ecafe977c60ffda5a 100644
--- a/chrome/browser/chromeos/ownership/owner_settings_service_chromeos.cc
+++ b/chrome/browser/chromeos/ownership/owner_settings_service_chromeos.cc
@@ -4,6 +4,8 @@
#include "chrome/browser/chromeos/ownership/owner_settings_service_chromeos.h"
+#include <keyhi.h>
+
#include <algorithm>
#include <string>
@@ -29,9 +31,9 @@
#include "content/public/browser/notification_service.h"
#include "content/public/browser/notification_source.h"
#include "content/public/common/content_switches.h"
+#include "crypto/nss_key_util.h"
#include "crypto/nss_util.h"
#include "crypto/nss_util_internal.h"
-#include "crypto/rsa_private_key.h"
#include "crypto/scoped_nss_types.h"
#include "crypto/signature_creator.h"
@@ -124,10 +126,9 @@ bool DoesPrivateKeyExistAsyncHelper(
std::vector<uint8> public_key;
if (!owner_key_util->ImportPublicKey(&public_key))
return false;
- scoped_ptr<crypto::RSAPrivateKey> key(
- crypto::RSAPrivateKey::FindFromPublicKeyInfo(public_key));
- bool is_owner = key.get() != NULL;
- return is_owner;
+ crypto::ScopedSECKEYPrivateKey key =
+ crypto::FindNSSKeyFromPublicKeyInfo(public_key);
+ return key && SECKEY_GetPrivateKeyType(key.get()) == rsaKey;
}
// Checks whether NSS slots with private key are mounted or

Powered by Google App Engine
This is Rietveld 408576698