summaryrefslogtreecommitdiffstats
path: root/crypto/nss_util.h
Commit message (Collapse)AuthorAgeFilesLines
* Switch to standard integer types in crypto/.avi2015-12-211-5/+7
| | | | | | | | | | BUG=138542 TBR=rsleevi@chromium.org NOPRESUBMIT=true Review URL: https://codereview.chromium.org/1539353003 Cr-Commit-Position: refs/heads/master@{#366460}
* Fold away now dead NSS code.davidben2015-10-021-54/+0
| | | | | | | | | | | Anything not built on iOS can now assume USE_OPENSSL is set. Most notably, the libc urandom override is now gone. BUG=519504 Review URL: https://codereview.chromium.org/1364023003 Cr-Commit-Position: refs/heads/master@{#352061}
* Only prime NSS in the sandbox for NSS ports.davidben2015-08-111-0/+6
| | | | | | | | | | | | | | | This code, if all goes well, can actually be deleted now. But leave it there as ifdefs for now case we still need to revert the chimera. Now that no calls to InitNSSSafely and friends are built in USE_OPENSSL ports, the LoadNSSLibraries calls and /dev/urandom fopen override may be removed. They were only added to support NSS in the sandbox. BUG=506323 Review URL: https://codereview.chromium.org/1274483002 Cr-Commit-Position: refs/heads/master@{#342846}
* Rename USE_NSS to USE_NSS_CERTS.davidben2015-04-171-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | USE_NSS is confusing because it's not actually the analog of USE_OPENSSL; it's the analog to USE_OPENSSL_CERTS. This is in preparation for the chimera build which will set USE_OPENSSL and USE_NSS(_CERTS). This CL was partially done automatically by the following command: git grep -l USE_NSS | xargs sed -i -e 's/defined(USE_NSS)/defined(USE_NSS_CERTS)/' The remaining were caught by the following command and fixed manually: git grep 'USE_NSS\([^_]\|$\)' Finally, the following command verified nothing in a separate repository was sensitive to this change: find . -name '*.cc' -o -name '*.h' | xargs grep 'USE_NSS\([^_]\|$\)' For now, the old name is still defined, but not used within Chromium. A follow-up CL will remove deprecated use_nss and USE_NSS #defines together which will then cause downstream churn. Though from a grep of known downstreams, the churn seems to be fairly minimal. The removal is split from this CL so that, if we need to revert, the CL to revert is small. TBR=pneubeck@chromium.org BUG=462040 Review URL: https://codereview.chromium.org/1082123003 Cr-Commit-Position: refs/heads/master@{#325710}
* Extract ScopedTestNSSDB from nss_util.pneubeck@chromium.org2014-07-281-42/+0
| | | | | | | | | | | | | | | | | | | | | Before ScopedTestNSSDB affected several slot getters from nss_util.h . This change reduces ScopedTestNSSDB to solely setup a temporary test DB and not influencing the global state in nss_util anymore. As a replacement for some of its old behavior, a new ScopedTestSystemNSSKeySlot is added, which allows to override the slot returned by GetSystemNSSKeySlot(). With this change it's now possible to write tests that need both a user and system NSS DB by using ScopedTestSystemNSSKeySlot. As a side-effect, GetPersistentNSSKeySlot() is now compiled on !OS_CHROMEOS only. BUG=210525 (For include changes:) R=rsleevi@chromium.org TBR=nkostylev@chromium.org, stevenjb@chromium.org Review URL: https://codereview.chromium.org/401623006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@285881 0039d316-1c4b-4281-b951-d872f2087c98
* Add GetSystemNSSKeySlot, merge GetPrivateNSSKeySlot/GetPublicNSSKeySlot to ↵mattm@chromium.org2014-07-131-10/+10
| | | | | | | | | | | | | | | GetPersistentNSSKeySlot. GetSystemNSSKeySlot returns the ChromeOS system-wide TPM slot. ChromeOS has separate slots for each user and linux doesn't have a public/private split, so GetPrivateNSSKeySlot no longer makes sense. BUG=210525 TBR=stevenjb@chromium.org Review URL: https://codereview.chromium.org/383593002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@282862 0039d316-1c4b-4281-b951-d872f2087c98
* Remove usage of singleton software_slot_ in nss on ChromeOStbarzic@chromium.org2014-07-121-5/+0
| | | | | | | | | | | | | | | | Instead of opening primary user's public slot separately, do it like it's done for other users: when InitializeNSSForChromeOSUser is called. This makes primary user's public slot state not dependent on chromeos::TPMTokenLoader. Also, with this, opening primary users public slot is not bound with enabling TPM anymore, so the slot may get open for guest user and on Linux ChromeOS. BUG=383663, 302062 Review URL: https://codereview.chromium.org/317613004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@282817 0039d316-1c4b-4281-b951-d872f2087c98
* chromeos: Load chaps module and lookup TPM slots on the worker pool.mattm@chromium.org2014-02-271-3/+9
| | | | | | | | BUG=345713 Review URL: https://codereview.chromium.org/181053002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@253942 0039d316-1c4b-4281-b951-d872f2087c98
* Add ClientCertStoreChromeOS which only returns the certs for a given user.mattm@chromium.org2013-12-171-0/+21
| | | | | | | | BUG=302125 Review URL: https://codereview.chromium.org/112533002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@241080 0039d316-1c4b-4281-b951-d872f2087c98
* Initialize per-ChromeOS-user NSS slots and provide the functions to access them.mattm@google.com2013-12-061-1/+10
| | | | | | | | | BUG=302124 R=mmenke@chromium.org, rsleevi@chromium.org, xiyuan@chromium.org Review URL: https://codereview.chromium.org/53763003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@239266 0039d316-1c4b-4281-b951-d872f2087c98
* Remove crypto::GetTPMTokenInfo which is no longer necessary.mattm@chromium.org2013-11-251-9/+1
| | | | | | | | BUG=none Review URL: https://codereview.chromium.org/83833003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@237150 0039d316-1c4b-4281-b951-d872f2087c98
* crypto/nss_util: Get TPM slot id, do lookup by id instead of by name.mattm@chromium.org2013-10-251-0/+1
| | | | | | | | | | chromeos/cert_loader: store slot id as int. BUG=302124 Review URL: https://codereview.chromium.org/36593002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@231126 0039d316-1c4b-4281-b951-d872f2087c98
* Make CryptohomeClientImplStub and ScopedTestNSSDB use the same TokenName.pneubeck@chromium.org2013-08-121-0/+3
| | | | | | | | | | | 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
* Remove unused crypto::GetSupplementalUserKey() method.davidroche@chromium.org2013-06-111-10/+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
* Add FilePath to base namespace.brettw@chromium.org2013-02-021-4/+1
| | | | | | | This updates headers that forward-declare it and a few random places to use the namespace explicitly. There us a using declaration in file_path.h that makes the rest compile, which we can do in future passes. Review URL: https://codereview.chromium.org/12163003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@180245 0039d316-1c4b-4281-b951-d872f2087c98
* Fix nits in crypto::InitNSSSafely().jorgelo@chromium.org2012-11-291-7/+8
| | | | | | | | | | | | | Some comments in https://chromiumcodereview.appspot.com/11411013/ were not addressed before the CL landed, so do that now. BUG=None TEST=content_browsertests NOTRY=true Review URL: https://chromiumcodereview.appspot.com/11418212 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@170129 0039d316-1c4b-4281-b951-d872f2087c98
* Initialize NSS in the PPAPI process for ClearKey CDM.jorgelo@chromium.org2012-11-171-1/+11
| | | | | | | | | | BUG=156864 TEST=content_browsertests passes on linux_rel_precise. Review URL: https://chromiumcodereview.appspot.com/11411013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@168372 0039d316-1c4b-4281-b951-d872f2087c98
* Reland: Implement ScopedTestNSSDB instead of OpenTestNSSDB()toyoshim@chromium.org2012-10-181-5/+15
| | | | | | | | | | | | | | This CL needs memory suppression because of missing CloseTestNSSDB(). See also TODO. BUG=136950, 156433 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=162327 Review URL: https://chromiumcodereview.appspot.com/11174006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@162659 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 162327 - Implement ScopedTestNSSDB instead of OpenTestNSSDB()estade@chromium.org2012-10-171-15/+5
| | | | | | | | | | | | | BUG=136950 Review URL: https://chromiumcodereview.appspot.com/11174006 TBR=toyoshim@chromium.org BUG=156433 Review URL: https://codereview.chromium.org/11196028 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@162511 0039d316-1c4b-4281-b951-d872f2087c98
* Implement ScopedTestNSSDB instead of OpenTestNSSDB()toyoshim@chromium.org2012-10-171-5/+15
| | | | | | | | | BUG=136950 Review URL: https://chromiumcodereview.appspot.com/11174006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@162327 0039d316-1c4b-4281-b951-d872f2087c98
* Remove #pragma once from cryptoajwong@chromium.org2012-07-111-1/+0
| | | | | | Review URL: https://chromiumcodereview.appspot.com/10695140 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@146077 0039d316-1c4b-4281-b951-d872f2087c98
* Remove TPMTokenInfoDelegate to make TPM initialization code path simplehashimoto@chromium.org2012-05-171-32/+3
| | | | | | | | | | | Move Cryptohome D-Bus method calls to chromeos::CertLibrary BUG=125848 TEST=can login Review URL: https://chromiumcodereview.appspot.com/10332191 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@137646 0039d316-1c4b-4281-b951-d872f2087c98
* Remove crypto::IsTPMTokenAvailblehashimoto@chromium.org2012-05-161-6/+0
| | | | | | | | | BUG=126674 TEST=build success Review URL: https://chromiumcodereview.appspot.com/10381151 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@137357 0039d316-1c4b-4281-b951-d872f2087c98
* Convert blocking chromeos::CryptohomeClient::Pkcs11* methods to asynchashimoto@chromium.org2012-02-281-7/+16
| | | | | | | | | | | | CryptohomeLibrary::Pkcs11* methods are removed. crypto::EnsureTPMTokenReady (renamed to InitializeTPMToken) and TPMTokenInfoDelegate::IsTokenReady are also converted to async. BUG=chromium-os:16552 TEST=Login as a user, open chrome://cryptohome and see "token_name" is displayed correctly, open chrome://settings/certificates and see "Import and Bind to Device…" button is enabled (can be pushed). Review URL: http://codereview.chromium.org/9421045 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@123956 0039d316-1c4b-4281-b951-d872f2087c98
* CertDatabaseNSSTest: Don't delete test DB dir since we don't close the DB ↵mattm@chromium.org2012-01-251-6/+7
| | | | | | | | | | | | | | | | (broke in r108543). Refactor test DB code so that nss_util owns the test DB dir. Keeping the test DB dir until exit prevents later tests that would use the test DB from failing. The dir will still be deleted by the LazyInstance atexit handler. BUG=108748 TEST=see bug Review URL: http://codereview.chromium.org/9255034 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@119003 0039d316-1c4b-4281-b951-d872f2087c98
* Reland: Simplify PRTimeToBaseTime implementation, add BaseTimeToPRTime.mattm@chromium.org2011-12-151-0/+4
| | | | | | | | | | BUG=107047 TEST=crypto_unittests TBR=wtc@chromium.org Review URL: http://codereview.chromium.org/8956003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@114693 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 114499 - Simplify PRTimeToBaseTime implementation, add BaseTimeToPRTime.sail@chromium.org2011-12-141-4/+0
| | | | | | | | | | | | | BUG=107047 TEST=crypto_unittests Review URL: http://codereview.chromium.org/8894023 TBR=mattm@chromium.org Review URL: http://codereview.chromium.org/8913018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@114524 0039d316-1c4b-4281-b951-d872f2087c98
* Simplify PRTimeToBaseTime implementation, add BaseTimeToPRTime.mattm@chromium.org2011-12-141-0/+4
| | | | | | | | | | BUG=107047 TEST=crypto_unittests Review URL: http://codereview.chromium.org/8894023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@114499 0039d316-1c4b-4281-b951-d872f2087c98
* Change the Chrome OS PKCS #11 module from libopencryptoki.so to libchaps.so.dkrahn@chromium.org2011-11-171-2/+2
| | | | | | | | | | | | | | | This CL is part of a larger effort to replace opencryptoki as the PKCS #11 layer in Chrome OS. In this first phase, libchaps.so forwards requests to a daemon (chapsd) which loads opencryptoki to service the requests. You can find the Chaps design doc here: https://docs.google.com/a/google.com/document/d/1TQFc6GABKa1JgwUx2hIcxAHQ329fkd03yYlGxhfHQlQ/edit Change-Id: I42962c4703413039641b6ede40caaf0c97ab900e BUG=chromium-os:21005 TEST=* Ensure previously existing certs still exist. * Import new cert and private key from PKCS12 file. Review URL: http://codereview.chromium.org/8527006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@110435 0039d316-1c4b-4281-b951-d872f2087c98
* Changed OAuth token+secret encryption to use supplemental user key from NSS DB.zelidrag@chromium.org2011-09-071-0/+10
| | | | | | | | BUG=chromium-os:18633 TEST=none Review URL: http://codereview.chromium.org/7756025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@99912 0039d316-1c4b-4281-b951-d872f2087c98
* Rename CRYPTO_API to CRYPTO_EXPORT.darin@chromium.org2011-08-051-18/+19
| | | | | | | R=rvargas@chromium.org Review URL: http://codereview.chromium.org/7491061 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@95652 0039d316-1c4b-4281-b951-d872f2087c98
* Export some functions to fix component build for chromeos.sadrul@chromium.org2011-07-131-7/+7
| | | | | | | | | BUG=none TEST=component build works for chromeos Review URL: http://codereview.chromium.org/7342033 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@92408 0039d316-1c4b-4281-b951-d872f2087c98
* crypto: enable components build for Linuxevan@chromium.org2011-07-121-8/+8
| | | | | | | | | | Expose some more API via CRYPTO_API and refactor gyp file. (Reland of r92188.) Review URL: http://codereview.chromium.org/7336009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@92212 0039d316-1c4b-4281-b951-d872f2087c98
* Revert "crypto: enable components build for Linux"evan@chromium.org2011-07-121-8/+8
| | | | | | This reverts commit r92188, link failures in skia (!). git-svn-id: svn://svn.chromium.org/chrome/trunk/src@92206 0039d316-1c4b-4281-b951-d872f2087c98
* crypto: enable components build for Linuxevan@chromium.org2011-07-121-8/+8
| | | | | | | | Expose some more API via CRYPTO_API and refactor gyp file. Review URL: http://codereview.chromium.org/7336009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@92188 0039d316-1c4b-4281-b951-d872f2087c98
* Replace WifiConfigModel with async CertLibrarystevenjb@google.com2011-06-281-0/+17
| | | | | | | | | | | | Update WifiConfigView and VpnConfigView to use CertLibrary. Includes changes to crypto:nss_util.cc BUG=chromium-os:15829 TEST=Test wifi/other + certificates and VPN + certificates. UI should not block. Review URL: http://codereview.chromium.org/7244012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@90833 0039d316-1c4b-4281-b951-d872f2087c98
* Crypto: Add crypto_api to code needed outside of cryptorvargas@google.com2011-06-201-2/+3
| | | | | | | | | | that is not covered by crypto_unittests BUG=85776 TEST=none Review URL: http://codereview.chromium.org/7209001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@89756 0039d316-1c4b-4281-b951-d872f2087c98
* Fixing FindFromPublicKeyInfo so that it searches the "Public" NSS databasegspencer@google.com2011-05-251-1/+1
| | | | | | | | | | | | | | | | | | if it doesn't find the requested key in the "Private" NSS database. This fixes the ownership process because the ownership key is created in the public database because that needs to happen before the TPM is owned and available (and it's not really all that sensitive to begin with). BUG=chromium-os:15645 TEST=Built a new recovery image, wiped a device with it and verified that I was able to sign in as a new user and add users and forget networks. It also showed me as the owner of the device. Review URL: http://codereview.chromium.org/7066032 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@86654 0039d316-1c4b-4281-b951-d872f2087c98
* This adds calls to new API for cryptohomed that gives statusgspencer@chromium.org2011-04-191-10/+27
| | | | | | | | | | | | | | of the PKCS#11 initialization of the TPM. Also, add cros_library wrapper calls for new libcros API. BUG=chromium-os:12303 TEST=Ran on device, checked to make sure TPM certs showed up, indicating that status and user PIN were successfully retrieved. Review URL: http://codereview.chromium.org/6838032 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@82134 0039d316-1c4b-4281-b951-d872f2087c98
* Move crypto files out of base, to a top level directory.rvargas@google.com2011-04-141-0/+138
src/crypto is now an independent project that contains our cryptographic primitives (except md5 and sha1). This removes the base dependency from nss, openssl and sqlite. BUG=76996 TEST=none Review URL: http://codereview.chromium.org/6805019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@81611 0039d316-1c4b-4281-b951-d872f2087c98