chromiumos/third_party/trousers.git
15 months agotrousers: remove inline keyword from two functions. 94/59794/4 factory-4455.B factory-pit-4390.B factory-pit-4471.B firmware-falco_peppy-4389.B firmware-leon-4389.26.B firmware-pit-4482.B firmware-wolf-4389.24.B master release-R30-4537.B stabilize-4443.B stabilize-4512.B
Yunlian Jiang [Mon, 24 Jun 2013 17:02:58 +0000 (10:02 -0700)]
trousers: remove inline keyword from two functions.

Inline functions only make sense when you put them in a ".h" file.
The whole concept is about making the function definition visible
to all callers.

This patch removes the inline keyword from function read_data and
write_data because they are in .c file and they are used by other
c files.

BUG=chromium:253557
TEST=FEATURES="TEST" emerge-lumpy trousers passes.

Change-Id: I04149e41a60bc9487636a7d758a1fd3f34a105b5
Reviewed-on: https://gerrit.chromium.org/gerrit/59794
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Luigi Semenzato <semenzato@chromium.org>
Reviewed-by: Darren Krahn <dkrahn@chromium.org>
Commit-Queue: Yunlian Jiang <yunlian@chromium.org>
Tested-by: Yunlian Jiang <yunlian@chromium.org>
21 months agodo not add -m64 flags automatically 56/40156/2 factory-3536.B factory-4128.B factory-4290.B factory-pit-4280.B factory-spring-3842.B factory-spring-4131.B factory-spring-4262.B firmware-spring-3824.4.B firmware-spring-3824.55.B firmware-spring-3824.84.B firmware-spring-3824.B release-R26-3701.B release-R27-3912.B release-R28-4100.B release-R29-4319.B stabilize-3658.0.0 stabilize-3701.30.0 stabilize-3701.30.0b stabilize-3701.46.B stabilize-3701.81.B stabilize-3881.0.B stabilize-3912.79.B stabilize-4008.0.B stabilize-4035.0.B stabilize-4068.0.B stabilize-4100.38.B stabilize-4255.B stabilize-4287.B stabilize-bluetooth-smart stabilize-spring-4100.53.B toolchain-3701.42.B toolchainA toolchainB
Mike Frysinger [Sat, 22 Dec 2012 18:50:22 +0000 (13:50 -0500)]
do not add -m64 flags automatically

This fix is already in upstream:
http://trousers.git.sourceforge.net/git/gitweb.cgi?p=trousers/trousers;a=commit;h=30162cb8e2cb621053381b3c334c39d416206939

BUG=chromium-os:36866
TEST=`emerge-stumpy trousers` still works
TEST=`emerge-x32-generic trousers` now works

Change-Id: Ieb45005377bd2646e8a6099c9f530bab41816ee6
Reviewed-on: https://gerrit.chromium.org/gerrit/40156
Reviewed-by: Darren Krahn <dkrahn@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>

23 months agoWorkaround TPM_E_INVALID_KEYHANDLE error when evicting keys. release-R25-3428.B stabilize-3428.110.0 stabilize-3428.149 stabilize-3428.149.B stabilize-3428.193 stabilize2 toolchain-3428.65.B
Darren Krahn [Tue, 23 Oct 2012 21:40:54 +0000 (14:40 -0700)]
Workaround TPM_E_INVALID_KEYHANDLE error when evicting keys.

BUG=chrome-os-partner:14945
TEST=Ran platform_TPMEvict autotest.

Change-Id: I39c2f600b37d53e6436251728991bb981c8e34ea
Reviewed-on: https://gerrit.chromium.org/gerrit/36374
Reviewed-by: Gaurav Shah <gauravsh@chromium.org>
Commit-Ready: Darren Krahn <dkrahn@chromium.org>
Tested-by: Darren Krahn <dkrahn@chromium.org>
23 months agoWorkaround TPM_E_KEYNOTFOUND error when evicting keys.
Darren Krahn [Mon, 8 Oct 2012 20:24:38 +0000 (13:24 -0700)]
Workaround TPM_E_KEYNOTFOUND error when evicting keys.

Some TPMs can return TPM_E_KEYNOTFOUND when attempting to evict a key.
In this particular case it is safe to ignore the error because we want
to evict the key anyways.

BUG=chrome-os-partner:14945
TEST=Ran platform_TPMEvict autotest.

