summaryrefslogtreecommitdiffstats
path: root/base/crypto
Commit message (Collapse)AuthorAgeFilesLines
* Initialize members in Encryptor constructors.finnur@chromium.org2011-02-164-8/+16
| | | | | | | | | | BUG=None TEST=None CID=8517 Review URL: http://codereview.chromium.org/6482024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@75089 0039d316-1c4b-4281-b951-d872f2087c98
* Add ability to create self signed certs to mac.dmaclach@chromium.org2011-02-086-57/+207
| | | | | | | | | BUG=67929 TEST=BUILD Review URL: http://codereview.chromium.org/6312157 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@74115 0039d316-1c4b-4281-b951-d872f2087c98
* Renames secure_hash.cc to secure_hash_default.ccbulach@chromium.org2011-01-281-0/+0
| | | | | | | | | BUG=none TEST=none Review URL: http://codereview.chromium.org/6395006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@72963 0039d316-1c4b-4281-b951-d872f2087c98
* Change UTF8ToUTF16 to accept const StringPiece&.suzhe@google.com2011-01-281-0/+1
| | | | | | | | | BUG=70936 TEST=All unit tests should pass. Review URL: http://codereview.chromium.org/6317016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@72921 0039d316-1c4b-4281-b951-d872f2087c98
* Renames secure_hash_nss.cc to secure_hash.ccbulach@chromium.org2011-01-271-0/+0
| | | | | | | | | | | | | (there's an exclusion for _nss on non-linux platforms, however we need this file for mac and windows as well.) this is a build fix for http://src.chromium.org/viewvc/chrome?view=rev&revision=72782) BUG=none TEST=compiles Review URL: http://codereview.chromium.org/6374015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@72783 0039d316-1c4b-4281-b951-d872f2087c98
* Abstracts SHA256 context for NSS / OpenSSL.bulach@chromium.org2011-01-274-0/+172
| | | | | | | | | | | Stubs out SslServerSocket for OpenSSL. BUG=none TEST=Sha256Test.TestContext (and compiles with openssl flag). Review URL: http://codereview.chromium.org/6276002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@72782 0039d316-1c4b-4281-b951-d872f2087c98
* Allow CDSA/CSSM to be used on worker threads in debug builds by making both ↵rsleevi@chromium.org2011-01-261-6/+6
| | | | | | | | | | | | | the CSSM init singleton and the Mac Security Services lock singleton leaky. This primarily affects the use of <keygen> in a debug build, as the RSA private key is generated on a worker thread and needs to hold the Mac Security Services lock. BUG=none TEST=none Review URL: http://codereview.chromium.org/6354017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@72580 0039d316-1c4b-4281-b951-d872f2087c98
* Remove obsolete base/lock.h and fix up callers to use the new header file andbrettw@chromium.org2011-01-211-4/+4
| | | | | | | | | | | the base namespace. Fix several files including lock.h unnecessarily. BUG=none TEST=none Original review=http://codereview.chromium.org/6142009/ Patch by leviw@chromium.org git-svn-id: svn://svn.chromium.org/chrome/trunk/src@72106 0039d316-1c4b-4281-b951-d872f2087c98
* Cleanup for r71281: replace usage of "pk11" with "pkcs11" or "crypto ↵mattm@chromium.org2011-01-191-9/+9
| | | | | | | | | | | module", as appropriate. BUG=42073 TEST=manual,trybotss Review URL: http://codereview.chromium.org/6303004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@71749 0039d316-1c4b-4281-b951-d872f2087c98
* The SSL server's RSA private key must be imported with thewtc@chromium.org2011-01-191-3/+7
| | | | | | | | | | | | | | | | | | KU_KEY_ENCIPHERMENT key usage to support the RSA key exchange algorithm. Remove the incorrect workarounds for this bug. In the SSLServerSocketTest.DataTransfer unit test, do not proceed to data transfer if the SSL connection cannot be established. Not required for fixing this bug: create an RSA private key with all applicable key usage bits to be future-proof. R=hclam BUG=67928 TEST=net_unittests --gtest_filter=SSLServerSocketTest.* Review URL: http://codereview.chromium.org/6297008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@71739 0039d316-1c4b-4281-b951-d872f2087c98
* NSS: PKCS 11 password prompt.mattm@chromium.org2011-01-131-0/+34
| | | | | | | | | | | This was based off of davidben's WIP cl http://codereview.chromium.org/3186021/show. BUG=42073 TEST=add password to NSS DB with "certutil -d sql:.pki/nssdb -W", try client auth, <keygen>, cert manager Review URL: http://codereview.chromium.org/5686002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@71281 0039d316-1c4b-4281-b951-d872f2087c98
* Order function definitions in base/ according to the header.erg@google.com2011-01-114-215/+216
| | | | | | | | | BUG=68682 TEST=compiles Review URL: http://codereview.chromium.org/6085015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70975 0039d316-1c4b-4281-b951-d872f2087c98
* Start sorting methods in class declarations.erg@google.com2011-01-072-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | A lot of our headers are a mess and aren't organized. Impose the following order on files in the base/ directory: class Blah { each public/protected/private section: typedefs; enums; static constants; ctors; dtors; methods; overridden virtual methods; data members; }; BUG=68682 TEST=compiles Review URL: http://codereview.chromium.org/6081007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70749 0039d316-1c4b-4281-b951-d872f2087c98
* Move base/lock and base/condition_variable to base/synchronization/brettw@chromium.org2011-01-012-6/+6
| | | | | | | | | | | I kept a base/lock.h in place with a using statement to avoid updating all callers in one CL. TEST=it compiles BUG=none Review URL: http://codereview.chromium.org/6018013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70363 0039d316-1c4b-4281-b951-d872f2087c98
* Defines SSLServerSocket and implements SSLServerSocketNSShclam@chromium.org2010-12-231-0/+1
| | | | | | | | | | | | | | | | | Defines a SSLServerSocket interface. Implement this interface using NSS as SSLServerSocketNSS. This is the first version of the code. It disables several functions of NSS like caching, session ticket, reneogotiation, etc. This is implemented to suit the needs of Chromoting. Additional features of this socket will be added when necessary. BUG=None TEST=None Review URL: http://codereview.chromium.org/5746003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70041 0039d316-1c4b-4281-b951-d872f2087c98
* Create self signed X509 certificatehclam@chromium.org2010-12-171-0/+1
| | | | | | | | | | | | | In order to run a SSL server certificate and private key is needed. In the case of Chromoting the first step is to use self signed cert. This change allows to issue self signed cert. This is only implemented in NSS. BUG=None TEST=net_unittests Review URL: http://codereview.chromium.org/5754001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@69573 0039d316-1c4b-4281-b951-d872f2087c98
* Fix openssl portability issuejoth@chromium.org2010-12-142-2/+4
| | | | | | | | | | | - in STL vector<> has no data() member. BUG=None TEST=Builds. base_unittest --gtest_filter=*Sym* Review URL: http://codereview.chromium.org/5705006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@69128 0039d316-1c4b-4281-b951-d872f2087c98
* Turns out RSA_generate_key is deprecated and is removed on some platforms, ↵joth@chromium.org2010-12-081-4/+9
| | | | | | | | | | | | | so using the lesser-documented RSA_generate_key_ex method instead. Also removes usage of the imaginary vector<>::data() method. BUG=None TEST=base_unittests filter=*RSA* Review URL: http://codereview.chromium.org/5603013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@68598 0039d316-1c4b-4281-b951-d872f2087c98
* This CL add a GetInstance() method to singleton classes instead of relying ↵satish@chromium.org2010-12-041-6/+16
| | | | | | | | | | | | | | | | | on the callers to use Singleton<T>. In some cases I have used the LazyInstance<T> pattern as that was simpler. This is a small step towards making all singleton classes use the Singleton<T> pattern within their code and not expect the callers to know about it. I have selected all files under src/app and src/base which use Singleton<T> in this CL. Once this CL goes in I'll work on the rest of the files. BUG=65298 TEST=all existing tests should continue to pass. Review URL: http://codereview.chromium.org/5527004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@68300 0039d316-1c4b-4281-b951-d872f2087c98
* Follow up comments on SymmetricKey::Import docsjoth@chromium.org2010-11-191-4/+4
| | | | | | | | | BUG=None TEST=None Review URL: http://codereview.chromium.org/5223001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@66765 0039d316-1c4b-4281-b951-d872f2087c98
* Implements Signature Creator & Verifier for openssljoth@chromium.org2010-11-188-44/+113
| | | | | | | | | | | Also adds a little more infrastructure to assist in openssl error handling. BUG=None TEST=base_unittests RSA* and Sign* Review URL: http://codereview.chromium.org/5105003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@66622 0039d316-1c4b-4281-b951-d872f2087c98
* Implements RSAPrivateKey for openssl.joth@chromium.org2010-11-172-31/+91
| | | | | | | | | | | Leaves the declared NSS-only methods (CreateSensitive.. & FindFromPublicKeyInfo) as UNIMPLEMENTED. BUG=None TEST=base_unittests --gtest_filter=RSA* Review URL: http://codereview.chromium.org/5047003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@66438 0039d316-1c4b-4281-b951-d872f2087c98
* Refactor EnsureOpenSSLInit and openssl_util into basejoth@chromium.org2010-11-172-1/+6
| | | | | | | | | | | | This allows the base/crypto methods to call EnsureOpenSSLInit. Also factors out the SSL_CTX and X509_STORE to be more closely associated with their consumers (ssl socket and X509Certificate resp.) rather than process wide globals. BUG=None TEST=None Review URL: http://codereview.chromium.org/4963002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@66413 0039d316-1c4b-4281-b951-d872f2087c98
* Clarify some documentation on SymmetricKeyjoth@chromium.org2010-11-161-3/+7
| | | | | | | | | BUG=None TEST=None Review URL: http://codereview.chromium.org/5013001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@66259 0039d316-1c4b-4281-b951-d872f2087c98
* Implements encryptor_openssl.ccjoth@chromium.org2010-11-126-11/+230
| | | | | | | | | | | Depends on pending CL http://codereview.chromium.org/4691003/ BUG=None TEST=base_unittests Encryptor* Review URL: http://codereview.chromium.org/4777001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@65952 0039d316-1c4b-4281-b951-d872f2087c98
* implement openssl symmetric keyjoth@chromium.org2010-11-123-82/+128
| | | | | | | | | | | | | add AES derived key test Also includes some build fixes. BUG=None TEST=./out/Debug/base_unittests --gtest_filter=SymmetricKey* Review URL: http://codereview.chromium.org/4691003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@65936 0039d316-1c4b-4281-b951-d872f2087c98
* Move debug-related stuff from base to the base/debug directory and use thebrettw@chromium.org2010-10-261-1/+1
| | | | | | | | | | | | | | | | base::debug namespace. This splits apart debug_util into base/debugger and base/stack_trace There are still two functions in debug_util that I'm not sure what to do with. Since this uses the base::debug namespace, I removed the functions in debugger.h from the static class and just made them free functions in the namespace. TEST=it compiles BUG=none Review URL: http://codereview.chromium.org/3945002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@63859 0039d316-1c4b-4281-b951-d872f2087c98
* Make USE_OPENSSL and USE_NSS mutually exclusivejoth@chromium.org2010-10-226-1/+231
| | | | | | | | | | | | | | | | | | - that is, defining use_openssl=1 will now remove all dependency on NSS. This does not impact any of the standard, non-openssl builds. Adds stub implementations of several files that need to be fully implemented in follow up patchs. Firefox import code will need some more substatial refactoring, as it makes little sense to be attempting a firefox import without NSS libraries to hand, however the UI etc has numerous assumption about the presence of this importer. BUG=None TEST=None Review URL: http://codereview.chromium.org/3855004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@63506 0039d316-1c4b-4281-b951-d872f2087c98
* Use scoped objects to simplify crypto routines. Also do lots of other ↵pkasting@chromium.org2010-10-214-35/+43
| | | | | | | | | | simplification. BUG=none TEST=none Review URL: http://codereview.chromium.org/3888002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@63305 0039d316-1c4b-4281-b951-d872f2087c98
* Reland r62959 without the changes to histogram.cc, in hopes it won't break ↵pkasting@chromium.org2010-10-191-1/+1
| | | | | | | | | | | | | | | | | | tab_switching_test, and without the changes to tools_sanity_unittest.cc, which have already been relanded separately. TBR=timsteele Original changelog message: Convert LOG(INFO) to VLOG(1) - base/. Also removes an "else" after "return" and aligns "<<" per style guide. BUG=none TEST=none Review URL: http://codereview.chromium.org/3850007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@63009 0039d316-1c4b-4281-b951-d872f2087c98
* ** Think this may have caused TabSwitchingTest to fail, as it is parsing log ↵tim@chromium.org2010-10-181-1/+1
| | | | | | | | | | | | | | | | | files. ** Revert 62959 - Convert LOG(INFO) to VLOG(1) - base/. Also removes an "else" after "return" and aligns "<<" per style guide. BUG=none TEST=none Review URL: http://codereview.chromium.org/3845002 TBR=pkasting@chromium.org Review URL: http://codereview.chromium.org/3850006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62981 0039d316-1c4b-4281-b951-d872f2087c98
* Convert LOG(INFO) to VLOG(1) - base/.pkasting@chromium.org2010-10-181-1/+1
| | | | | | | | | | Also removes an "else" after "return" and aligns "<<" per style guide. BUG=none TEST=none Review URL: http://codereview.chromium.org/3845002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62959 0039d316-1c4b-4281-b951-d872f2087c98
* FBTF: More ctor/dtor cleanup.erg@google.com2010-10-142-1/+8
| | | | | | | | | | | (3.5 megs off debug linux .a files) BUG=none TEST=compiles Review URL: http://codereview.chromium.org/3806005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62654 0039d316-1c4b-4281-b951-d872f2087c98
* Implement SymmetricKey::Import for HMAC-SHA-1 keys on Windows.wtc@chromium.org2010-09-142-14/+20
| | | | | | | | | | | | | | Port SymmetricKeyTest.ImportGeneratedKey and SymmetricKeyTest.ImportDerivedKey to all platforms. On Mac, the salt for PBKDF2 must be at least 8 bytes long. R=tim BUG=none TEST=base_unittests --gtest_filter=SymmetricKeyTest.ImportDerivedKey should pass on Windows. Review URL: http://codereview.chromium.org/3361020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@59330 0039d316-1c4b-4281-b951-d872f2087c98
* FBTF: Remove unneeded headers from base/ (part 7)thestig@chromium.org2010-08-271-2/+1
| | | | | | | | BUG=none TEST=none Review URL: http://codereview.chromium.org/3176026 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57737 0039d316-1c4b-4281-b951-d872f2087c98
* On NSS-using platforms, add a way to use an existing keypair given only the ↵cmasone@google.com2010-08-105-9/+259
| | | | | | | | | | | | | | | | | | pubkey I'm reworking Chrome OS' OwnerManager class to leverage code in base/crypto. For my code, I need a way to get at a keypair that was previously generated and stored in the user's NSSDB, given only the public half of the keypair. Given that, I should be able to toss most of the code in chrome/browser/chromeos/login/owner_key_utils.* and just use RSAPrivateKey and the signature generation/verification code here in base/crypto BUG=chromium-os:4485 TEST=base_unittests Review URL: http://codereview.chromium.org/3032060 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@55604 0039d316-1c4b-4281-b951-d872f2087c98
* FBTF: Remove unneeded headers from base/ (part 1)thestig@chromium.org2010-08-051-1/+0
| | | | | | | | BUG=none TEST=none Review URL: http://codereview.chromium.org/3071012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@55034 0039d316-1c4b-4281-b951-d872f2087c98
* `#pragma once` for app, base, chrome, gfx, ipc, net, skia, viewsthakis@chromium.org2010-07-269-0/+9
| | | | | | | | | BUG=50273 TEST=everything still builds, build is 10% faster on windows, same speed on mac/linux TBR: erg git-svn-id: svn://svn.chromium.org/chrome/trunk/src@53716 0039d316-1c4b-4281-b951-d872f2087c98
* Fix 2 include guards found by my scriptthakis@chromium.org2010-07-261-2/+2
| | | | | | | | | | | BUG=none TEST=none TBR=erg Review URL: http://codereview.chromium.org/3059007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@53652 0039d316-1c4b-4281-b951-d872f2087c98
* Port SymmetricKey::Import to Mac and update tests.albertb@chromium.org2010-07-233-6/+6
| | | | | | | | | BUG=48701 TEST=EncryptorTest.* Review URL: http://codereview.chromium.org/3058007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@53515 0039d316-1c4b-4281-b951-d872f2087c98
* Remove <iostream> where possible.erg@google.com2010-07-203-3/+0
| | | | | | | | | | | | | <iostream> creates a static initializer. Most people don't need <iostream> anyway--they really need <ostream> for operator<< overloads. <iostream> should *never* be included in a header file; <iosfwd> exists for that purpose. BUG=none TEST=none Review URL: http://codereview.chromium.org/3014015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@53083 0039d316-1c4b-4281-b951-d872f2087c98
* Take 2 for: Add support for SymmetricKey to import raw keys when using NSS.albertb@chromium.org2010-07-205-26/+97
| | | | | | | | | BUG=48701 TEST=unittests Review URL: http://codereview.chromium.org/2985008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@53077 0039d316-1c4b-4281-b951-d872f2087c98
* AutoFill credit cards should be encrypted on the Macdhollowa@chromium.org2010-07-161-1/+1
| | | | | | | | | | | These changes add encryption support on Mac for the Encryptor class. AES 128 bit is used for the encryption, and the auto-generated password is stored now in the Mac Keychain. This implies the Encryptor class on Mac can now block for user input, and can fail if access is denied. BUG=42038, 49131 TEST=EncryptorTest.CypherTextDiffers, EncryptorTest.DecryptError, EncryptorPasswordTest.* Review URL: http://codereview.chromium.org/2943014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52590 0039d316-1c4b-4281-b951-d872f2087c98
* Revert "Add support for SymmetricKey to import raw keys when using NSS."albertb@chromium.org2010-07-125-93/+23
| | | | | | | | | | | | This reverts commit e9757388eb66acc907c79a3c82b0006c36e0714a. BUG=none TEST=none TBR=arv Review URL: http://codereview.chromium.org/2962010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52138 0039d316-1c4b-4281-b951-d872f2087c98
* Add support for SymmetricKey to import raw keys when using NSS.albertb@chromium.org2010-07-125-23/+93
| | | | | | | | | BUG=48512 TEST=unittests Review URL: http://codereview.chromium.org/2811045 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52136 0039d316-1c4b-4281-b951-d872f2087c98
* Add a lock for OS X CSSM wrapper APIsdavidben@chromium.org2010-07-072-0/+33
| | | | | | | | | | | | They're apparently problematic with threads. R=agl BUG=48006 TEST=KeygenHandler.ConcurrencyTest Review URL: http://codereview.chromium.org/2832047 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@51734 0039d316-1c4b-4281-b951-d872f2087c98
* Add a locked version of CryptAcquireContextdavidben@chromium.org2010-06-232-0/+81
| | | | | | | | | | | | The function is not thread-safe when called with certain flags. This will be useful when we move keygen onto a worker thread. BUG=none TEST=KeygenHandlerTest.SmokeTest (existing) Review URL: http://codereview.chromium.org/2828019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50661 0039d316-1c4b-4281-b951-d872f2087c98
* Mac/clang: Uncontentious fixes.thakis@chromium.org2010-06-111-1/+1
| | | | | | | | | | | | | * Remove unused variables * Make types in h and cc files agree * Use subclasses if we call subclass methods * Fix one real bug (`if (a); a->foo()`) * Fix forward declarations to be correct * Don't mark some definitions with "extern" Review URL: http://codereview.chromium.org/2730015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49570 0039d316-1c4b-4281-b951-d872f2087c98
* Enable warning 4389 as an error on windows builds. This will make mbelshe@chromium.org2010-05-271-1/+1
| | | | | | | | | | | | windows builds more similar to linux/mac, which already treat signed/ unsigned equality comparisons as warnings (and hence errors). BUG=44471 TEST=none Review URL: http://codereview.chromium.org/2222002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48395 0039d316-1c4b-4281-b951-d872f2087c98
* Revert "Another dependency the bbot missed!!!"rafaelw@chromium.org2010-05-261-1/+1
| | | | | | | | | | | | | | | | | | This reverts commit 161f7fd3bdd425167af9fe26fdc5373a2ff44c98. Revert "Missed a file as part of checkin for r48186" This reverts commit cff86beba5938209393a6c3bccced62a7f3ff36b. Revert "Enable warning 4389 as an error on windows builds. This will make" This reverts commit c78936bcfc65b98edf288191d927a495b0364621. TBR=mbelshe Review URL: http://codereview.chromium.org/2253001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48238 0039d316-1c4b-4281-b951-d872f2087c98