summaryrefslogtreecommitdiffstats
path: root/crypto/rsa_private_key_openssl.cc
Commit message (Collapse)AuthorAgeFilesLines
* Cut down on usage of deprecated APIs in //crypto.davidben2016-03-011-54/+31
| | | | | | | | | | | | | | | SSL_library_init is deprecated. It's CRYPTO_library_init. Switch from the legacy ASN.1 APIs to the new parsers where feasible. ECPrivateKey::CreateFromEncryptedPrivateKeyInfo is left alone for now as we still need a new version of those APIs. This also adds a scoper for CBB for use in later CLs. BUG=499653 Review URL: https://codereview.chromium.org/1739403002 Cr-Commit-Position: refs/heads/master@{#378610}
* Switch to standard integer types in crypto/.avi2015-12-211-5/+6
| | | | | | | | | | BUG=138542 TBR=rsleevi@chromium.org NOPRESUBMIT=true Review URL: https://codereview.chromium.org/1539353003 Cr-Commit-Position: refs/heads/master@{#366460}
* Replace EVP_PKEY_dup calls with EVP_PKEY_up_ref.davidben2015-05-131-1/+1
| | | | | | | | | | | | | | This is a no-op change. BoringSSL deprecated EVP_PKEY_dup in favor of a new EVP_PKEY_up_ref. This makes it more obvious there isn't actually a copy and is more consistent with other ref-counted types. See https://boringssl.googlesource.com/boringssl/+/517da2f1efc91b179dfb1898f826b18a6a38f547%5E%21/#F3 BUG=none Review URL: https://codereview.chromium.org/1129083007 Cr-Commit-Position: refs/heads/master@{#329732}
* Convert crypto::ScopedOpenSSL to type aliases.davidben2015-02-211-3/+3
| | | | | | | | | | This avoids having to put '::Type' everywhere. BUG=none Review URL: https://codereview.chromium.org/948543002 Cr-Commit-Position: refs/heads/master@{#317462}
* Don't allow importing non-RSA keys from ↵eroman2015-01-021-1/+1
| | | | | | | | | | crypto::RSAPrivateKey::CreateFromPrivateKeyInfo(). BUG=445927 Review URL: https://codereview.chromium.org/805193004 Cr-Commit-Position: refs/heads/master@{#309854}
* Don't allow trailing data when creating an RSAPrivateKey.davidben2014-11-241-4/+1
| | | | | | | | | | | CreateFromPrivateKeyInfo should not silently discard data after the PrivateKeyInfo. BUG=432279 Review URL: https://codereview.chromium.org/713523004 Cr-Commit-Position: refs/heads/master@{#305503}
* Check trailing data when parsing ASN.1.davidben2014-11-111-7/+9
| | | | | | | | | | | | | | | | | | | Properly check that the entire buffer was consumed. d2i_* may process only a prefix of its input. In addition, don't bother using a memory BIO when the buffer can be parsed directly. This aligns the NSS and OpenSSL port's behavior in most places: SEC_QuickDERDecodeItem fails with SEC_ERROR_EXTRA_INPUT if there is excess data. Add tests. Both for testing and to verify this is the NSS port's behavior. For a PKCS #8 PrivateKeyInfo, NSS will silently accept trailing data. Fix WebCrypto in NSS to align with the spec. RSAPrivateKey is left for a follow-up. (This includes an NSS roll to pick up a symbol export.) BUG=430200 Review URL: https://codereview.chromium.org/685063007 Cr-Commit-Position: refs/heads/master@{#303546}
* Allow a crypto::RSAPrivateKey object to be wrapped round a pre-existingdougsteed2014-09-101-0/+10
| | | | | | | | | | | | | | openssl key, as is currently supported for NSS. Change-Id: I36c848884273fe8e23451259655680b6b7d46a98 BUG=412427 R=davidben@chromium.org Review URL: https://codereview.chromium.org/559623002 Cr-Commit-Position: refs/heads/master@{#294254}
* Switch to BoringSSL.davidben@chromium.org2014-07-221-0/+2
| | | | | | | | | | | | | | | | | This is a reland of r284079 which was reverted in r284248 for components build issues. That, in turn, was a reland of r283813 which was reverted in r283845 because it broke WebRTC tests on Android. That, in turn, was a reland of r283542 which was reverted in r283591 because it broke the WebView build. This is a much larger change than its diff suggests. If it breaks something, please revert first and ask questions later. BUG=393317 R=agl@chromium.org, jam@chromium.org Review URL: https://codereview.chromium.org/401153002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@284729 0039d316-1c4b-4281-b951-d872f2087c98
* Revert "Switch to BoringSSL."agl@chromium.org2014-07-181-2/+0
| | | | | | | | | | This reverts commit r284079. BUG=395271 Review URL: https://codereview.chromium.org/406693004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@284248 0039d316-1c4b-4281-b951-d872f2087c98
* Switch to BoringSSL.agl@chromium.org2014-07-181-0/+2
| | | | | | | | | | | | | | | (This is a reland of r283813 which was reverted in r283845 because it broke WebRTC tests on Android. That, in turn, was a reland of of r283542 which was reverted in r283591 because it broke the WebView build.) This is a much larger change than its diff suggests. If it breaks something, please revert first and ask questions later. BUG=none Review URL: https://codereview.chromium.org/401613008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@284079 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 283813 "Switch to BoringSSL."vitalybuka@chromium.org2014-07-171-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | Failed WebRtcBrowserTest on android_dbg_triggered_tests. > Switch to BoringSSL. > > (This is a reland of r283542 which was reverted in r283591 because it > broke the WebView build. The android_aosp trybots are broken[1] so this > based on hope.) > > This is a much larger change than its diff suggests. If it breaks > something, please revert first and ask questions later. > > [1] http://code.google.com/p/chromium/issues/detail?id=394597 > > BUG=none > > Review URL: https://codereview.chromium.org/399993002 TBR=agl@chromium.org Review URL: https://codereview.chromium.org/405503002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@283845 0039d316-1c4b-4281-b951-d872f2087c98
* Switch to BoringSSL.agl@chromium.org2014-07-171-0/+2
| | | | | | | | | | | | | | | | | (This is a reland of r283542 which was reverted in r283591 because it broke the WebView build. The android_aosp trybots are broken[1] so this based on hope.) This is a much larger change than its diff suggests. If it breaks something, please revert first and ask questions later. [1] http://code.google.com/p/chromium/issues/detail?id=394597 BUG=none Review URL: https://codereview.chromium.org/399993002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@283813 0039d316-1c4b-4281-b951-d872f2087c98
* Revert "Switch to BoringSSL."agl@chromium.org2014-07-171-2/+0
| | | | | | | | This reverts commit 283542. This broke the WebView Android build. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@283591 0039d316-1c4b-4281-b951-d872f2087c98
* Switch to BoringSSL.agl@chromium.org2014-07-161-0/+2
| | | | | | | | | | (This is a much larger change than its diff suggests. If it breaks something, please revert first and ask questions later.) R=davidben@chromium.org, eroman@chromium.org, rsleevi@chromium.org Review URL: https://codereview.chromium.org/345063006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@283542 0039d316-1c4b-4281-b951-d872f2087c98
* Fix memory leaks when calling EVP_PKEY_get1_RSA.davidben@chromium.org2014-07-141-2/+2
| | | | | | | | | | | EVP_PKEY_get1_RSA passes the caller a reference that needs to be released afterwards. BUG=393659 Review URL: https://codereview.chromium.org/392653005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@283020 0039d316-1c4b-4281-b951-d872f2087c98
* Eliminate ScopedOpenSSL in favour of scoped_ptr<> specializations.rsleevi@chromium.org2014-07-101-5/+6
| | | | | | | | | | | | | | | | | | | | | | Match the NSS, CryptoAPI (Win) and Security (OS X) approaches by declaring the scoped types as specializations of our existing scoped classes. Like NSS, this requires an intermediate helper type, because our scoped_ptr<> doesn't accept deleter functions as template arguments (though they are valid in C++11's unique_ptr<>). A few base cryptographic (non-certificate) types are used in scoped_openssl_types.h, while the remainder are left for implementations to specialize as needed. In an ideal world, this would be scoped_ptr<FOO, FOO_free>, but that will require unique_ptr<> support. BUG=388904 Review URL: https://codereview.chromium.org/361193003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@282257 0039d316-1c4b-4281-b951-d872f2087c98
* Remove platform-specific implementations of RSAPrivateKey and SignatureCreatorrsleevi@chromium.org2013-06-271-20/+0
| | | | | | | | | | | | | Use NSS/OpenSSL on all platforms, rather than deferring to the underlying OS routines. Because X509Certificate::CreateSelfSigned no longer relies on platform-native types for RSA keys or certificates, it has been moved to x509_util and simply returns a DER-encoded certificate as a string. BUG=none R=wtc Review URL: https://chromiumcodereview.appspot.com/17265013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@208870 0039d316-1c4b-4281-b951-d872f2087c98
* Implement RSAPrivateKey::Copy()sergeyu@chromium.org2011-12-031-2/+13
| | | | | | | | BUG=105220 Review URL: http://codereview.chromium.org/8727014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@112837 0039d316-1c4b-4281-b951-d872f2087c98
* Fix linux redux buildjoth@chromium.org2011-07-201-5/+5
| | | | | | | | | | | | Follow up to http://codereview.chromium.org/7342047/ stl_util.h seems out of favor, so calling stl method directly as required. BUG=None TEST=Greeness on http://build.chromium.org/p/chromium.fyi/builders/Chromium%20Linux%20Redux/ Review URL: http://codereview.chromium.org/7457021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@93181 0039d316-1c4b-4281-b951-d872f2087c98
* some cleanup for base/stl_utildilmah@chromium.org2011-07-191-2/+2
| | | | | | | | | | | | | removed unused/irrelevant functions removed irrelevant comments Moved stl_util-inl.h => stl_util.h BUG=None TEST=None Review URL: http://codereview.chromium.org/7342047 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@93110 0039d316-1c4b-4281-b951-d872f2087c98
* Move crypto files out of base, to a top level directory.rvargas@google.com2011-04-141-0/+135
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