Change-Id: I6281d120f8cca218ccf1296ded354e892c0c31a1
Reviewed-on: https://gerrit.chromium.org/gerrit/34947
Commit-Ready: Darren Krahn <dkrahn@chromium.org>
Reviewed-by: Darren Krahn <dkrahn@chromium.org>
Tested-by: Darren Krahn <dkrahn@chromium.org>
2 years agoUse better error code when key reload fails. factory-2985.B factory-2993.B factory-3004.B
Darren Krahn [Tue, 11 Sep 2012 23:15:53 +0000 (16:15 -0700)]
Use better error code when key reload fails.

When an operation uses a key that has been evicted from the TPM, tcsd
attempts to reload the key. On some TPMs this can fail with
TPM_E_AUTHFAIL. We want to convert this into something more appropriate
so an application can distinguish this case from an actual authorization
problem with the current operation.

BUG=chrome-os-partner:13878
TEST=Reproduce the problem and verify the error code.

Change-Id: I918f4e2c12c6258c8078ea10a3562c1e6345cfb9
Reviewed-on: https://gerrit.chromium.org/gerrit/33007
Reviewed-by: Kees Cook <keescook@chromium.org>
Commit-Ready: Darren Krahn <dkrahn@chromium.org>
Tested-by: Darren Krahn <dkrahn@chromium.org>
2 years agoFixed key eviction during LoadKeyByBlob. factory-2914.B
Darren Krahn [Mon, 10 Sep 2012 18:01:22 +0000 (11:01 -0700)]
Fixed key eviction during LoadKeyByBlob.

Sometimes more than one loaded keys need to be evicted before there is
enough space available for the current key to be loaded.

BUG=chrome-os-partner:13721
TEST=Attempt to reproduce issue by repeating the following command a few
hundred times:
> p11_replay --inject --replay_wifi

Change-Id: Ic04c251cb051dbe7b98025de2eb611ee5e7bef3a
Reviewed-on: https://gerrit.chromium.org/gerrit/32772
Reviewed-by: Gaurav Shah <gauravsh@chromium.org>
Commit-Ready: Darren Krahn <dkrahn@chromium.org>
Tested-by: Darren Krahn <dkrahn@chromium.org>
2 years agoFixed trousers test suite autotest integration. factory-2848.B
Darren Krahn [Tue, 19 Jun 2012 23:10:41 +0000 (16:10 -0700)]
Fixed trousers test suite autotest integration.

Also added the following features to the autotest:
- Passes through the owner secret environment variable.
- Optional test filter argument.
- Tests that require owner privileges are automatically excluded if an
  owner secret is not specified.
- Tests that do not run on chrome-os and tests that are broken are
  automatically exluded.

BUG=None
TEST=Ran the autotest on lumpy (SLB9635 LPC) with an owner secret.

Change-Id: Id6703a085fa3f28c5b058e78cb33272a0c1b5c23
Reviewed-on: https://gerrit.chromium.org/gerrit/32030
Commit-Ready: Darren Krahn <dkrahn@chromium.org>
Reviewed-by: Darren Krahn <dkrahn@chromium.org>
Tested-by: Darren Krahn <dkrahn@chromium.org>
2 years agoAdded support for owner delegation in Tspi_TPM_ActivateIdentity. factory-2846.B firmware-stout-2817.B
Darren Krahn [Thu, 23 Aug 2012 17:23:59 +0000 (10:23 -0700)]
Added support for owner delegation in Tspi_TPM_ActivateIdentity.

BUG=chromium-os:33597
TEST=Enabled ActivateIdentity verification in cryptohomed and ran
     `cryptohome --action=tpm_verify_attestation`

Change-Id: Ifd6120e8be9284ee681d43ccaea7ea4b13bdc8a6
Reviewed-on: https://gerrit.chromium.org/gerrit/31229
Reviewed-by: Gaurav Shah <gauravsh@chromium.org>
Commit-Ready: Darren Krahn <dkrahn@chromium.org>
Tested-by: Darren Krahn <dkrahn@chromium.org>
2 years agoFixed a linked list manipulation bug. factory-2460.B factory-2475.B factory-2569.B factory-2717.B factory-2723.14.B firmware-butterfly-2788.B firmware-link-2695.2.B firmware-link-2695.B firmware-parrot-2685.B firmware-snow-2695.90.B firmware-snow-2695.B release-R21-2465.B
Darren Krahn [Thu, 31 May 2012 21:07:52 +0000 (14:07 -0700)]
Fixed a linked list manipulation bug.

