[tpm2] Re: Lifecycle of handles and contexts

Kenneth Goldman <kgoldman at us.ibm.com> Tue, 19 Jul 2022 22:17:57 +0000
Newsgroups dev.linux.lists.tpm2
Message-ID < <BN8PR15MB27533D241112AB1F3EA9D0C7F28F9@BN8PR15MB2753.namprd15.prod.outlook.com>>

>
> On Mon, 2022-07-18 at 17:36 +0000, Kenneth Goldman wrote:
> > It depends.
> >
> > Windows seems to have a large keystore, so you probably don't have to
> > ever flush.
> >
> > Linux in kernel RM manages keys across processes but not within
> > processes, so you still have to flush.
>
> This is also how TBS works on Windows.


Not on my Windows 10.  I just created 32 keys with one process.  Now there are 
32 loaded keys.  OK, the Windows RM swaps them out, but the application never 
sees that.

I don't know what the RM limit is, but it's certainly far more than the TPM 
itself.

getcapability.exe -cap 1 -pr 80000000
32 handles
        80ffffe0
        80ffffe1
        80ffffe2
        80ffffe3
        80ffffe4
        80ffffe5
        80ffffe6
        80ffffe7
        80ffffe8
        80ffffe9
        80ffffea
        80ffffeb
        80ffffec
        80ffffed
        80ffffee
        80ffffef
        80fffff0
        80fffff1
        80fffff2
        80fffff3
        80fffff4
        80fffff5
        80fffff6
        80fffff7
        80fffff8
        80fffff9
        80fffffa
        80fffffb
        80fffffc
        80fffffd
        80fffffe
        80ffffff
smime.p7s (application/pkcs7-signature, 5.3 KB) - not displayed