0
Commit Graph

343 Commits

Author SHA1 Message Date
5a49bc9eb6 Cleanup: Don't check for negative values from EVP_DigestVerifyFinal.
(No longer a possibility in BoringSSL).

Review URL: https://codereview.chromium.org/707973007

Cr-Commit-Position: refs/heads/master@{#303700}
2014-11-11 19:58:31 +00:00
40af916dfb Check trailing data when parsing ASN.1.
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  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}
2014-11-11 00:13:48 +00:00
0f4b277005 Cleanup: Use BN_bn2bin_padded() for zero-padding rather than custom code.
Review URL: https://codereview.chromium.org/711113003

Cr-Commit-Position: refs/heads/master@{#303535}
2014-11-10 23:44:02 +00:00
4376059165 Make *some* version of the Win GN build work.
R=scottmg@chromium.org, brettw@chromium.org
BUG=354261

Review URL: https://codereview.chromium.org/709593004

Cr-Commit-Position: refs/heads/master@{#303366}
2014-11-08 03:00:11 +00:00
c6ac2609dd Add crypto/wincrypt_shim.h wrapper header to resolve BoringSSL conflicts.
wincrypt.h defines macros that conflict with BoringSSL. Introduce a
crypto/wincrypt_shim.h wrapper header which #undefs those macros and
instead #defines replacement ones. All Chromium headers should
use this wrapper header.

BUG=338884

Review URL: https://codereview.chromium.org/686883002

Cr-Commit-Position: refs/heads/master@{#301994}
2014-10-30 00:40:05 +00:00
365d6967b6 NACL_WIN64 takes precedence over USE_OPENSSL.
With the BoringSSL Windows port, it is possible for Windows to
have USE_OPENSSL set. The #ifdefs in symmetric_key.h should still
resolve in the NACL_WIN64 direction.

This fixes the crypto_nacl build target.

BUG=338884

Review URL: https://codereview.chromium.org/689463002

Cr-Commit-Position: refs/heads/master@{#301870}
2014-10-29 17:52:06 +00:00
b8f385c6fd Adding openssl_bio_string to GN build.
BUG=

Review URL: https://codereview.chromium.org/643703008

Cr-Commit-Position: refs/heads/master@{#301368}
2014-10-27 15:46:54 +00:00
0755163095 Type conversion fixes, crypto/ edition.
This is mostly to fix MSVC warnings about possible value truncation.

BUG=81439
TEST=none

Review URL: https://codereview.chromium.org/659943004

Cr-Commit-Position: refs/heads/master@{#300432}
2014-10-21 07:43:22 +00:00
2560ad88c6 Convert the few remaining ARRAYSIZE_UNSAFE -> arraysize.
There are still ARRAYSIZE_UNSAFEs in ppapi/tests/test_audio.cc, but it
defines it itself, and it might be compiled by some older NaCl toolchain
that doesn't support C++11. third_party/npapi/npspy/common/format.cpp
also has its own ARRAYSIZE_UNSAFE, but I'm hoping to delete npspy
completely.)

I'll remove ARRAYSIZE_UNSAFE from base/macro.h separately, since it's
quite likely we have deps that use our base (and those deps may use it).

R=ben@chromium.org
TBR=armansito@chromium.org
BUG=423134

Review URL: https://codereview.chromium.org/663673002

Cr-Commit-Position: refs/heads/master@{#300034}
2014-10-17 01:21:04 +00:00
9961abd411 Allow custom deleters to opt out of self reset checks for scoped_ptr.
The self-reset check makes sense for the default deleters, because it
would otherwise leave a dangling pointer stored in the scoped_ptr.
However, a custom deleter might actually decrement a reference count
under the hood. This self-reset check can make assignment operators
implementation a lot uglier. One example is net's KeyPair: because
there might be a self-assignment, the original code needed to proxy
the incoming scoped_ptrs via a stack temporary before moving them
into their final location.

BUG=418347

Review URL: https://codereview.chromium.org/610533003

Cr-Commit-Position: refs/heads/master@{#299571}
2014-10-14 22:42:51 +00:00
d1c2d2ad30 Replacing the OVERRIDE with override and FINAL with final in /src/crypto
This step is a giant search and replace for OVERRIDE and FINAL to
replace them with their lowercase versions.

BUG=417463

Review URL: https://codereview.chromium.org/632653002

Cr-Commit-Position: refs/heads/master@{#298360}
2014-10-07 04:07:35 +00:00
1aff3f5a54 Add davidben@chromium.org to crypto/OWNERS
BUG=

Review URL: https://codereview.chromium.org/627833002

Cr-Commit-Position: refs/heads/master@{#298124}
2014-10-03 23:58:39 +00:00
50a133b51f Fix crypto_unittests on Windows BoringSSL port.
MSVC is somewhat pickier about casting things to bool.

BUG=338884

Review URL: https://codereview.chromium.org/618123007

Cr-Commit-Position: refs/heads/master@{#297770}
2014-10-02 02:21:01 +00:00
e538952746 Replace forward_dependent_configs with public_deps
This is the new name. It has the same meaning but additionally with a "you can use the headers" permission.

Rename direct_dependent_configs to public_configs. This is the new name with identical meaning.

TBR=jamesr

Review URL: https://codereview.chromium.org/595073002

Cr-Commit-Position: refs/heads/master@{#296302}
2014-09-23 23:42:24 +00:00
0cf460ec9f Generalize crypto::SignatureCreator to allow choice of hash function, so as to support SHA256 (not just SHA1).
BUG=412531

R=rsleevi@chromium.org,davidben@chromium.org

TBR=pfeldman@chromium.org

Review URL: https://codereview.chromium.org/560583002

Cr-Commit-Position: refs/heads/master@{#295747}
2014-09-19 18:46:27 +00:00
c9e38a2735 Cleanup: Use base/files/file_util.h instead of base/file_util.h in [c-n]*/
TBR=cpu@chromium.org,jochen@chromium.org,piman@chromium.org,rockot@chromium.org,rsleevi@chromium.org,vrk@chromium.org
,zea@chromium.org

Review URL: https://codereview.chromium.org/563173002

Cr-Commit-Position: refs/heads/master@{#294712}
2014-09-13 01:10:01 +00:00
71c13e6ac0 Reland dd7edfa67: Switch Mac over to BoringSSL from NSS.
This is a reland of dd7edfa67 which was reverted in 80a9a88f4c for build
failures. It also includes a BoringSSL roll and build changes to avoid adding a
static initializer.

This is a much much larger change than the diff suggests. If it breaks
something, please revert first and ask questions later.

BUG=338885
TBR=brettw

Review URL: https://codereview.chromium.org/568643003

Cr-Commit-Position: refs/heads/master@{#294589}
2014-09-12 15:13:27 +00:00
fa32f2e56a Remove unused user email argument from nss_util.
BUG=413219
(for trivial refactoring)
TBR=willchan@chromium.org,rsleevi@chromium.org,nkostylev@chromium.org

Review URL: https://codereview.chromium.org/560303002

Cr-Commit-Position: refs/heads/master@{#294570}
2014-09-12 10:04:18 +00:00
db7726aee7 Allow a crypto::RSAPrivateKey object to be wrapped round a pre-existing
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}
2014-09-10 23:25:47 +00:00
22ca86792d Combine MSVS warning supression codes
together in crypto.gyp

"msvs_disabled_warnings" code definition present in two place in the same 'target_name': 'crypto'.

Review URL: https://codereview.chromium.org/492963004

Cr-Commit-Position: refs/heads/master@{#291903}
2014-08-26 14:15:00 +00:00
c0fb802166 Add LOCAL_ prefix to non-UMA histogram macros.
This makes it harder to accidently use the wrong
macro.

Also, removes the D* variants of the macros and
associated DebugNow() function. These were rarely
used and removing them removes clutter from the
header file. Existing uses converted to be behind
NDEBUG ifdefs.

No functional changes except for a fix to the
code in content_based_thumbnailing_algorithm.cc
which was incorrectly using a ternary operator for
the histogram name (which doesn't work since the
macros cache the histogram object) and removal
of local histograms Spellcheck.SuggestTime and
Spellcheck.InitTime per groby@.

Since this is an API rename, TBR'ing downstream
owners.

BUG=311349
TBR=groby@chromium.org,zea@chromium.org,jeremy@chromium.org,reveman@chromium.org,agl@chromium.org,jam@chromium.org

Review URL: https://codereview.chromium.org/484603006

Cr-Commit-Position: refs/heads/master@{#291840}
2014-08-26 04:41:10 +00:00
c37c1a8c26 Disable Poly1305 code only on bad chips.
This change detects buggy ARM chips and disables the Poly1305 code only on
those chips.

BUG=341598

Review URL: https://codereview.chromium.org/442863003

Cr-Commit-Position: refs/heads/master@{#288267}
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@288267 0039d316-1c4b-4281-b951-d872f2087c98
2014-08-08 08:47:28 +00:00
cb1f4ac35e Move StringToLowerASCII to base namespace
TBR=sky

Review URL: https://codereview.chromium.org/448853002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@288085 0039d316-1c4b-4281-b951-d872f2087c98
2014-08-07 16:55:42 +00:00
dc06f75b3e Align OpenSSL and NSS ChannelID formats.
NSS would use "" as the password while OpenSSL would use "\0\0" (UCS-2 encoding
of a NUL-terminated string) because of how PKCS#12 recommended encoding
passwords. Make the OpenSSL code use the same format so that we can freely switch
back and forth between NSS and OpenSSL.

(This is in case we need to roll back an OpenSSL cutover and the release has
hit some early release channel already.)

BUG=399121

Review URL: https://codereview.chromium.org/435593003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@287890 0039d316-1c4b-4281-b951-d872f2087c98
2014-08-06 23:11:09 +00:00
b837df322e Disable Poly1305 NEON code again.
The Poly1305 NEON code became live again with the BoringSSL switch. This
change disables it again in Chromium because of some broken phones.

We should really read /proc/cpuinfo and selectively disable, but this
change is simple and keeps the status-quo for now.

BUG=341598

Review URL: https://codereview.chromium.org/443523002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@287630 0039d316-1c4b-4281-b951-d872f2087c98
2014-08-05 22:58:46 +00:00
d09565c4c0 Fix ScopedTestNSSDB for older NSS versions.
Before, if NSS version was < 3.15.1, then the ScopedTempDir was destructed without ScopedAllowIO and lead to a thread restriction violation.

Now, the temp dir is not deleted in this case as the NSS DB is left open.

BUG=210525
TBR=rsleevi@chromium.org

Review URL: https://codereview.chromium.org/423363005

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@287257 0039d316-1c4b-4281-b951-d872f2087c98
2014-08-03 12:47:44 +00:00
442233d487 Enable system NSS key slot.
This only affects users of domains that the device is registered to for policy.
All other users are unaffected (EnableNSSSystemKeySlotForResourceContext is only called for USER_AFFILIATION_MANAGED)

For the affected users, this enables and uses the slot for
- client authentication for TSL (see ClientCertStoreChromeOS)
- client authentication for 802.1x networks
- listing/removing certificates on the settings page (see CertificateManager)

In a follow up, also the enterprise.platformKeys API will be updated.

Depends on:
https://codereview.chromium.org/426983002/
https://codereview.chromium.org/428933002/

BUG=210525
R=mattm@chromium.org, rsleevi@chromium.org, willchan@chromium.org, xiyuan@chromium.org

Review URL: https://codereview.chromium.org/424523002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@287175 0039d316-1c4b-4281-b951-d872f2087c98
2014-08-02 07:37:24 +00:00
2fe8b63061 Implement QUIC key extraction.
Added a new subkey_secret output to crypto::HKDF which is
saved by the forward-secure key derivation and used for a new
ExportKeyingMaterial method on QuicCryptoStream. This will be used
in Chromium for WebRTC on QUIC.

Generated some tests by making a straightforward alternative
implementation in Python.

Written by Daniel Ziegler.

Merge internal CL: 72073257

R=agl@chromium.org,dmziegler@chromium.org
BUG=

Review URL: https://codereview.chromium.org/423333002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@286738 0039d316-1c4b-4281-b951-d872f2087c98
2014-07-31 11:36:37 +00:00
1970276bae Relax the failure mode of EncryptorTest.UnsupportedKeySize so that we
can run the test on all platforms.

R=davidben@chromium.org,joth@chromium.org,rsleevi@chromium.org
BUG=

Review URL: https://codereview.chromium.org/432443003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@286667 0039d316-1c4b-4281-b951-d872f2087c98
2014-07-31 01:03:05 +00:00
f5806ed3e4 [webcrypto] Implement RSA-OAEP using BoringSSL.
BUG=395840
R=davidben@chromium.org, rsleevi@chromium.org

Review URL: https://codereview.chromium.org/419673006

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@286599 0039d316-1c4b-4281-b951-d872f2087c98
2014-07-30 21:28:53 +00:00
966669aef1 Make NSSInitSingleton::tpm_slot_ a ScopedPK11Slot.
Based on https://codereview.chromium.org/426983002/ .

BUG=210525

Review URL: https://codereview.chromium.org/428933002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@286593 0039d316-1c4b-4281-b951-d872f2087c98
2014-07-30 21:03:45 +00:00
8edd721868 Make crypto::GetSystemNSSKeySlot asynchronous.
The system slot is set asynchronously, so the getting the system slot should happen asynchronously as well.

BUG=210525
TBR=rsleevi@chromium.org

Review URL: https://codereview.chromium.org/426983002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@286493 0039d316-1c4b-4281-b951-d872f2087c98
2014-07-30 12:24:29 +00:00
190933f291 Extract ScopedTestNSSDB from nss_util.
Before ScopedTestNSSDB affected several slot getters from nss_util.h .
This change reduces ScopedTestNSSDB to solely setup a temporary test DB and not influencing the global state in nss_util anymore.

As a replacement for some of its old behavior, a new ScopedTestSystemNSSKeySlot is added, which allows to override the slot returned by GetSystemNSSKeySlot().

With this change it's now possible to write tests that need both a user and system NSS DB by using ScopedTestSystemNSSKeySlot.

As a side-effect, GetPersistentNSSKeySlot() is now compiled on !OS_CHROMEOS only.

BUG=210525
(For include changes:)

R=rsleevi@chromium.org
TBR=nkostylev@chromium.org, stevenjb@chromium.org

Review URL: https://codereview.chromium.org/401623006

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@285881 0039d316-1c4b-4281-b951-d872f2087c98
2014-07-28 09:56:51 +00:00
0bb112369a Update masters after the tryserver split.
Also replace deprecated linux_chromium_rel with linux_chromium_rel_swarming, while I'm at it.

R=agable@chromium.org, maruel@chromium.org
BUG=395196

Review URL: https://codereview.chromium.org/415323002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@285752 0039d316-1c4b-4281-b951-d872f2087c98
2014-07-26 04:38:32 +00:00
a534bab7a4 Desupport AES-192 in crypto::SymmetricKey.
BoringSSL does not support AES-192. No current consumer uses AES-192, so remove
the test which asserts it works. This fixes crypto_unittests in the Mac OpenSSL
port. Blacklist AES-192 in the NSS implementation so that we do not
accidentally grow a new dependency on it.

BUG=338885

Review URL: https://codereview.chromium.org/420883003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@285678 0039d316-1c4b-4281-b951-d872f2087c98
2014-07-25 21:04:15 +00:00
edfd0f43f5 Switch to BoringSSL.
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
2014-07-22 18:20:37 +00:00
c9c251d531 clean up code at crypto folder.
BUG=none

Review URL: https://codereview.chromium.org/407713002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@284547 0039d316-1c4b-4281-b951-d872f2087c98
2014-07-22 00:09:25 +00:00
996856a1c8 Revert "Switch to BoringSSL."
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
2014-07-18 23:18:18 +00:00
a9283efe53 Switch to BoringSSL.
(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
2014-07-18 13:51:03 +00:00
83e1ae34e3 Remove NSSCertDatabase from ClientCertStoreChromeOS unittest.
The database was only used to import a PKCS#12 file. By changing to separate key (PKCS#8 format) and cert (X509 in PEM encoding), only dependencies on the lower level RSAPrivateKey, X509Certificate and PK11_* NSS functions are required.
Note this removes at the same time a call to the deprecated NSSCertDatabase::GetInstance().

Also
- fixes multi profile cases of the unit test and the CA matching (the latter is now identical to all other platforms).
- fixes a bug in the matching of client certs from software slots, because of reused cert database names
- gets rid of the error output that occurred during the PKCS12 import because the file contained also a CA cert:
  [ERROR:nsPKCS12Blob.cpp(219)] Could not grab a handle to the certificate in the slot from the corresponding PKCS#12 DER certificate.

BUG=210525, 329735,315285

Review URL: https://codereview.chromium.org/394013005

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@284056 0039d316-1c4b-4281-b951-d872f2087c98
2014-07-18 10:57:07 +00:00
2db830d089 Remove some unnecessary ifs.
scoped_ptr<> only calls the deleter when the data is non-null

Review URL: https://codereview.chromium.org/357783003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@283980 0039d316-1c4b-4281-b951-d872f2087c98
2014-07-18 02:59:36 +00:00
481c3e82e2 Fixes for re-enabling more MSVC level 4 warnings: misc edition
This contains fixes for the following sorts of issues:
* Assignment inside conditional
* Taking the address of a temporary
* Octal escape sequence terminated by decimal number
* Signedness mismatch
* Possibly-uninitialized local variable

This also contains a small number of cleanups to nearby code (e.g. no else after return).

BUG=81439
TEST=none

Review URL: https://codereview.chromium.org/382673002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@283967 0039d316-1c4b-4281-b951-d872f2087c98
2014-07-18 01:40:47 +00:00
2fcd215fc3 Revert 283813 "Switch to BoringSSL."
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
2014-07-17 20:07:06 +00:00
2126ceff10 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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@283813 0039d316-1c4b-4281-b951-d872f2087c98
2014-07-17 17:59:10 +00:00
f7c255ea1d Revert "Switch to BoringSSL."
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
2014-07-17 00:20:36 +00:00
675d5e126b Switch to BoringSSL.
(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
2014-07-16 22:15:31 +00:00
2741040248 Fix memory leaks when calling EVP_PKEY_get1_RSA.
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
2014-07-14 21:01:52 +00:00
49631886cb Add GetSystemNSSKeySlot, merge GetPrivateNSSKeySlot/GetPublicNSSKeySlot to GetPersistentNSSKeySlot.
GetSystemNSSKeySlot returns the ChromeOS system-wide TPM slot.

ChromeOS has separate slots for each user and linux doesn't have a public/private split, so GetPrivateNSSKeySlot no longer makes sense.

BUG=210525
TBR=stevenjb@chromium.org

Review URL: https://codereview.chromium.org/383593002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@282862 0039d316-1c4b-4281-b951-d872f2087c98
2014-07-13 07:19:00 +00:00
4071e6ac6d Remove usage of singleton software_slot_ in nss on ChromeOS
Instead of opening primary user's public slot separately, do it like it's done
for other users: when InitializeNSSForChromeOSUser is called.

This makes primary user's public slot state not dependent on chromeos::TPMTokenLoader.

Also, with this, opening primary users public slot is not bound with enabling
TPM anymore, so the slot may get open for guest user and on Linux ChromeOS.

BUG=383663, 302062

Review URL: https://codereview.chromium.org/317613004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@282817 0039d316-1c4b-4281-b951-d872f2087c98
2014-07-12 12:46:17 +00:00
cd9b75b119 Eliminate ScopedOpenSSL in favour of scoped_ptr<> specializations.
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
2014-07-10 04:39:38 +00:00