Consider the case where you start with A->B->C and you remove B. Before
this fix, both A and B were removed from the list. This resulted in a
dangling reference to A in the key manager and invalid key handle errors
when A was next referenced. Also this resulted in A not being evicted /
flushed from the TPM when Tspi_Key_UnloadKey was called.

BUG=None
TEST=Run the platform_Pkcs11Events autotest.

Change-Id: If1fd6612ae13a6a1f558a9dcaa8e36f9b5eea577
Reviewed-on: https://gerrit.chromium.org/gerrit/24241
Reviewed-by: Gaurav Shah <gauravsh@chromium.org>
Tested-by: Darren Krahn <dkrahn@chromium.org>
Commit-Ready: Darren Krahn <dkrahn@chromium.org>

2 years agoRestrict tcsd input to uid root or group tss. factory-2305.B factory-2338.B factory-2368.B factory-2394.B firmware-link-2348.B
Luigi Semenzato [Mon, 27 Feb 2012 18:41:00 +0000 (10:41 -0800)]
Restrict tcsd input to uid root or group tss.

This prevents DOS (or worse) attacks on tcsd by restricting its input to
processes running with UID root or GID tss.

BUG=chromium-os:25099
TEST=installed trousers, verified that /var/run/tcsd.socket is
srw-rw---- 1 root tss, and verified that I can still log on.

Change-Id: I01824ca893ff2172833a9a9b1b98444269356764
Reviewed-on: https://gerrit.chromium.org/gerrit/16820
Reviewed-by: Darren Krahn <dkrahn@chromium.org>
Tested-by: Darren Krahn <dkrahn@chromium.org>
Commit-Ready: Darren Krahn <dkrahn@chromium.org>

2 years agotrousers: update hardware_TPM tests to whatever was in autotest/files/ factory-1987.B release-R19-2046.B
Zdenek Behan [Mon, 20 Feb 2012 16:03:41 +0000 (17:03 +0100)]
trousers: update hardware_TPM tests to whatever was in autotest/files/

This has been moved here some time ago. Update the source as someone
updated it in autotest.

BUG=chromium-os:26632
TEST=emerge trousers-tests

Change-Id: I1a5eaac58c4afbd44b5212c0e4f7d5df922da3fd
Reviewed-on: https://gerrit.chromium.org/gerrit/16252
Reviewed-by: Elly Jones <ellyjones@chromium.org>
Commit-Ready: Zdenek Behan <zbehan@chromium.org>
Tested-by: Zdenek Behan <zbehan@chromium.org>
2 years agoMoved scoped_tss_type.h from cryptohome to trousers.
Darren Krahn [Mon, 13 Feb 2012 21:35:29 +0000 (13:35 -0800)]
Moved scoped_tss_type.h from cryptohome to trousers.

This file may be useful for any C++ project that uses trousers. Moving
the file here facilitates code reuse.

BUG=None
TEST=emerge trousers and ensure file is installed in /usr/include.

Change-Id: I4353e527c5b7244794f1a886fd029eecf5b5cdc6
Reviewed-on: https://gerrit.chromium.org/gerrit/15779
Reviewed-by: Gaurav Shah <gauravsh@chromium.org>
Tested-by: Darren Krahn <dkrahn@chromium.org>
Commit-Ready: Darren Krahn <dkrahn@chromium.org>

2 years agoFixed memory leaks when setting RSA key attributes.
Darren Krahn [Mon, 13 Feb 2012 21:31:06 +0000 (13:31 -0800)]
Fixed memory leaks when setting RSA key attributes.

BUG=None
TEST=Tested manually.

Change-Id: If199d54b3f03dc0970dbd9cb6e510886155503df
Reviewed-on: https://gerrit.chromium.org/gerrit/15778
Reviewed-by: Gaurav Shah <gauravsh@chromium.org>
Tested-by: Darren Krahn <dkrahn@chromium.org>
Commit-Ready: Darren Krahn <dkrahn@chromium.org>

2 years agoAdded call tracing to Trousers. factory-1412.B release-R17-1412.B release-R18-1660.B
Darren Krahn [Wed, 23 Nov 2011 17:49:34 +0000 (09:49 -0800)]
Added call tracing to Trousers.

The tracing is disabled by default and can be enabled by defining
TSS_TRACE.

BUG=None
TEST=Try using TPM-related services:
     - VPN certificate authentication.
     - Wireless certificate authentication.

