summaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
authormsarda@chromium.org <msarda@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-20 01:11:49 +0000
committermsarda@chromium.org <msarda@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-20 01:11:49 +0000
commit1f8cbcb956f6ece22f820be0be4581c4bf9a2934 (patch)
tree3c43dadd13b43d1c80c83644cef8c0617293a829 /crypto
parent419a4b26135e23a967b8fad1aad1a7b6ada9694b (diff)
downloadchromium_src-1f8cbcb956f6ece22f820be0be4581c4bf9a2934.zip
chromium_src-1f8cbcb956f6ece22f820be0be4581c4bf9a2934.tar.gz
chromium_src-1f8cbcb956f6ece22f820be0be4581c4bf9a2934.tar.bz2
Add RSAPrivateKey stub implementation for iOS.
RSAPrivateKey is not used on iOS, but code calling it is compiled. To avoid ifdef'ing in the client code, the class is stubbed out. Review URL: https://chromiumcodereview.appspot.com/10823309 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@152300 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'crypto')
-rw-r--r--crypto/crypto.gyp9
-rw-r--r--crypto/rsa_private_key_ios.cc67
2 files changed, 76 insertions, 0 deletions
diff --git a/crypto/crypto.gyp b/crypto/crypto.gyp
index 33b6b17..40606a7 100644
--- a/crypto/crypto.gyp
+++ b/crypto/crypto.gyp
@@ -156,6 +156,14 @@
],
},],
],
+ 'target_conditions' : [
+ [ 'OS == "ios"', {
+ 'sources!': [
+ # This class is stubbed out on iOS.
+ 'rsa_private_key.cc',
+ ],
+ }],
+ ],
'sources': [
# NOTE: all transitive dependencies of HMAC on windows need
# to be placed in the source list above.
@@ -201,6 +209,7 @@
'random.cc',
'rsa_private_key.cc',
'rsa_private_key.h',
+ 'rsa_private_key_ios.cc',
'rsa_private_key_mac.cc',
'rsa_private_key_nss.cc',
'rsa_private_key_openssl.cc',
diff --git a/crypto/rsa_private_key_ios.cc b/crypto/rsa_private_key_ios.cc
new file mode 100644
index 0000000..d96b3e9
--- /dev/null
+++ b/crypto/rsa_private_key_ios.cc
@@ -0,0 +1,67 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "crypto/rsa_private_key.h"
+
+#include "base/logging.h"
+
+namespace crypto {
+
+// |RSAPrivateKey| is not used on iOS. This implementation was written so that
+// it would compile. It may be possible to use the NSS implementation as a real
+// implementation, but it hasn't yet been necessary.
+
+// static
+RSAPrivateKey* RSAPrivateKey::Create(uint16 num_bits) {
+ NOTIMPLEMENTED();
+ return NULL;
+}
+
+// static
+RSAPrivateKey* RSAPrivateKey::CreateSensitive(uint16 num_bits) {
+ NOTIMPLEMENTED();
+ return NULL;
+}
+
+// static
+RSAPrivateKey* RSAPrivateKey::CreateFromPrivateKeyInfo(
+ const std::vector<uint8>& input) {
+ NOTIMPLEMENTED();
+ return NULL;
+}
+
+// static
+RSAPrivateKey* RSAPrivateKey::CreateSensitiveFromPrivateKeyInfo(
+ const std::vector<uint8>& input) {
+ NOTIMPLEMENTED();
+ return NULL;
+}
+
+// static
+RSAPrivateKey* RSAPrivateKey::FindFromPublicKeyInfo(
+ const std::vector<uint8>& input) {
+ NOTIMPLEMENTED();
+ return NULL;
+}
+
+RSAPrivateKey::RSAPrivateKey() : key_(NULL), public_key_(NULL) {}
+
+RSAPrivateKey::~RSAPrivateKey() {
+ if (public_key_)
+ CFRelease(public_key_);
+ if (key_)
+ CFRelease(key_);
+}
+
+bool RSAPrivateKey::ExportPrivateKey(std::vector<uint8>* output) const {
+ NOTIMPLEMENTED();
+ return false;
+}
+
+bool RSAPrivateKey::ExportPublicKey(std::vector<uint8>* output) const {
+ NOTIMPLEMENTED();
+ return false;
+}
+
+} // namespace base