<feed xmlns='http://www.w3.org/2005/Atom'>
<title>gnupg, branch tpm-work</title>
<subtitle>The GNU Privacy Guard.</subtitle>
<id>http://git.bktus.com/gpgfrontend/gnupg/atom?h=tpm-work</id>
<link rel='self' href='http://git.bktus.com/gpgfrontend/gnupg/atom?h=tpm-work'/>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/gnupg/'/>
<updated>2018-03-12T09:06:44Z</updated>
<entry>
<title>build: Make TPM2 support conditional</title>
<updated>2018-03-12T09:06:44Z</updated>
<author>
<name>James Bottomley</name>
<email>James.Bottomley@HansenPartnership.com</email>
</author>
<published>2018-03-06T23:02:43Z</published>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/gnupg/commit/?id=06c0d7f28fa1842f9c52885b142a0d31ba60c8ae'/>
<id>urn:sha1:06c0d7f28fa1842f9c52885b142a0d31ba60c8ae</id>
<content type='text'>
* configure.ac (HAVE_LIBTSS): New acdefine and am_conditional.
* agent/Makefile.am: (gpg_agent_SOURCES): Move tpm files to ...
(gpg_agent_SOURCES) [HAVE_LIBTSS]: ... here.
* agent/agent.h (divert_tpm2_pksign, divert_tpm2_pkdecrypt)
(divert_tpm2_writekey) [!HAVE_LIBTSS]: Add stub functions.

--
This adds a configure stanza to check for the necessary libtss to
support TPM functions.  If found, the library functions will be
dynamically loaded, meaning that a system built with TPM2 support will
still execute correctly (obviously minus TPM2 support) if installed
without libtss being present.

Signed-off-by: James Bottomley &lt;James.Bottomley@HansenPartnership.com&gt;
</content>
</entry>
<entry>
<title>agent: Minor cleanup of the TPM patches.</title>
<updated>2018-03-09T09:36:14Z</updated>
<author>
<name>Werner Koch</name>
<email>wk@gnupg.org</email>
</author>
<published>2018-03-09T09:36:14Z</published>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/gnupg/commit/?id=fb0470a9f5834b77fba2bf5e1b41f56d063e556f'/>
<id>urn:sha1:fb0470a9f5834b77fba2bf5e1b41f56d063e556f</id>
<content type='text'>
* configure.ac (AC_CHECK_HEADERS): Add tss2/tss.h.
* agent/divert-tpm2.c: Print an error if that file is not available.
* agent/Makefile.am (gpg_agent_SOURCES): Add tpm.h
* agent/command.c (do_one_keyinfo): Replace xstrdup by xtrystrdup.
* agent/protect.c (agent_get_shadow_info_type): Check error of
xtrystrdup.

Signed-off-by: Werner Koch &lt;wk@gnupg.org&gt;
</content>
</entry>
<entry>
<title>tpm2: add handling for elliptic curve keys</title>
<updated>2018-03-09T09:15:25Z</updated>
<author>
<name>James Bottomley</name>
<email>James.Bottomley@HansenPartnership.com</email>
</author>
<published>2018-03-05T19:18:15Z</published>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/gnupg/commit/?id=72ece35fb713eaf88d425f8b3468bec0d2b887e1'/>
<id>urn:sha1:72ece35fb713eaf88d425f8b3468bec0d2b887e1</id>
<content type='text'>
* agent/divert-tpm2.c: Support ECC.

--
This adds handling for the way gnupg does elliptic keys, namely ECDSA
for signatures and using ECDH with an ephemeral key to generate an
encrypted message.  The main problem is that the TPM2 usually has a
very small list of built in curves and it won't handle any others.
Thanks to TCG mandates, all TPM2 systems in the USA should come with
NIST P-256, but do not come with the Bernstien curve 25519, so the
only way to use the TPM2 to protect an elliptic curve key is first to
create it with a compatible algorithm.

