summaryrefslogtreecommitdiffstats
path: root/crypto
Commit message (Collapse)AuthorAgeFilesLines
* openssl: Implement crypto::ECPrivateKey.digit@chromium.org2013-10-172-26/+166
| | | | | | | | | BUG=306176 R=rsleevi@chromium.org, wtc@chromium.org, agl@chromium.org Review URL: https://codereview.chromium.org/27195002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@229153 0039d316-1c4b-4281-b951-d872f2087c98
* Update the NSS bug number for the invalid read when AES-CBC decrypting.wtc@chromium.org2013-10-021-1/+1
| | | | | | | | | | R=eroman@chromium.org BUG=300681 TEST=none Review URL: https://codereview.chromium.org/25637004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@226530 0039d316-1c4b-4281-b951-d872f2087c98
* Prevent invalid memory read when AES-CBC decrypting.eroman@chromium.org2013-10-012-3/+38
| | | | | | | | | | The issue happens when the ciphertext is not a multiple of the block size. BUG=300681 Review URL: https://codereview.chromium.org/25164002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@226199 0039d316-1c4b-4281-b951-d872f2087c98
* Rename "decypted" to "decrypted".eroman@chromium.org2013-09-301-28/+28
| | | | | | | | | | I presume this was a typo that got replicated throughout encryptor_unittest.cc BUG=NONE Review URL: https://codereview.chromium.org/25163002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@225951 0039d316-1c4b-4281-b951-d872f2087c98
* add missing #include of <algorithm>, needed on VS2013 for std::minscottmg@chromium.org2013-09-121-0/+2
| | | | | | | | | R=rsleevi@chromium.org BUG=288948 Review URL: https://chromiumcodereview.appspot.com/23684060 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@222895 0039d316-1c4b-4281-b951-d872f2087c98
* crypto: Don't try to init NSS with nonexistent DB.derat@chromium.org2013-09-121-7/+9
| | | | | | | | | | | | | | This makes non-test Chrome OS images avoid trying to initialize /etc/fake_root_ca/nssdb to avoid an "Error initializing NSS with a persistent database (sql:/etc/fake_root_ca/nssdb): NSS error code: -8174" message that gets logged multiple times at startup. BUG=none Review URL: https://chromiumcodereview.appspot.com/23654019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@222856 0039d316-1c4b-4281-b951-d872f2087c98
* Convert most run_all_unittests.cc files to use new unit test launcher.phajdan.jr@chromium.org2013-09-052-21/+1
| | | | | | | | | | | | | Note that the new code is still behind a runtime flag (--brave-new-test-launcher), but compiling tests with support for it will make further testing possible. BUG=236893, 79359 R=akalin@chromium.org, enne@chromium.org, erikwright@chromium.org, joi@chromium.org, keybuk@chromium.org, sky@chromium.org, thestig@chromium.org, tommi@chromium.org, wtc@chromium.org, xhwang@chromium.org, yzshen@chromium.org Review URL: https://codereview.chromium.org/23442019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@221464 0039d316-1c4b-4281-b951-d872f2087c98
* Make CryptohomeClientImplStub and ScopedTestNSSDB use the same TokenName.pneubeck@chromium.org2013-08-122-1/+6
| | | | | | | | | | | This allows for tests which rely on CertLoader::IsHardwareBacked returning true. BUG=NONE R=agl@chromium.org, stevenjb@chromium.org Review URL: https://codereview.chromium.org/22407013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@216991 0039d316-1c4b-4281-b951-d872f2087c98
* Reland http://crrev.com/209278rsleevi@chromium.org2013-08-072-17/+7
| | | | | | | | | | | | | | | | | Update dependency to NSS >= 3.14.3 and NSPR >= 4.9.2 Technically NSS 3.14.3 depends on NSPR 4.9.5, but Debian stable still ships 4.9.2 on stable, so this is the lower bound. 3.14.3 contains a number of important security fixes, and support for older systems is no longer desirable. BUG=245370 TBR=thestig@chromium.org, wtc@chromium.org Review URL: https://chromiumcodereview.appspot.com/20615002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@216296 0039d316-1c4b-4281-b951-d872f2087c98
* [MIPS] Add additional directory for NSS librariespetarj@mips.com2013-08-011-1/+3
| | | | | | | | | | | | Add correct path for NSS libraries on MIPS. Tested on Debian Wheezy. BUG=130022 TEST=build and run Chromium Review URL: https://chromiumcodereview.appspot.com/21029006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@214931 0039d316-1c4b-4281-b951-d872f2087c98
* Fix a bug where packing an extension with bad private key causes crash.DHNishi@gmail.com2013-07-311-1/+0
| | | | | | | | | BUG=263968 TEST=PackExtensionTest.ExtensionWithInvalidKey Review URL: https://chromiumcodereview.appspot.com/20794003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@214622 0039d316-1c4b-4281-b951-d872f2087c98
* net: fix buffer overflow in GHASH.agl@chromium.org2013-07-172-12/+20
| | | | | | | | | | | Thanks to Joel Sing for noticing. BUG=none R=rtenneti@chromium.org Review URL: https://codereview.chromium.org/19619003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@212090 0039d316-1c4b-4281-b951-d872f2087c98
* Introduce RSAPrivateKey::SignDigestpfeldman@chromium.org2013-07-094-6/+100
| | | | | | | | | BUG=258017 R=rsleevi@chromium.org Review URL: https://codereview.chromium.org/18697003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@210524 0039d316-1c4b-4281-b951-d872f2087c98
* OpenSSL/NSS implementation of ProofVerfifier.rtenneti@chromium.org2013-07-032-5/+26
| | | | | | | | | | Changes to make ProofVerifier asynchronous. Each QuicSession's ProofVerifier is used to verify the signature and cert chain. Implemented generation counter in QuicCryptoClientConfig's CachedState in case certs change when we are verifying the Proof. Review URL: https://chromiumcodereview.appspot.com/17385010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@209946 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 209515 "Reland http://crrev.com/209278"rsleevi@chromium.org2013-07-012-7/+17
| | | | | | | | | | | | | | | | | | | | | | | > Reland http://crrev.com/209278 > > Update dependency to NSS >= 3.14.3 and NSPR >= 4.9.2 > > Technically NSS 3.14.3 depends on NSPR 4.9.5, but Debian stable still > ships 4.9.2 on stable, so this is the lower bound. > > 3.14.3 contains a number of important security fixes, and support for > older systems is no longer desirable. > > BUG=245370 > TBR=thestig@chromium.org, wtc@chromium.org > > Review URL: https://chromiumcodereview.appspot.com/18332012 TBR=rsleevi@chromium.org Review URL: https://codereview.chromium.org/18414004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@209534 0039d316-1c4b-4281-b951-d872f2087c98
* Reland http://crrev.com/209278rsleevi@chromium.org2013-07-012-17/+7
| | | | | | | | | | | | | | | | | Update dependency to NSS >= 3.14.3 and NSPR >= 4.9.2 Technically NSS 3.14.3 depends on NSPR 4.9.5, but Debian stable still ships 4.9.2 on stable, so this is the lower bound. 3.14.3 contains a number of important security fixes, and support for older systems is no longer desirable. BUG=245370 TBR=thestig@chromium.org, wtc@chromium.org Review URL: https://chromiumcodereview.appspot.com/18332012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@209515 0039d316-1c4b-4281-b951-d872f2087c98
* Use the HASH_ResultLenContext and HASH_GetType functions, now that theywtc@chromium.org2013-07-011-2/+2
| | | | | | | | | | | | are exported. R=rsleevi@chromium.org BUG=none TEST=none Review URL: https://chromiumcodereview.appspot.com/18181018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@209388 0039d316-1c4b-4281-b951-d872f2087c98
* Actually close the test NSS DB when ScopedTestNSSDB is destroyedrsleevi@chromium.org2013-06-291-11/+14
| | | | | | | | | | | | NSS 3.15.1 fixes all known errors with SECMOD_CloseUserDB, so it can now be safely used again while testing BUG=156433 R=mattm Review URL: https://chromiumcodereview.appspot.com/18238002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@209351 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 209278 "Update dependency to NSS >= 3.14.3 and NSPR >= 4.9.2"joaodasilva@chromium.org2013-06-292-7/+17
| | | | | | | | | | | | | | | | | | | | | > Update dependency to NSS >= 3.14.3 and NSPR >= 4.9.2 > > Technically NSS 3.14.3 depends on NSPR 4.9.5, but Debian stable still > ships 4.9.2 on stable, so this is the lower bound. > > 3.14.3 contains a number of important security fixes, and support for > older systems is no longer desirable. > > BUG=245370 > R=thestig@chromium.org, wtc@chromium.org > > Review URL: https://chromiumcodereview.appspot.com/18063013 TBR=rsleevi@chromium.org Review URL: https://codereview.chromium.org/18181019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@209282 0039d316-1c4b-4281-b951-d872f2087c98
* Update dependency to NSS >= 3.14.3 and NSPR >= 4.9.2rsleevi@chromium.org2013-06-292-17/+7
| | | | | | | | | | | | | | | Technically NSS 3.14.3 depends on NSPR 4.9.5, but Debian stable still ships 4.9.2 on stable, so this is the lower bound. 3.14.3 contains a number of important security fixes, and support for older systems is no longer desirable. BUG=245370 R=thestig@chromium.org, wtc@chromium.org Review URL: https://chromiumcodereview.appspot.com/18063013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@209278 0039d316-1c4b-4281-b951-d872f2087c98
* Add SignatureVerifier::VerifyInitRSAPSS for verifying RSA-PSS signatures.wtc@chromium.org2013-06-288-38/+1315
| | | | | | | | | | | | | | | | | Change the OpenSSL-based SignatureVerifier to use EVP_DigestVerifyInit instead of EVP_VerifyInit_ex. Copy the PSS padding verification code from NSS to the NSS-based SignatureVerifier because the RSA-PSS code in the NSS softoken isn't exposed via the NSS PK11_ or VFY_ functions yet. R=agl@chromium.org,rsleevi@chromium.org BUG=none TEST=to be added to net_unittests via testing net::quic::ProofVerifier. Review URL: https://chromiumcodereview.appspot.com/17776003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@209178 0039d316-1c4b-4281-b951-d872f2087c98
* Use a direct include of time headers in courgette/, crypto/, dbus/, device/, ↵avi@chromium.org2013-06-284-4/+4
| | | | | | | | | | | | google_apis/, gpu/, ipc/, jingle/. BUG=254986 TEST=none TBR=ben@chromium.org Review URL: https://codereview.chromium.org/18156002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@209149 0039d316-1c4b-4281-b951-d872f2087c98
* Remove platform-specific implementations of RSAPrivateKey and SignatureCreatorrsleevi@chromium.org2013-06-2710-777/+60
| | | | | | | | | | | | | 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
* mac: Update clients of scoped_nsobject.h.thakis@chromium.org2013-06-241-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | 1.) The header is now in base/mac instead of base/memory 2.) The class is now in namespace base. This CL was created programmatically by running: 1.) git grep -l memory/scoped_nsobject.h | xargs sed -i -e 's/memory\/scoped_nsobject.h/mac\/scoped_nsobject.h/g' for f in $(git diff --name-only origin); do tools/sort-headers.py $f -f; done git commit -a -m headers # manually undo changes to gypi file git cl upload # patch set 1 2.) git grep -l 'scoped_nsobject<' | xargs sed -i -e 's/scoped_nsobject</base::scoped_nsobject</g' # manually undo comment changes in scoped_nsobject.h, tracking_area.h git commit -a -m format git cl upload # patch set 2 # Manually audit all files, file bugs and clean up bad clang-format decisions git cl upload # patch set 3 BUG=251957 TBR=mark@chromium.org Review URL: https://codereview.chromium.org/17593006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@208283 0039d316-1c4b-4281-b951-d872f2087c98
* mac: Replace base::mac::ScopedCFTypeRef with base::ScopedCFTypeRef.thakis@chromium.org2013-06-242-14/+8
| | | | | | | | | | | | | | | | | This CL was created fully mechanically by running git grep -l base::mac::ScopedCFTypeRef | xargs sed -i -e 's/base::mac::ScopedCFTypeRef/base::ScopedCFTypeRef/g' git commit -a -m. git clang-format HEAD^ --style=Chromium git commit -a -m. git cl upload -t $TITLE BUG=251957 TBR=mark@chromium.org Review URL: https://codereview.chromium.org/16917011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@208245 0039d316-1c4b-4281-b951-d872f2087c98
* On NSS, treat non-permanent RSA private keys as ephemeralrsleevi@chromium.org2013-06-211-2/+4
| | | | | | | | | | | | | | When generating/using a crypto::RSAPrivateKey with NSS, prefer the internal software slot over other modules (such as any TPMs [ChromeOS] or smart cards [Linux]) if the key being generated is not marked as a permanent key. BUG=none R=wtc Review URL: https://chromiumcodereview.appspot.com/17447009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@207853 0039d316-1c4b-4281-b951-d872f2087c98
* Support CTR-AES in encryptor_openssl.xhwang@chromium.org2013-06-133-33/+240
| | | | | | | | | | BUG=163552 TEST=Added unittest to cover CTR-AES encryption/decryption. Also tested AesDecryptorTest in media_unittests. Review URL: https://chromiumcodereview.appspot.com/16654005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@206141 0039d316-1c4b-4281-b951-d872f2087c98
* Use a direct include of strings headers in crypto/, dbus/, device/.avi@chromium.org2013-06-119-10/+10
| | | | | | | | | | BUG=247723 TEST=none TBR=ben@chromium.org Review URL: https://chromiumcodereview.appspot.com/16123026 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@205457 0039d316-1c4b-4281-b951-d872f2087c98
* Remove unused crypto::GetSupplementalUserKey() method.davidroche@chromium.org2013-06-112-62/+0
| | | | | | | | BUG= Review URL: https://chromiumcodereview.appspot.com/16163008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@205374 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 202305 "Destroy all Singletons and LazyInstances between ..."rsesek@chromium.org2013-05-251-2/+3
| | | | | | | | | | | | | | | | | | | > Destroy all Singletons and LazyInstances between each test. > > This modifies base::TestSuite to add a test listener that runs the AtExitManager > between each test. > > BUG=110594, 156433, 238654 > TEST=*unit*tests > R=apatrick@chromium.org, gspencer@chromium.org, phajdan.jr@chromium.org, pneubeck@chromium.org, rsleevi@chromium.org > > Review URL: https://codereview.chromium.org/8947021 TBR=rsesek@chromium.org Review URL: https://codereview.chromium.org/16063002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@202312 0039d316-1c4b-4281-b951-d872f2087c98
* Destroy all Singletons and LazyInstances between each test.rsesek@chromium.org2013-05-251-3/+2
| | | | | | | | | | | | | This modifies base::TestSuite to add a test listener that runs the AtExitManager between each test. BUG=110594, 156433, 238654 TEST=*unit*tests R=apatrick@chromium.org, gspencer@chromium.org, phajdan.jr@chromium.org, pneubeck@chromium.org, rsleevi@chromium.org Review URL: https://codereview.chromium.org/8947021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@202305 0039d316-1c4b-4281-b951-d872f2087c98
* Fix crypto target on linux-redux when using clangrsleevi@chromium.org2013-05-091-4/+4
| | | | | | | | | BUG=none R=wtc Review URL: https://chromiumcodereview.appspot.com/14598019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@199272 0039d316-1c4b-4281-b951-d872f2087c98
* Add RSAPrivateKey::CreateFromKeypair()cmasone@chromium.org2013-05-083-6/+51
| | | | | | | | | | | Add a static method to create an RSAPrivateKey object from an NSS public/private keypair. Only declared and implemented when USE_NSS is defined. BUG=235179 Review URL: https://chromiumcodereview.appspot.com/14941007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@198985 0039d316-1c4b-4281-b951-d872f2087c98
* Fix client certificate authentication on Mac and Linux introduced in r178732rsleevi@chromium.org2013-04-251-1/+0
| | | | | | | | | | | | | | | | | | | | When requesting client authentication, the SSL server may send a list of acceptable CAs. When discovering matching client certificates, the Mac and Linux implementations were not fully considering all intermediate certificates when attempting to discover client certificates. For example, if the client certficate chain was CC -> Intermediate -> Root, and the server sent a list of acceptable CAs as Root, then on Mac and Linux, CC would not be considered, whereas on Windows it would. Further, if the server listed Intermediate as an acceptable CA, then it would work on all platforms. BUG=224280, 224897 TEST=See https://docs.google.com/a/chromium.org/document/d/19V5_PBSm7OaFLXzTXdiCdSpt1r1yFYJhuH9X41O2oOs/edit?usp=sharing R=wtc@chromium.org Review URL: https://chromiumcodereview.appspot.com/13866049 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@196535 0039d316-1c4b-4281-b951-d872f2087c98
* Update the remaining include paths of base/string_piece.h to its new location.tfarina@chromium.org2013-04-178-8/+8
| | | | | | | | | | | string_piece.h was moved into base/strings/ in r191206 - https://chromiumcodereview.appspot.com/12982018/ TBR=brettw@chromium.org Review URL: https://codereview.chromium.org/14272007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@194693 0039d316-1c4b-4281-b951-d872f2087c98
* Rewrite scoped_array<T> to scoped_ptr<T[]> in crypto.dcheng@chromium.org2013-04-112-7/+7
| | | | | | | | | | | | This is a manual cleanup pass using sed for files which are not built on Linux. BUG=171111 Review URL: https://chromiumcodereview.appspot.com/13831003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@193667 0039d316-1c4b-4281-b951-d872f2087c98
* Finish scoped_array<T> to scoped_ptr<T[]> conversion on Linux.dcheng@chromium.org2013-04-092-2/+2
| | | | | | | | | | | There are only a few instances left in the Linux build, so lumping them all into one patch. BUG=171111 Review URL: https://codereview.chromium.org/13916003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@193134 0039d316-1c4b-4281-b951-d872f2087c98
* Rewrite std::string("") to std::string(), Linux edition.dcheng@chromium.org2013-04-092-5/+6
| | | | | | | | | | | | | | | | | | | This patch was generated by running the empty_string clang tool across the Chromium Linux compilation database. Implicitly or explicitly constructing std::string() with a "" argument is inefficient as the caller needs to emit extra instructions to pass an argument, and the constructor needlessly copies a byte into internal storage. Rewriting these instances to simply call the default constructor appears to save ~14-18 kilobytes on an optimized release build. BUG=none Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=193020 Review URL: https://codereview.chromium.org/13145003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@193040 0039d316-1c4b-4281-b951-d872f2087c98
* Revert "Rewrite std::string("") to std::string(), Linux edition."dcheng@chromium.org2013-04-092-6/+5
| | | | | | | | | | | | | | This reverts commit e59558b78e8c6a1b0bd916a724724b638c3c91b6. Revert "Fix build after r193020." This reverts commit 558a35897f6b3ffbcaefde927c1f150b815d140a. Revert "Really fix build after r193020." This reverts commit e3748a79b523a8d365d4a33ef986eebb4186fa78. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@193030 0039d316-1c4b-4281-b951-d872f2087c98
* Rewrite std::string("") to std::string(), Linux edition.dcheng@chromium.org2013-04-092-5/+6
| | | | | | | | | | | | | | | | | This patch was generated by running the empty_string clang tool across the Chromium Linux compilation database. Implicitly or explicitly constructing std::string() with a "" argument is inefficient as the caller needs to emit extra instructions to pass an argument, and the constructor needlessly copies a byte into internal storage. Rewriting these instances to simply call the default constructor appears to save ~14-18 kilobytes on an optimized release build. BUG=none Review URL: https://codereview.chromium.org/13145003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@193020 0039d316-1c4b-4281-b951-d872f2087c98
* Add support for P-256 key exchange in crypto handshake.rtenneti@chromium.org2013-03-311-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Merge internal change: 44173744 Add default return to avoid crashing when we get an unknown error code from the peer. Merge internal change: 44160057 Fix incorrect DCHECK while serializing version negotiation packet. Merge internal change: 44156166 Reorder the addends in GetPacketHeaderSize to match the order of the public header fields. Merge internal change: 44153020 Changing retransmission and retransmittable data boolean flags to enums. Merge internal change: 44071662 Remove methods from QuicTime for converting to/from microseconds and milliseconds since the epoch for QuicTime is unspecified. (It wraps TimeTicks in Chromium). Merge internal change: 44069965 Change InterArrival feedback message to traffic in delta since the "start" of the connection instead of a delta since the epoch. One step closer to being able to remove QuicTime::To/FromMicroseconds since those methods don't "do the right thing". Merge internal change: 44037996 Changing kForce into an enum. Merge internal change: 44024887 Cleanups from landing P-256 key exchange in Chromium. Merge internal change: 44023801 Fix for std::vector in QuicPacketPublicHeader's memory corruption by memset. Merge internal change: 44022862 Merging cleanup changes from chromium. Merge internal change: 44009665 Plug in the new decrypter and encrypter after the new keys have been derived. This is a first cut, as some details on changing the encryption keys still need to be worked out. Our interim solution is permissive trial decryption, which allows the peer to encrypt with the wrong key, either using the new key too early or using the null key for too long. The latter will leak confidential information, so we err on the side of using the new key too early. WARNING: the interim solution protects against eavesdroppers, but is vulberable to active attackers. Merge internal change: 44006658 Start tracking server and client stream resets and export them via varz. Merge internal change: 43971847 Pull out RstStreamFrame error code from QuicErrorCode so that they don't appear in the tracked ConnectionClose error map. This will also help in tracking RstStream error codes separately. Merge internal change: 43968620 Adding Client/Server logging to all LOGS/DLOGs Not bothering with VLOGs/DVLOGS unless it's requested. Merge internal change: 43948596 crypto: step 5. This change implements source-address tokens at the server and has the client echo them. Source address tokens are opaque (to the client) bytestrings that prove ownership of an IP address. In order to prevent amplification attacks, the server demands that the client have a valid source address token for the IP address that it's claiming to come from and that the token is reasonably recent. Since we already have it implemented, this code uses AES-GCM to encrypt and authenticate the tokens with a fixed, dummy secret (for now). In the future, the secret will be derived from the primary, private key in the same way that SessionTicket keys used to be. The QuicEncrypter/Decrypter code was written to be quite specific to the task of encrypting and decrypting packets and, as part of this, it exposed only 64 bits of the AEAD nonce. Since all GFEs will share the same token secret, and they'll all create tokens with random nonces, that runs an unacceptably high risk of an attacker obtaining two tokens with the same nonce. Thus this change also reworks the QuicEncrypter/Decrypter so that the full nonce is exposed and thus we can use 96-bit nonces. That's still not completely wonderful but, at 10Mpps an attacker would still take a year to obtain a pair of nonces, so it's good enough for a while at least. Merge internal change: 43893806 R=rch@chromium.org Review URL: https://chromiumcodereview.appspot.com/13282004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@191569 0039d316-1c4b-4281-b951-d872f2087c98
* Update the remaining references to sys_string_conversions.h to its new location.tfarina@chromium.org2013-03-301-1/+1
| | | | | | | | | | | | BUG=196305 TBR=isherman@chromium.org,rsleevi@chromium.org,keybuk@chromium.org,fischman@chromium.org, thestig@chromium.org,alexeypa@chromium.org,rogerta@chromium.org,cpu@chromium.org, akalin@chromium.org,ben@chromium.org,tony@chromium.org Review URL: https://chromiumcodereview.appspot.com/13322003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@191479 0039d316-1c4b-4281-b951-d872f2087c98
* [Cleanup] Remove StringPrintf from global namespacegroby@chromium.org2013-03-181-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | use of StringPrintf now requires prefixing with base:: or a per-scope using directive TBR'd: abodenha: chrome/service brettw: content, third_party, webkit darin: base, chrome/browser, chrome/renderer dgarret: courgette enne: cc fischmann: media gbillock: sql joi: google_apis,components rsleevi: net, crypto sky: chrome/test thestig: printing, chrome/common, tsepez: ipc wez: remoting yfriedman: testing/android NOTRY=true R=brettw@chromium.org TBR=joi@chromium.org, rsleevi@chromium.org, enne@chromium.org, thestig@chromium.org, darin@chromium.org, abodenha@chromium.org, sky@chromium.org, dgarret@chromium.org, tsepez@chromium.org, fishman@chromium.org, wez@chromium.org, gbillock@chromium.org, yfriedman@chromium.org BUG= Review URL: https://codereview.chromium.org/12767006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@188857 0039d316-1c4b-4281-b951-d872f2087c98
* Invoke the iOS hook from TestSuite so each run_all_unittests.cc file does notlliabraa@chromium.org2013-03-151-3/+0
| | | | | | | | | | | | have to remember to install MainHook. BUG=None Review URL: https://chromiumcodereview.appspot.com/12321117 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@188376 0039d316-1c4b-4281-b951-d872f2087c98
* Land Recent QUIC Changesrtenneti@chromium.org2013-03-141-11/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Handle versioning by closing the connection on version mismatch for now. Merge internal change: 43606997 Number of cleanups from landing recent crypto changes. Merge internal change: 43606111 Added delta_time_largest_observed to ReceivedPacketInfo to calculate accurate RTT. Merge internal change: 43582099 Implement server-side QUIC key expansion. The derived keys are still not being used yet. TODO: Code is in crypto_test_utils needs to be enabled. Merge internal change: 43570937 Added AbandoningPacket to congestion control to avoid issue with FEC. Merge internal change: 43570099 Wait infinite (aka wait for next ack) is not handled correctly. Merge internal change: 43558636 Enable faster stats for QUIC. Merge internal change: 43557310 Implement QUIC key expansion on the client side. The keys are not being used yet. Merge internal change: 43515237 Add missing quic_stats files. Track some connection stats. Merge internal change: 43506869 Fix bug in WriteQueuedPackets Merge internal change: 43499600 Small comment change in crypto_handshake's ProcessServerHello method. Merge internal change: 43448804 R=rch@chromium.org BUG= Review URL: https://chromiumcodereview.appspot.com/12806002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@188096 0039d316-1c4b-4281-b951-d872f2087c98
* Added Curve25519-donna changes.rtenneti@chromium.org2013-03-085-0/+724
| | | | | | | | | | | | | | | | | | | Added a wrapper class that implements the following API calls which for Curve25519. + ScalarMult to compute the shared key. + ScalarBaseMult to get public key. + ConvertToPrivateKey returns a private key from random bytes. Per agl/wtc, grabbed the rev 234205ff from the git repo (https://github.com/agl/curve25519-donna/tree/234205ff1ecaf6b3c1dc76798a462c4293f31fdb) and checked it in to crypto/ because that version has pure Google copyright. R=wtc@chromium.org,agl@chromium.org,rsleevi@chromium.org TEST=crypto unit tests Review URL: https://chromiumcodereview.appspot.com/12457004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@187074 0039d316-1c4b-4281-b951-d872f2087c98
* CRYPTO - Resolved comments from wtc. Used scoped_ptr<char[]> andrtenneti@chromium.org2013-02-272-7/+6
| | | | | | | | | | | deletion of virtual and removed and'ing with 0xFF. R=wtc@chromium.org TEST=crypt unittests Review URL: https://chromiumcodereview.appspot.com/12330157 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@184832 0039d316-1c4b-4281-b951-d872f2087c98
* Move file_path.h to base/files.brettw@chromium.org2013-02-241-1/+1
| | | | | | TBR=sky git-svn-id: svn://svn.chromium.org/chrome/trunk/src@184344 0039d316-1c4b-4281-b951-d872f2087c98
* Relanding Porting of HKDF changes from server.rtenneti@chromium.org2013-02-234-0/+253
| | | | | | | | | | | | | | | Added a2b_hex function to move common code in hkdf_unittest.cc and to make it similar to CL - 40300624. Merge internal CL: 40300624 Original approved CL: https://chromiumcodereview.appspot.com/12326029/ R=agl@chromium.org, rsleevi@chromium.org Review URL: https://chromiumcodereview.appspot.com/12335045 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@184306 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 184133vandebo@chromium.org2013-02-224-251/+0
| | | | | | | | | | | | | | | | | | | | | | It failed in this way: [ RUN ] HKDFTest.HKDFConstruct c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\vector(932) : Assertion failed: vector subscript out of range c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\vector(933) : Assertion failed: "Standard C++ Libraries Out of Range" && 0 http://build.chromium.org/p/chromium.win/builders/XP%20Tests%20%28dbg%29%281%29/builds/33019/steps/crypto_unittests/logs/stdio > Porting of HKDF changes from server. > > Merge internal CL: 40300624 > > > Review URL: https://chromiumcodereview.appspot.com/12326029 TBR=rtenneti@chromium.org Review URL: https://codereview.chromium.org/12330079 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@184146 0039d316-1c4b-4281-b951-d872f2087c98