Change-Id: Ifdde7fcf28699681ef74db4448104ebd434edab1
Reviewed-on: https://gerrit.chromium.org/gerrit/12089
Commit-Ready: Darren Krahn <dkrahn@chromium.org>
Reviewed-by: Darren Krahn <dkrahn@chromium.org>
Tested-by: Darren Krahn <dkrahn@chromium.org>
3 years agoAvoid shutdown-time crash in wpa_supplicant. 0.12.433.B 0.12.433.B109 0.12.433.B62 0.13.434.B 0.13.509.B 0.13.558.B 0.13.587.B 0.14.811.B 0.15.877.B 780.B factory-1020.B factory-1235.B factory-1284.B factory-980.B firmware-881-u-boot-v1 firmware-kiev-2.112.B firmware-u-boot-v1 firmware-uboot_v2-1299.B release-1011.B release-R16-1193.B test-982.B
Luigi Semenzato [Fri, 15 Apr 2011 00:28:15 +0000 (17:28 -0700)]
Avoid shutdown-time crash in wpa_supplicant.

Change-Id: I1fafc5ed5a4bde2b1ac89ca7fa6bf9c3a132489e

BUG=chromium-os:8593
TEST=see if chromeos crash (from go/crash) with signature 9e97e (get_table_entry) goes away

Review URL: http://codereview.chromium.org/6813030

3 years agoChange to use a unix socket instead of TCP. 0.11.241.B 0.11.257.B 0.11.257.B90 0.12.362.B 0.12.369.B 0.12.392.B 11.1.241.B
Frank Swiderski [Wed, 20 Oct 2010 20:26:50 +0000 (13:26 -0700)]
Change to use a unix socket instead of TCP.

This change makes Trousers use a unix domain socket instead of a TCP socket.  This allows tcsd to start without waiting on the network.

Change-Id: Ic66830a03d35bbe503e9a91ca2ebbbd96924fb42

BUG=7892
TEST=install, test cryptohome tpm ownership, crypto, and status

Review URL: http://codereview.chromium.org/3958001

3 years agoUpgrade from trousers 0.3.3 to 0.3.6 and from testsuite 0.2 to 0.3.
Luigi Semenzato [Thu, 7 Oct 2010 16:55:51 +0000 (09:55 -0700)]
Upgrade from trousers 0.3.3 to 0.3.6 and from testsuite 0.2 to 0.3.

Change-Id: I2db46ec6163582c193f0ed1302a72e147a0c87db

BUG=none
TEST=connected to Google-A.  Run the test suite with less than 50 errors.

Review URL: http://codereview.chromium.org/3581012

4 years agotrousers: merge parallel make changes from autotest.git repo
Zdenek Behan [Fri, 10 Sep 2010 19:28:02 +0000 (12:28 -0700)]
trousers: merge parallel make changes from autotest.git repo

Change-Id: If6646cdfa0fe513d4ce307bf09adf6795becb5b2

BUG=
TEST=

Review URL: http://codereview.chromium.org/3340014

4 years agotrousers: move autotest tests into trousers.git repo
Zdenek Behan [Wed, 18 Aug 2010 22:41:31 +0000 (15:41 -0700)]
trousers: move autotest tests into trousers.git repo

Change-Id: Ie6a5904eebc65a0ec1157921488b383253540966

Review URL: http://codereview.chromium.org/3162020

4 years agoinherit review settings
Mandeep Singh Baines [Mon, 24 May 2010 23:17:05 +0000 (16:17 -0700)]
inherit review settings

TBR=cmasone

Review URL: http://codereview.chromium.org/2128027

4 years agoThe DefineSpace04 test currently fails because this test is expecting that it will
tedbo [Thu, 25 Mar 2010 01:05:35 +0000 (18:05 -0700)]
The DefineSpace04 test currently fails because this test is expecting that it will
get an error when incorrectly defining a space. However, when it fails to not create
the space it leaves it around. This change removes the space so that further runs of
the test will have a chance at doing the right thing.

Review URL: http://codereview.chromium.org/1315006

4 years agoAdding TSS/TPM test suite to trousers.
Luigi Semenzato [Fri, 5 Mar 2010 18:33:59 +0000 (10:33 -0800)]
Adding TSS/TPM test suite to trousers.

Review URL: http://codereview.chromium.org/669165

4 years agoAdded README.chromium.
Luigi Semenzato [Fri, 15 Jan 2010 21:59:10 +0000 (13:59 -0800)]
Added README.chromium.

4 years agoOriginal trousers 0.3.3 distribution.
Luigi Semenzato [Fri, 15 Jan 2010 21:53:24 +0000 (13:53 -0800)]
Original trousers 0.3.3 distribution.