Signed-off-by: James Bottomley &lt;James.Bottomley@HansenPartnership.com&gt;
</content>
</entry>
<entry>
<title>g10: add ability to transfer a private key to the tpm</title>
<updated>2018-03-09T09:06:40Z</updated>
<author>
<name>James Bottomley</name>
<email>James.Bottomley@HansenPartnership.com</email>
</author>
<published>2018-03-05T19:16:40Z</published>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/gnupg/commit/?id=c4c7b7d7ba6b9d52bb7884b4bb4f84b7dd96340b'/>
<id>urn:sha1:c4c7b7d7ba6b9d52bb7884b4bb4f84b7dd96340b</id>
<content type='text'>
* g10/keyedit.c (cmdKEYTOTPM): New enum value.
(cmds): New command "keytotpm".
(keyedit_menu): Implement cmdKEYTOTPM.

--

Exactly like the gpg --edit-key command keytosc, keytotpm has been
added which immedately converts the private key file to TPM shadowed
form.  Once this is done, the key cannot be recovered and may only be
used via the TPM of the computer system on which the conversion was
done.  If that system is ever lost, or its TPM cleared, the shadowed
key becomes unusable.

Signed-off-by: James Bottomley &lt;James.Bottomley@HansenPartnership.com&gt;
</content>
</entry>
<entry>
<title>agent: plumb in TPM handling</title>
<updated>2018-03-09T09:01:59Z</updated>
<author>
<name>James Bottomley</name>
<email>James.Bottomley@HansenPartnership.com</email>
</author>
<published>2018-03-05T19:15:29Z</published>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/gnupg/commit/?id=1a4a4a8f5fa575df64ab130b03e666920f7093ee'/>
<id>urn:sha1:1a4a4a8f5fa575df64ab130b03e666920f7093ee</id>
<content type='text'>
* agent/divert-tpm2.c: New.
* Makefile.am (gpg_agent_SOURCES): Add it.
* agent/command.c (do_one_keyinfo): Fake serialno for TPM.
(cmd_keytotpm): New.
(register_commands): Register KEYTOTPM command.
* agent/pkdecrypt.c (agent_pkdecrypt): Divert to TPM.
* agent/pksign.c (agent_pksign_do): Divert to TPM.

--
This code installs diversions for pksign and pkdecrypt to do the
operations via the TPM if a TPM shadowed key is present.  It also adds
an extra assuan command KEYTOTPM which moves an existing private key
to a TPM shadowed key.

The way TPM shadowing works is that the public and private key parts
are fed in to the TPM command TPM2_Import.  The output of this command
is a TPM specific public and private key data where the private key
data is symmetrically encrypted using a TPM internal key.  If this
physical TPM is ever lost or cleared, that TPM internal key will
likewise be lost and nothing will ever be able to read the private
key.  Once the import is done, the shadow information for the key is
updated to be a three part list consisting of the parent key (hard
coded to 81000001 which is the Microsoft preferred RSA incarnation of
the storage seed) and the public and private TPM data blobs.

Now when a TPM shadowed key is used, the data blobs must be loaded
into the TPM with TPM2_Load before any operation can be performed.

Signed-off-by: James Bottomley &lt;James.Bottomley@HansenPartnership.com&gt;

- Added ChangeLog entries

Signed-off-by: Werner Koch &lt;wk@gnupg.org&gt;
</content>
</entry>
<entry>
<title>agent: add tpm specific functions</title>
<updated>2018-03-09T08:02:01Z</updated>
<author>
<name>James Bottomley</name>
<email>James.Bottomley@HansenPartnership.com</email>
</author>
<published>2018-03-05T19:14:34Z</published>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/gnupg/commit/?id=144cceec7ca132d471cc6b7b200e0c59a23663d1'/>
<id>urn:sha1:144cceec7ca132d471cc6b7b200e0c59a23663d1</id>
<content type='text'>
* agent/tpm2.c: New.
* agent/Makefile.am (gpg_agent_SOURCES): Add new file.
(gpg_agent_LDFLAGS): Add DL_LIBS.
* agent/tpm2.h: New.
--

This commit adds code to handle the three specific functions needed to
make the agent TPM aware, namely the ability to load a key from shadow
information, the ability to sign a digest with that key, the ability
to decrypt with the key and the ability to import a key to the TPM.

