Skip to content

fix: use salted sessions in load_ak/create_ak - #682

Open
ansasaki wants to merge 1 commit into
parallaxsecond:mainfrom
ansasaki:fix-ak-salted-sessions
Open

ansasaki wants to merge 1 commit into
parallaxsecond:mainfrom
ansasaki:fix-ak-salted-sessions

Conversation

@ansasaki

@ansasaki ansasaki commented Sep 1, 2026

Copy link
Copy Markdown

Summary

  • Switch load_ak() and create_ak() to use salted policy sessions by
    passing the parent EK handle as tpmKey to start_auth_session
  • Fixes TPM_RC_SIZE (0x000001d5) errors with tpm2-tss >= 4.2.0, which
    introduced a regression in ESAPI parameter encryption for unsalted sessions
  • Improves security: salted sessions derive encryption keys from a proper
    shared secret (RSA-encrypted salt or ECDH) rather than plaintext nonces
  • Aligns with tpm2-tools behavior (e.g. tpm2_createak already uses salted
    sessions)

Fixes #681

Test plan

  • All 7 AK integration tests pass against tpm2-tss 4.2.0 (RSA and ECC EKs)
  • Reproduced the failure without the fix against tpm2-tss 4.2.0
  • cargo check passes cleanly

This PR was created with the help of AI (Claude Code by Anthropic).

@ansasaki
ansasaki force-pushed the fix-ak-salted-sessions branch from e4c51bb to 6406573 Compare September 1, 2026 09:00
Unsalted policy sessions with encrypt/decrypt attributes hit a broken
code path in tpm2-tss >= 4.2.0 (commit 9f1f612), causing TPM_RC_SIZE
(0x000001d5) errors. Pass the parent EK handle as tpmKey to
start_auth_session so sessions are salted, which avoids the bug and also
improves security by deriving encryption keys from an RSA-encrypted salt
rather than plaintext nonces alone.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
@ansasaki
ansasaki force-pushed the fix-ak-salted-sessions branch from 6406573 to a894b43 Compare September 2, 2026 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

load_ak/create_ak fail with tpm2-tss >= 4.2.0 due to unsalted encrypted sessions

1 participant