summaryrefslogtreecommitdiffstats
path: root/base/crypto
Commit message (Collapse)AuthorAgeFilesLines
* 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
* Enable warning 4389 as an error on windows builds. This will makembelshe@chromium.org2010-05-251-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/2081007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48186 0039d316-1c4b-4281-b951-d872f2087c98
* Make the Nigori user salt key 128-bits to be FIPS compliant.albertb@chromium.org2010-04-281-1/+4
| | | | | | | | | BUG=none TEST=NigoriTest.* Review URL: http://codereview.chromium.org/1697010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45816 0039d316-1c4b-4281-b951-d872f2087c98
* Enable Nigori unit tests on all platforms.albertb@chromium.org2010-04-231-1/+1
| | | | | | | | | BUG=none TEST=NigoriTest.* Review URL: http://codereview.chromium.org/1736008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45494 0039d316-1c4b-4281-b951-d872f2087c98
* Implement PBKDF2-based key derivation, random key generation,wtc@chromium.org2010-04-0917-92/+866
| | | | | | | | | | | | | | | and AES-CBC encryption/decryption using CryptoAPI. Contributed by Ryan Sleevi <ryan.sleevi@gmail.com>. Original review URL: http://codereview.chromium.org/1558018 R=wtc,albertb BUG=none TEST=SymmetricKeyTest.* and EncryptorTest.* Review URL: http://codereview.chromium.org/1528021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@44106 0039d316-1c4b-4281-b951-d872f2087c98
* Fix leak in encryptor_unittest.ccalbertb@chromium.org2010-03-311-1/+1
| | | | | | | | | BUG=none TEST=valgrind doesn't complain anymore Review URL: http://codereview.chromium.org/1558010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43283 0039d316-1c4b-4281-b951-d872f2087c98
* First pass of a Nigori implementation for Chrome. Only unassisted keyalbertb@chromium.org2010-03-314-12/+11
| | | | | | | | | | | derivation is supported and there is no support for server authentication. BUG=37363 TEST=unit tests Review URL: http://codereview.chromium.org/1357003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43220 0039d316-1c4b-4281-b951-d872f2087c98
* Add Mac implementations of new SymmetricKey and Encryptor classes.snej@chromium.org2010-03-2916-96/+379
| | | | | | | | | BUG=none TEST=EncryptorTest, SymmetricKeyTest Review URL: http://codereview.chromium.org/1347002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42964 0039d316-1c4b-4281-b951-d872f2087c98
* Implement random key generation and AES encryption using NSS.albertb@chromium.org2010-03-2515-133/+416
| | | | | | | | | BUG=none TEST=unit test Review URL: http://codereview.chromium.org/1142004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42649 0039d316-1c4b-4281-b951-d872f2087c98
* Annotated the scoped leak inside base::RSAPrivateKey::CreateFromPrivateKeyInfo,glider@chromium.org2010-03-243-17/+4
| | | | | | | | | | | | removed the annotations from the tests calling it (RSAPrivateKeyUnitTest.* and SignatureCreatorTest.BasicTest) BUG=34742 TBR=wtc Review URL: http://codereview.chromium.org/1271002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42459 0039d316-1c4b-4281-b951-d872f2087c98
* PBKDF2 implemetation using NSS.albertb@chromium.org2010-03-2210-0/+339
| | | | | | | | | BUG=none TEST=unit test Review URL: http://codereview.chromium.org/1024001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42247 0039d316-1c4b-4281-b951-d872f2087c98
* Annotated the memory leaks in RSAPrivateKeyUnitTest.* and glider@chromium.org2010-03-222-0/+17
| | | | | | | | | | SignatureCreatorTest.BasicTest. BUG=34742 TBR=wtc Review URL: http://codereview.chromium.org/1117007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42223 0039d316-1c4b-4281-b951-d872f2087c98
* Switch base to using CHECK_*.willchan@chromium.org2010-03-022-2/+2
| | | | | | Review URL: http://codereview.chromium.org/660357 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40394 0039d316-1c4b-4281-b951-d872f2087c98
* Style cleanup in preparation for auto-linting base/.erg@google.com2010-01-261-3/+3
| | | | | | | | | BUG=none TEST=none Review URL: http://codereview.chromium.org/552004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37164 0039d316-1c4b-4281-b951-d872f2087c98
* Linux: Add Certificate Info dialog (part 1)mattm@chromium.org2010-01-143-4/+3
| | | | | | | | | | | Rename base/nss_init.{h,cc} to base/nss_util.{h,cc}, move PRTimeToBaseTime there. BUG=18119 TEST=Load https://www.google.com, compare to firefox cert dialog. Review URL: http://codereview.chromium.org/500141 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36291 0039d316-1c4b-4281-b951-d872f2087c98
* Remove the unnecessary workaround for NSS bug 455424, now that we requirewtc@chromium.org2009-12-012-8/+0
| | | | | | | | | | | NSS 3.12.3 or later. R=ukai BUG=none TEST=No compilation errors. Review URL: http://codereview.chromium.org/452014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33464 0039d316-1c4b-4281-b951-d872f2087c98
* Avoid leaking hash_object_ in SignatureCreator on Windows.dkegel@google.com2009-11-131-1/+0
| | | | | | | | TEST=valgrind wine base_unittests SIgnatureCreatorTest.* BUG=none Review URL: http://codereview.chromium.org/391040 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31946 0039d316-1c4b-4281-b951-d872f2087c98
* Add a comment warning against using RSAPrivateKeyImport on untrusted sources.rafaelw@chromium.org2009-10-201-4/+6
| | | | | | Review URL: http://codereview.chromium.org/307009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29566 0039d316-1c4b-4281-b951-d872f2087c98
* Reland: HTML Pack Extension Dialog / Linux & Mac Packaging Support.rafaelw@chromium.org2009-10-084-7/+17
| | | | | | | | | | | | | | | | | | original issue: http://codereview.chromium.org/207062 The issue had to do with a symbol collison with the nss libraries (which are currently out-of-date) on the build bots. HTML Pack Extension Dialog. This removes the views implementation of the ExtensionPackDialog, and implements the dialog in html in the extensions_ui DOMUI. Additionally, support is added for packaging extensions via ---pack-extension on linux and mac BUG=20668, 20669 TBR=aa,wtc Review URL: http://codereview.chromium.org/265032 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28365 0039d316-1c4b-4281-b951-d872f2087c98
* Refactor ASN1 parsing/serializationrafaelw@chromium.org2009-10-076-633/+573
| | | | | | Review URL: http://codereview.chromium.org/242136 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28223 0039d316-1c4b-4281-b951-d872f2087c98
* Implement signature_creator_mac. Also moved CSSM memory functions to a ↵rafaelw@chromium.org2009-10-066-61/+127
| | | | | | | | | | common shared location. BUG=20669 Review URL: http://codereview.chromium.org/259026 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28135 0039d316-1c4b-4281-b951-d872f2087c98
* Implement RSAPrivateKey for Mac OS Xhawk@chromium.org2009-10-022-1/+405
| | | | | | | | TEST=none BUG=none Review URL: http://codereview.chromium.org/243070 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27897 0039d316-1c4b-4281-b951-d872f2087c98
* Add a TODO comment to describe when we can remove the const_cast forwtc@chromium.org2009-09-251-0/+2
| | | | | | | | | | | the NSS function SGN_Update. R=rafaelw BUG=20669 TEST=none Review URL: http://codereview.chromium.org/218035 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27163 0039d316-1c4b-4281-b951-d872f2087c98
* Reland: Linux (nss) implementations of RSAPrivateKey and SignatureCreator.rafaelw@chromium.org2009-09-245-10/+327
| | | | | | | | | | | | This relands: http://codereview.chromium.org/208032. Additionally, it fixes a memleak unconvered by valgrind, and adds a valgrind supression for a memleak discovered in the nss library. https://bugzilla.mozilla.org/show_bug.cgi?id=518443 BUG=20669 Review URL: http://codereview.chromium.org/218010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27033 0039d316-1c4b-4281-b951-d872f2087c98
* Revert "Linux (nss) implementations of RSAPrivateKey and SignatureCreator"rafaelw@chromium.org2009-09-235-327/+10
| | | | | | | | | | This reverts commit 4e0de697be80a0a91fbcceda63d3c85055f1afcc. TBR=davemoore Review URL: http://codereview.chromium.org/219013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26957 0039d316-1c4b-4281-b951-d872f2087c98
* Linux (nss) implementations of RSAPrivateKey and SignatureCreatorrafaelw@chromium.org2009-09-235-10/+327
| | | | | | | | BUG=20669 Review URL: http://codereview.chromium.org/208032 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26950 0039d316-1c4b-4281-b951-d872f2087c98
* Added USE_GDK, set when either TOOLKIT_GTK or TOOLKIT_VIEWS is set butbenl@chromium.org2009-09-071-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | not OS_WIN. Added USE_X11. Set when OS_LINUX or OS_FREEBSD is set. Added USE_BASE_DATA_PACK for base::DataPack usage, set for OS_MACOSX, OS_LINUX or OS_FREEBSD. Added USE_NSS for ... nss (for crypto). Windows and MacOS use platform-specific libraries. All of the above cause slightly odd formulations like: #if defined(OS_WIN) ... #elif defined(USE_BASE_DATA_PACK) ... #endif Possibly should also define USE_DLL_FOR_DATA, etc? Or something? Wrapped various references to struct stat64 and stat64() to use struct stat and stat() for FreeBSD - but a "man stat64" on Linux suggests that we could do the same thing for at least Linux, too, and perhaps eliminate the wrapper? git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25599 0039d316-1c4b-4281-b951-d872f2087c98
* Disable extensions besides externally installed ones and themes.aa@chromium.org2009-06-231-258/+258
| | | | | | | | | | | | This is mainly intended to be pulled to the 3.0 branch. It won't be submitted until another corresponding change to undo the damage is ready. BUG=13467 TEST=Added unit tests Review URL: http://codereview.chromium.org/132003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19008 0039d316-1c4b-4281-b951-d872f2087c98
* TBR: Fix dead tree.aa@chromium.org2009-06-221-258/+258
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18964 0039d316-1c4b-4281-b951-d872f2087c98
* Disable extensions besides externally installed ones and themes.aa@chromium.org2009-06-221-258/+258
| | | | | | | | | | | | This is mainly intended to be pulled to the 3.0 branch. It won't be submitted until another corresponding change to undo the damage is ready. BUG=13467 TEST=Added unit tests Review URL: http://codereview.chromium.org/132003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18959 0039d316-1c4b-4281-b951-d872f2087c98
* Add two new test cases to RSAPrivateKey.aa@chromium.org2009-06-221-51/+313
| | | | | | | | | These cover a special case of encoding and decoding ASN.1 integers. Review URL: http://codereview.chromium.org/140077 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18943 0039d316-1c4b-4281-b951-d872f2087c98
* Fix decoding bug in RSAPrivateKey.aa@chromium.org2009-06-222-32/+52
| | | | | | | | | | | | | | | We were dropping the most significant byte from the input when decoding PrivateKeyInfo, whether or not it was part of the original data. This shouldn't matter, except that we need to get back the original byte lengths so that we can give them to CryptoAPI. BUG=14877 TEST=Stress tested the functions by creating 1000 random private keys, exporting them, then re-importing. Also tried stressing the edge cases in particular around extra trailing null bytes. Review URL: http://codereview.chromium.org/141036 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18909 0039d316-1c4b-4281-b951-d872f2087c98
* TBR: Add more logging to try and track down flakey crypto tests.aa@chromium.org2009-06-201-0/+8
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18885 0039d316-1c4b-4281-b951-d872f2087c98
* Minor no-op change to ASN.1 encoding of private key.aa@chromium.org2009-06-191-2/+2
| | | | | | | | | | | | | | | | | | | | | The logic for when to prepend a null byte to integers was reversed. Fortunately, this had no impact on anything, because: a) We ignore the null byte on the parse side because we know the integers we're interested in are always unsigned. b) It appears openssl does the same thing (I tried it both ways and it always came up with the same private key data). Still, better to be correct. Also, re-enable previously disabled unit tests. BUG=14640 Review URL: http://codereview.chromium.org/131095 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18855 0039d316-1c4b-4281-b951-d872f2087c98