The TPM2 is a bit of an esoteric beast, so all TPM specific callouts
are confined inside this code.  Additionaly, it requires the tss2
library to function, so the code is designed such that if the library
isn't present then all TPM functions simply fail.  This allows the
code to be compiled with TPM support, but not require that the support
library be present on the system.

Signed-off-by: James Bottomley &lt;James.Bottomley@HansenPartnership.com&gt;

- Added ChangeLog entries.
- Added DL_LIBS.
- Removed one -Wdeclaration-after-statement case.

Signed-off-by: Werner Koch &lt;wk@gnupg.org&gt;
</content>
</entry>
<entry>
<title>agent: expose shadow key type</title>
<updated>2018-03-09T07:31:17Z</updated>
<author>
<name>James Bottomley</name>
<email>James.Bottomley@HansenPartnership.com</email>
</author>
<published>2018-03-05T19:13:25Z</published>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/gnupg/commit/?id=30c434eaf34e8facb3df0eebdd2de26f4fa604af'/>
<id>urn:sha1:30c434eaf34e8facb3df0eebdd2de26f4fa604af</id>
<content type='text'>
* agent/findkey.c (agent_key_info_from_file): Add new return arg
r_shadow_info_type.
* agent/protect.c (agent_shadow_key): Factor code out to ...
(agent_shadow_key_type): new.  Add arg 'type'.
(agent_get_shadow_info): Factor code out to ...
(agent_get_shadow_info_type): new. Add arg 'shadow_type'.
(agent_is_tpm2_key): New.
(agent_get_shadow_type): New.
* agent/command.c (do_one_keyinfo): Get and check the
shadow_info_type.
--

For TPM support it is necessary to indroduce another type of shadow
key, so allow other agent functions to extract the type so they can
make the right decisions based on it.

Signed-off-by: James Bottomley &lt;James.Bottomley@HansenPartnership.com&gt;

Added ChangeLog entries.

Signed-off-by: Werner Koch &lt;wk@gnupg.org&gt;
</content>
</entry>
<entry>
<title>Merge branch 'STABLE-BRANCH-2-2' into wk-master</title>
<updated>2018-03-06T15:26:26Z</updated>
<author>
<name>Werner Koch</name>
<email>wk@gnupg.org</email>
</author>
<published>2018-03-06T15:26:26Z</published>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/gnupg/commit/?id=f574aabeeb873f14a586f80cac16b857e6088534'/>
<id>urn:sha1:f574aabeeb873f14a586f80cac16b857e6088534</id>
<content type='text'>
</content>
</entry>
<entry>
<title>agent: Also evict cached items via a timer.</title>
<updated>2018-03-06T15:22:42Z</updated>
<author>
<name>Werner Koch</name>
<email>wk@gnupg.org</email>
</author>
<published>2018-03-06T15:22:42Z</published>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/gnupg/commit/?id=f060cb5c63923d6caec784f65f3bb0aadf52f795'/>
<id>urn:sha1:f060cb5c63923d6caec784f65f3bb0aadf52f795</id>
<content type='text'>
* agent/cache.c (agent_cache_housekeeping): New func.
* agent/gpg-agent.c (handle_tick): Call it.
--

This change mitigates the risk of having cached items in a post mortem
dump.

GnuPG-bug-id: 3829
Signed-off-by: Werner Koch &lt;wk@gnupg.org&gt;
</content>
</entry>
<entry>
<title>gpg: Fix regression in last --card-status patch</title>
<updated>2018-03-01T18:10:10Z</updated>
<author>
<name>Werner Koch</name>
<email>wk@gnupg.org</email>
</author>
<published>2018-03-01T18:10:10Z</published>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/gnupg/commit/?id=bf43b39c05cfc68ea17483c78f14bfca6faf08eb'/>
<id>urn:sha1:bf43b39c05cfc68ea17483c78f14bfca6faf08eb</id>
<content type='text'>
--

Sorry, I accidentally pushed the last commit without having amended it
with this fix.

Fixes-commit: fd595c9d3642dba437fbe0f6e25d7aaaae095f94
Signed-off-by: Werner Koch &lt;wk@gnupg.org&gt;
</content>
</entry>
</feed>
