TPM2 (Trusted Platform Module) userspace development
 help / color / mirror / Atom feed
From: Petr Gotthard <petr.gotthard at centrum.cz>
To: tpm2@lists.01.org
Subject: [tpm2] Re: CMP error: cannot duplicate context:2306 tpm:warn(2.0): out of memory for object contexts
Date: Mon, 04 Oct 2021 09:31:09 +0200	[thread overview]
Message-ID: <20211004093109.10F3EFFB@centrum.cz> (raw)
In-Reply-To: b058cfb8-53f3-13dd-0e20-6fdc404d77aa@mode51.software

[-- Attachment #1: Type: text/plain, Size: 3042 bytes --]

Hello,
 
this sounds like a known limitation of the openssl provider: https://github.com/tpm2-software/tpm2-openssl/issues/4
 
Some applications (like CMP) are too greedy and consume more resources than the TPM has. The resource managers (to my best knowledge) cannot swap resources from the same user.
 
Are you using the tpm2-abrmd resource manager, or the in-kernel manager? The tpm2-abrmd behaves much better.
 
 
Petr
 
______________________________________________________________
> Od: "Chris Newman" <chris(a)mode51.software>
> Komu: tpm2(a)lists.01.org
> Datum: 04.10.2021 01:41
> Předmět: [tpm2] CMP error: cannot duplicate context:2306 tpm:warn(2.0): out of memory for object contexts
>
Hi,
I create an EK and AK using tpm2_createek, tpm2_createak and tpm2_evictcontrol to persist the AK in 0x81010002. The I use the following command with DigiCert's CMPv2 server:
openssl cmp -config /opt/sdk/openssl/current/ssl/openssl.cnf -provider tpm2 -provider default -propquery ?provider=tpm2,tpm2.digest!=yes -cmd ir -server https://demo.one.digicert.com/iot/api/v1/cmp/IOT_1234 <https://demo.one.digicert.com/iot/api/v1/cmp/IOT_1234> -ref 1234 -secret pass:1234 -recipient "/CN=mode51.software" -key handle:0x81010002 -subject "/CN=TestTest" -cacertsout ./capubs.pem -certout ./cl_cert.pem -tls_used -verbosity 8
I get the following error:
DIGEST NEW
 DIGEST INIT
 DIGEST UPDATE
 DIGEST DUP
 DIGEST FINAL
 DIGEST FREE
 DIGEST NEW
 DIGEST INIT
 DIGEST UPDATE
 DIGEST NEW
 DIGEST INIT
 DIGEST UPDATE
 DIGEST DUP
 WARNING:esys:src/tss2-esys/api/Esys_ContextLoad.c:279:Esys_ContextLoad_Finish() Received TPM Error
 ERROR:esys:src/tss2-esys/api/Esys_ContextLoad.c:93:Esys_ContextLoad() Esys Finish ErrorCode (0x00000902)
 DIGEST FREE
 DIGEST FREE
 DIGEST FREE
 CMP DEBUG: disconnected from CMP server
 CMP error: cannot duplicate context:2306 tpm:warn(2.0): out of memory for object contexts
 CMP error: not able to copy ctx
 CMP error: internal error
 CMP error: error sending
 CMP error: shutdown while in init
 CMP error: transfer error:request sent: IR, expected response: IP
 RSA FREE
 RAND FREE
 RAND FREE
 RAND FREE
 PROVIDER TEARDOWN
 
I've tried tpm2_flushcontext -t.
I recompiled tpm2-openssl with the following option and that appears to have worked around the issue:
--disable-op-digest
Is this what "?provider=tpm2,tpm2.digest!=yes" should effectively do?
 
-- 
 
 Chris Newman 
 https://mode51.software <https://mode51.software> 
 @mode51software <https://twitter.com/mode51software> 
 
  
 
  
 mode51 Software Ltd is registered in England and Wales 
 Company Number 13007792 Registered Office 3 Orchard Way, CB24 1AG, UK 
 
 GPG Encryption key <https://mode51.software/downloads/chrisnewman-mode51-pub-20201111.asc> 
 
 ----------
 
 _______________________________________________
 tpm2 mailing list -- tpm2(a)lists.01.org
 To unsubscribe send an email to tpm2-leave(a)lists.01.org
 %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

[-- Attachment #2: attachment.htm --]
[-- Type: text/html, Size: 4615 bytes --]

[-- Attachment #3: attachment.htm --]
[-- Type: text/html, Size: 4615 bytes --]

[-- Attachment #4: hbofnihajndifnfn.png --]
[-- Type: image/png, Size: 7041 bytes --]

             reply	other threads:[~2021-10-04  7:31 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-04  7:31 Petr Gotthard [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-10-04  8:18 [tpm2] Re: CMP error: cannot duplicate context:2306 tpm:warn(2.0): out of memory for object contexts Chris Newman
2021-10-05 23:08 Chris Newman
2021-10-06  9:49 Petr Gotthard
2021-10-08 15:45 Roberts, William C
2021-10-08 16:44 Petr Gotthard
2021-10-12 20:09 Roberts, William C
2021-10-14 16:48 Petr Gotthard
2021-10-15 14:00 Roberts, William C

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211004093109.10F3EFFB@centrum.cz \
    --to=tpm2@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox