summaryrefslogtreecommitdiffstats
path: root/components/ownership/owner_key_util_impl.cc
diff options
context:
space:
mode:
Diffstat (limited to 'components/ownership/owner_key_util_impl.cc')
-rw-r--r--components/ownership/owner_key_util_impl.cc16
1 files changed, 2 insertions, 14 deletions
diff --git a/components/ownership/owner_key_util_impl.cc b/components/ownership/owner_key_util_impl.cc
index 5a400d5..6a95131 100644
--- a/components/ownership/owner_key_util_impl.cc
+++ b/components/ownership/owner_key_util_impl.cc
@@ -9,11 +9,8 @@
#include "base/files/file_util.h"
#include "base/logging.h"
-#if defined(USE_NSS_CERTS)
#include <keythi.h>
#include "crypto/nss_key_util.h"
-#include "crypto/rsa_private_key.h"
-#endif
namespace ownership {
@@ -55,8 +52,7 @@ bool OwnerKeyUtilImpl::ImportPublicKey(std::vector<uint8>* output) {
return data_read == safe_file_size;
}
-#if defined(USE_NSS_CERTS)
-crypto::RSAPrivateKey* OwnerKeyUtilImpl::FindPrivateKeyInSlot(
+crypto::ScopedSECKEYPrivateKey OwnerKeyUtilImpl::FindPrivateKeyInSlot(
const std::vector<uint8>& key,
PK11SlotInfo* slot) {
if (!slot)
@@ -66,16 +62,8 @@ crypto::RSAPrivateKey* OwnerKeyUtilImpl::FindPrivateKeyInSlot(
crypto::FindNSSKeyFromPublicKeyInfoInSlot(key, slot));
if (!private_key || SECKEY_GetPrivateKeyType(private_key.get()) != rsaKey)
return nullptr;
-#if defined(USE_OPENSSL)
- // TODO(davidben): This assumes that crypto::RSAPrivateKey also uses NSS.
- // https://crbug.com/478777
- NOTIMPLEMENTED();
- return nullptr;
-#else
- return crypto::RSAPrivateKey::CreateFromKey(private_key.get());
-#endif
+ return private_key.Pass();
}
-#endif // defined(USE_NSS_CERTS)
bool OwnerKeyUtilImpl::IsPublicKeyPresent() {
return base::PathExists(public_key_file_);