summaryrefslogtreecommitdiffstats
path: root/crypto
Commit message (Collapse)AuthorAgeFilesLines
* Use uint32_t to hold return values from ERR_get_error() and ERR_peek_error().eroman2015-03-241-1/+1
| | | | | | | | BUG=None Review URL: https://codereview.chromium.org/1028873002 Cr-Commit-Position: refs/heads/master@{#321919}
* Convert more isolate files to respect use_x11 for Xvfb usagespang2015-03-111-14/+14
| | | | | | | | | | | | | This is a followup to the update to disable Xvfb for OS=="linux" use_x11==0 that converts additional targets. BUG=440882 TEST=isolate.py run -s out_ozone/Debug/<various> TBR=maruel Review URL: https://codereview.chromium.org/996173004 Cr-Commit-Position: refs/heads/master@{#320143}
* Update some comments and code to reflect the fact that HMAC() is no longer ↵eroman2015-03-051-20/+12
| | | | | | | | | | hostile to NULL key data. BUG=395826 Review URL: https://codereview.chromium.org/975273002 Cr-Commit-Position: refs/heads/master@{#319178}
* Update mojo sdk to rev 3d23dae011859a2aae49f1d1adde705c8e85d819rockot2015-03-032-3/+7
| | | | | | | | | | | | | | | | | | | | Highlights: - mojo::ChannelInit has been replaced with content::ChannelInit. - ScopedIPCSupport has been added so Mojo consumers can ensure the EDK is initialized. - single process mode now uses some evil tricks to get child threads to create their mojo client channels on the browser I/O thread. - several Android bits adapted to new interfaces - a number of tests have been adapted to work properly in spite of unconventional process arrangements BUG=None Review URL: https://codereview.chromium.org/954643002 Cr-Commit-Position: refs/heads/master@{#318883}
* Apply gn format with 'sources' sorting to src/scottmg2015-02-281-6/+6
| | | | | | | | | | | | Application of https://codereview.chromium.org/962003002/. TBR=keybuk@chromium.org R=brettw@chromium.org BUG=456014 Review URL: https://codereview.chromium.org/960413003 Cr-Commit-Position: refs/heads/master@{#318574}
* Remove the --lsan=1 flag from .isolate files.earthdok2015-02-271-2/+0
| | | | | | | | | | | | This flag cannot be derived from GYP defines. Rather, the configuration of each specific tester determines whether it should be passed. BUG=455521 R=jam@chromium.org Review URL: https://codereview.chromium.org/957383002 Cr-Commit-Position: refs/heads/master@{#318447}
* Remove dead code in ECPrivateKey.davidben2015-02-252-158/+71
| | | | | | | | | | None of these functions are used. BUG=none Review URL: https://codereview.chromium.org/951753002 Cr-Commit-Position: refs/heads/master@{#318117}
* Fix official build in GNbrettw2015-02-251-0/+9
| | | | | | | | | | | | Changes process_version template. In GYP this is used in two ways and the GN version only supported one of these. This change also deletes an unnecessary fork of the template file, and fixes the dependencies for the extra files (previously they were just passed with "-f" and not added to the inputs of the target. Adds a cdm_adapter template which basically matches the GYP version. Uses this for the media clearkey adapter and the widevine one in the official build. Fixes for the crypto targets when compiling with the official build's checked-in sysroots. Review URL: https://codereview.chromium.org/949233003 Cr-Commit-Position: refs/heads/master@{#318083}
* Convert crypto::ScopedOpenSSL to type aliases.davidben2015-02-214-25/+23
| | | | | | | | | | This avoids having to put '::Type' everywhere. BUG=none Review URL: https://codereview.chromium.org/948543002 Cr-Commit-Position: refs/heads/master@{#317462}
* win vs2015: avoid some variable shadowing warnings in crypto/p224scottmg2015-02-201-15/+15
| | | | | | | | | | | | | | | | | | | | | | | | | e.g. d:\src\cr2\src\crypto\p224.cc(478): error C2220: warning treated as error - no 'object' file generated d:\src\cr2\src\crypto\p224.cc(478): warning C4456: declaration of 'j' hides previous local declaration d:\src\cr2\src\crypto\p224.cc(447): note: see declaration of 'j' d:\src\cr2\src\crypto\p224.cc(498): warning C4456: declaration of 'i' hides previous local declaration d:\src\cr2\src\crypto\p224.cc(447): note: see declaration of 'i' d:\src\cr2\src\crypto\p224.cc(516): warning C4456: declaration of 'i' hides previous local declaration d:\src\cr2\src\crypto\p224.cc(447): note: see declaration of 'i' d:\src\cr2\src\crypto\p224.cc(526): warning C4456: declaration of 'i' hides previous local declaration d:\src\cr2\src\crypto\p224.cc(447): note: see declaration of 'i' d:\src\cr2\src\crypto\p224.cc(694): warning C4458: declaration of 'x' hides class member d:\src\cr2\src\crypto\p224.h(35): note: see declaration of 'crypto::p224::Point::x' d:\src\cr2\src\crypto\p224.cc(694): warning C4458: declaration of 'y' hides class member d:\src\cr2\src\crypto\p224.h(35): note: see declaration of 'crypto::p224::Point::y' R=rsleevi@chromium.org BUG=440500 Review URL: https://codereview.chromium.org/945633003 Cr-Commit-Position: refs/heads/master@{#317398}
* Add net/ssl/scoped_openssl_types.h.davidben2015-02-201-0/+2
| | | | | | | | | | | | To have a common definition of SSL and X.509 types that would belong in crypto/scoped_openssl_types.h. Also define some addition ECC-related scopers that get used multiple times. BUG=none Review URL: https://codereview.chromium.org/924053002 Cr-Commit-Position: refs/heads/master@{#317268}
* Update existing uses of /wd4267 to use the GN configbrettw2015-02-191-5/+3
| | | | | | | | | | This is the size_t to integer conversion warning. Using the config prevents flag duplication and is clearer to read. Minor updates to Win64 build, including some fixes for size_t to int conversions. Review URL: https://codereview.chromium.org/929793006 Cr-Commit-Position: refs/heads/master@{#317162}
* Isolate crypto_unittestsscottmg2015-02-132-0/+89
| | | | | | | | | | R=maruel@chromium.org TBR=jam@chromium.org BUG=98637 Review URL: https://codereview.chromium.org/875353004 Cr-Commit-Position: refs/heads/master@{#316146}
* Revert of "Revert of "Move the call to CRYPTO_set_NEON_capable up.""Adam Langley2015-02-031-10/+12
| | | | | | | | | | | This reverts commit 02f7bf1302c3e613b887fbb3f46dd54f5f5888d3 and thus effectively relands fa9063829e638aeb72ede79e5d0396a81a0211d1. That commit was suspected of breaking the EME tests but reverting it didn't unbreak anything. https://codereview.chromium.org/899463002/ Cr-Commit-Position: refs/heads/master@{#314375}
* Revert of Move the call to CRYPTO_set_NEON_capable up. (patchset #1 id:1 of ↵noel2015-02-031-12/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/899463002/) Reason for revert: Suspect this change upset the webkit ChromeOS Test 1, Mac 10.8, encrypted media tests. Reverting to see if these builders turn green. http://build.chromium.org/p/chromium.webkit/builders/Linux%20ChromiumOS%20Tests%20%281%29/builds/9563 Original issue's description: > Move the call to CRYPTO_set_NEON_capable up. > > BoringSSL needs to probe for NEON support via SIGILL in cases where > getauxval isn't provided and the application doesn't do explicit > initialisation. > > However, Chromium might have gone multithreaded by the time that we > initialise BoringSSL and, although it doesn't look like we'll race the > disposition of SIGILL with anything, it's best not to test that hope. > > So this change causes CRYPTO_set_NEON_capable to always be called, and > to be called before SSL_library_init. BoringSSL will take that as a > signal that probing for NEON support isn't needed. > > BUG=none > > Committed: https://crrev.com/fa9063829e638aeb72ede79e5d0396a81a0211d1 > Cr-Commit-Position: refs/heads/master@{#314201} TBR=davidben@chromium.org,agl@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=none Review URL: https://codereview.chromium.org/895013002 Cr-Commit-Position: refs/heads/master@{#314301}
* Move the call to CRYPTO_set_NEON_capable up.agl2015-02-021-10/+12
| | | | | | | | | | | | | | | | | | | | BoringSSL needs to probe for NEON support via SIGILL in cases where getauxval isn't provided and the application doesn't do explicit initialisation. However, Chromium might have gone multithreaded by the time that we initialise BoringSSL and, although it doesn't look like we'll race the disposition of SIGILL with anything, it's best not to test that hope. So this change causes CRYPTO_set_NEON_capable to always be called, and to be called before SSL_library_init. BoringSSL will take that as a signal that probing for NEON support isn't needed. BUG=none Review URL: https://codereview.chromium.org/899463002 Cr-Commit-Position: refs/heads/master@{#314201}
* Renamed GetMessage into GetNextMessage.vitalybuka2015-01-293-15/+15
| | | | | | | | | | | Windows defines GetMessage as GetMessageW. This makes linking fail if p224_spake included after windows headers. NOPRESUBMIT=true Review URL: https://codereview.chromium.org/889663003 Cr-Commit-Position: refs/heads/master@{#313782}
* Using "static_assert" in lieu of "COMPILE_ASSERT" in crypto moduleanujk.sharma2015-01-221-2/+2
| | | | | | | | | | All our toolchains support c++'s static_assert now- COMPILE_ASSERT can be removed now. BUG=442514 Review URL: https://codereview.chromium.org/860323002 Cr-Commit-Position: refs/heads/master@{#312535}
* Move the test template to //testing/test.gni (part 2)qsr2015-01-211-0/+1
| | | | | | | | | | | | This CL move the test target from build/config/BUILDCONFIG.gn to testing/test.gni It also update the test template to automatically build an apk on Android. R=cjhopman@chromium.org,brettw@chromium.org Review URL: https://codereview.chromium.org/824263004 Cr-Commit-Position: refs/heads/master@{#312396}
* Use EVP_DigestSign* rather than EVP_Sign* in SignatureCreator.davidben2015-01-213-15/+15
| | | | | | | | | | | | Avoids having to hold on to the key separately. EVP_DigestSign is tidier about bounds checks and maximum buffer size. Also account for the return values having been normalized. BUG=none Review URL: https://codereview.chromium.org/382633009 Cr-Commit-Position: refs/heads/master@{#312357}
* mac: Expose keychain access frequency to Telemetry.erikchen2015-01-152-0/+26
| | | | | | | | | | | | | | | | | | | | | Accessing the keychain is really slow. Telemetry tests use a mock keychain, which is abnormally fast. This CL exposes the number of times the mock keychain is accessed via a local histogram, and 4 telemetry measurements record that number as a metric. Those tests are: - speedometer - page_cycler - startup - tab_switching Once this metric is collected, alerts will be added to the Telemetry dashboard to help catch regressions to the number of times the keychain gets accessed. BUG= Review URL: https://codereview.chromium.org/714273004 Cr-Commit-Position: refs/heads/master@{#311744}
* crypto: use minimal ASN.1 lengths.agl2015-01-101-18/+25
| | | | | | | | | | | | | | | An NSS update has (correctly) become stricter about ASN.1 lengths and is causing SignatureVerifierTest.VerifyRSAPSS to fail. This change fixes the test so that it uses minimal (DER) lengths. (I don't actually have the updated NSS, so this is speculative.) BUG=447759 Review URL: https://codereview.chromium.org/844073003 Cr-Commit-Position: refs/heads/master@{#310914}
* Update {virtual,override,final} for crypto/ to follow C++11 style.dcheng2015-01-091-54/+51
| | | | | | | | | | | This patch was automatically generated using a variation of https://codereview.chromium.org/598073004 on a Mac build. BUG=417463 Review URL: https://codereview.chromium.org/817733003 Cr-Commit-Position: refs/heads/master@{#310664}
* Make array initialize list to match array size.vitalybuka2015-01-071-2/+2
| | | | | | | | | | | | Nothing was broken, just looks confusing. Arrays size is 8 but initializer is 7. BUG=None NOPRESUBMIT=true Review URL: https://codereview.chromium.org/793813003 Cr-Commit-Position: refs/heads/master@{#310342}
* Don't allow importing non-RSA keys from ↵eroman2015-01-022-1/+28
| | | | | | | | | | crypto::RSAPrivateKey::CreateFromPrivateKeyInfo(). BUG=445927 Review URL: https://codereview.chromium.org/805193004 Cr-Commit-Position: refs/heads/master@{#309854}
* Fix build break of use_openssl=1 caused by strict enforcement of override ↵eroman2015-01-021-5/+5
| | | | | | | | | | | | | checks on Linux. Caused by: https://chromium.googlesource.com/chromium/src/+/e8d2cde55fe3fcc12f557e413c7afaef574cb4b4 BUG=417463 TBR=rsleevi@chromium.org Review URL: https://codereview.chromium.org/825293003 Cr-Commit-Position: refs/heads/master@{#309835}
* Uses "#pragma GCC reset_options" to re-enable optimizations after ↵varkha2014-12-231-1/+2
| | | | | | | | | | | | ReduceLarge function This ensures that compiler optimizations are restored to the state as it was before ReduceLarge function. Previous CL https://codereview.chromium.org/814273004 could have a possible side effect of enabling "tree-vectorize" optimizations for the rest of the file even when they were disabled in build settings. BUG=439566 Review URL: https://codereview.chromium.org/819893002 Cr-Commit-Position: refs/heads/master@{#309537}
* Standardize usage of virtual/override/final specifiers in crypto/.dcheng2014-12-224-15/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Google C++ style guide states: Explicitly annotate overrides of virtual functions or virtual destructors with an override or (less frequently) final specifier. Older (pre-C++11) code will use the virtual keyword as an inferior alternative annotation. For clarity, use exactly one of override, final, or virtual when declaring an override. To better conform to these guidelines, the following constructs have been rewritten: - if a base class has a virtual destructor, then: virtual ~Foo(); -> ~Foo() override; - virtual void Foo() override; -> void Foo() override; - virtual void Foo() override final; -> void Foo() final; This patch was automatically generated. The clang plugin can generate fixit hints, which are suggested edits when it is 100% sure it knows how to fix a problem. The hints from the clang plugin were applied to the source tree using the tool in https://codereview.chromium.org/598073004. Several formatting edits by clang-format were manually reverted, due to mangling of some of the more complicate IPC macros. BUG=417463# Review URL: https://codereview.chromium.org/825503002 Cr-Commit-Position: refs/heads/master@{#309488}
* Disable auto-vectorization of P224 ReduceLarge() under GCC.wez2014-12-201-0/+14
| | | | | | | | | | | | Something about automatic tree vectorization breaks ReduceLarge(), so disable the optimization for this function until we determine the real fix. BUG=439566 Review URL: https://codereview.chromium.org/814273004 Cr-Commit-Position: refs/heads/master@{#309335}
* Clean up presubmit filesPaweł Hajdan, Jr2014-12-191-17/+0
| | | | | | | | | | | | | - remove mapping of builders to tests, in recipes there is no testfilter anyway - remove redundant presubmit files (with trybots present in top-level presubmit) - use "ng" trybots where possible BUG=none R=maruel@chromium.org Review URL: https://codereview.chromium.org/815913002 Cr-Commit-Position: refs/heads/master@{#309245}
* Added unittest to make sure future changes in P224EncryptedKeyExchange don't ↵Vitaly Buka2014-12-103-7/+69
| | | | | | | | | | | | | change output. External implementations already expect this values. BUG=438470 R=agl@chromium.org, gene@chromium.org Review URL: https://codereview.chromium.org/789743002 Cr-Commit-Position: refs/heads/master@{#307654}
* Allow to get key from SPAKE2 after the first round trip.Vitaly Buka2014-12-043-11/+25
| | | | | | | | | | | | The second round trip is optional and is not the part of SPAKE2 algorithm. Application may want to get key and do verification with usefull payload. BUG=438470 R=agl@chromium.org Review URL: https://codereview.chromium.org/761663004 Cr-Commit-Position: refs/heads/master@{#306844}
* gn format // (the rest, except mojo)scottmg2014-12-031-5/+8
| | | | | | | | | | | | | | Excluded mojo because I think that needs to happen on the other side. At gn --version = 306668 for which roll is in CQ. R=brettw@chromium.org TBR=scherkus@chromium.org BUG=348474 Review URL: https://codereview.chromium.org/774353003 Cr-Commit-Position: refs/heads/master@{#306708}
* Don't allow trailing data when creating an RSAPrivateKey.davidben2014-11-243-16/+35
| | | | | | | | | | | 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}
* Fix crypto and net build on Windows GN.jam2014-11-141-0/+5
| | | | | | Review URL: https://codereview.chromium.org/732613003 Cr-Commit-Position: refs/heads/master@{#304233}
* Add scoped_ptr to Environment object.jorgelo2014-11-131-1/+2
| | | | | | | | | BUG=None TEST=Compiles. Review URL: https://codereview.chromium.org/722513005 Cr-Commit-Position: refs/heads/master@{#304085}
* Fix BoringSSL + Windows build.davidben2014-11-111-1/+1
| | | | | | | | BUG=none Review URL: https://codereview.chromium.org/706763004 Cr-Commit-Position: refs/heads/master@{#303754}
* Cleanup: Don't check for negative values from EVP_DigestVerifyFinal.eroman2014-11-111-2/+1
| | | | | | | | (No longer a possibility in BoringSSL). Review URL: https://codereview.chromium.org/707973007 Cr-Commit-Position: refs/heads/master@{#303700}
* Check trailing data when parsing ASN.1.davidben2014-11-114-16/+36
| | | | | | | | | | | | | | | | | | | 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}
* Cleanup: Use BN_bn2bin_padded() for zero-padding rather than custom code.eroman2014-11-101-15/+4
| | | | | | Review URL: https://codereview.chromium.org/711113003 Cr-Commit-Position: refs/heads/master@{#303535}
* Make *some* version of the Win GN build work.dpranke2014-11-081-43/+48
| | | | | | | | | R=scottmg@chromium.org, brettw@chromium.org BUG=354261 Review URL: https://codereview.chromium.org/709593004 Cr-Commit-Position: refs/heads/master@{#303366}
* Add crypto/wincrypt_shim.h wrapper header to resolve BoringSSL conflicts.davidben2014-10-305-3/+29
| | | | | | | | | | | | | 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}
* NACL_WIN64 takes precedence over USE_OPENSSL.davidben2014-10-291-7/+7
| | | | | | | | | | | | | | 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}
* Adding openssl_bio_string to GN build.pwestin2014-10-271-0/+7
| | | | | | | | BUG= Review URL: https://codereview.chromium.org/643703008 Cr-Commit-Position: refs/heads/master@{#301368}
* Type conversion fixes, crypto/ edition.pkasting2014-10-213-22/+27
| | | | | | | | | | | 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}
* Convert the few remaining ARRAYSIZE_UNSAFE -> arraysize.viettrungluu2014-10-171-3/+3
| | | | | | | | | | | | | | | | | | | 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}
* Allow custom deleters to opt out of self reset checks for scoped_ptr.dcheng2014-10-142-0/+3
| | | | | | | | | | | | | | | | | 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}
* Replacing the OVERRIDE with override and FINAL with final in /src/cryptoanujk.sharma2014-10-074-21/+21
| | | | | | | | | | | 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}
* Add davidben@chromium.org to crypto/OWNERSdavidben2014-10-031-0/+1
| | | | | | | | BUG= Review URL: https://codereview.chromium.org/627833002 Cr-Commit-Position: refs/heads/master@{#298124}
* Fix crypto_unittests on Windows BoringSSL port.davidben2014-10-023-10/+3
| | | | | | | | | | 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}