parallaxsecond / parallaxsecond/rust-tss-esapi

Beta not compiling with tss2_esys 0.6.0

Open
#659 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
135
Forks
80
Avg merge
1d 17h
Merged PRs (30d)
5

Description

Hi everyone,

I had to remove my cargo.lock due to an old dependency I wanted to update and I can't compile my project anymore.
I use tss-esapi 8.0.0-alpha.2 because I use a feature to connect to a tpm using sockets.

Here is the full log:

error[E0432]: unresolved import `crate::tss2_esys::TPMI_DH_SAVED`
 --> /home/iiztp/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tss-esapi-8.0.0-alpha.2/src/interface_types/data_handles.rs:9:34
  |
9 |     tss2_esys::{TPMI_DH_CONTEXT, TPMI_DH_SAVED},
  |                                  ^^^^^^^^^^^^^ no `TPMI_DH_SAVED` in the root

error[E0432]: unresolved import `crate::tss2_esys::TSS2_BASE_RC_NOT_PROVISIONED`
   --> /home/iiztp/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tss-esapi-8.0.0-alpha.2/src/constants/tss.rs:737:17
    |
737 |         pub use crate::tss2_esys::TSS2_BASE_RC_NOT_PROVISIONED; /* Provisioning was not executed */
    |                 ^^^^^^^^^^^^^^^^^^----------------------------
    |                 |                 |
    |                 |                 help: a similar name exists in the module: `TSS2_BASE_RC_NOT_PERMITTED`
    |                 no `TSS2_BASE_RC_NOT_PROVISIONED` in the root

error[E0432]: unresolved import `crate::tss2_esys::TSS2_BASE_RC_ALREADY_PROVISIONED`
   --> /home/iiztp/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tss-esapi-8.0.0-alpha.2/src/constants/tss.rs:738:17
    |
738 |         pub use crate::tss2_esys::TSS2_BASE_RC_ALREADY_PROVISIONED; /* Already provisioned */
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `TSS2_BASE_RC_ALREADY_PROVISIONED` in the root

error[E0432]: unresolved import `crate::tss2_esys::TPMU_SENSITIVE_CREATE`
   --> /home/iiztp/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tss-esapi-8.0.0-alpha.2/src/structures/buffers.rs:447:17
    |
447 |             use crate::tss2_esys::TPMU_SENSITIVE_CREATE;
    |                 ^^^^^^^^^^^^^^^^^^---------------------
    |                 |                 |
    |                 |                 help: a similar name exists in the module: `TPMS_SENSITIVE_CREATE`
    |                 no `TPMU_SENSITIVE_CREATE` in the root

error[E0412]: cannot find type `TPMI_DH_SAVED` in this scope
   --> /home/iiztp/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tss-esapi-8.0.0-alpha.2/src/constants/tss.rs:649:36
    |
649 | pub const TPMI_DH_SAVED_TRANSIENT: TPMI_DH_SAVED = 0x80000000; /* an ordinary transient object */
    |                                    ^^^^^^^^^^^^^ not found in this scope

error[E0412]: cannot find type `TPMI_DH_SAVED` in this scope
   --> /home/iiztp/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tss-esapi-8.0.0-alpha.2/src/constants/tss.rs:650:35
    |
650 | pub const TPMI_DH_SAVED_SEQUENCE: TPMI_DH_SAVED = 0x80000001; /* a sequence object */
    |                                   ^^^^^^^^^^^^^ not found in this scope

error[E0412]: cannot find type `TPMI_DH_SAVED` in this scope
   --> /home/iiztp/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tss-esapi-8.0.0-alpha.2/src/constants/tss.rs:651:42
    |
651 | pub const TPMI_DH_SAVED_TRANSIENT_CLEAR: TPMI_DH_SAVED = 0x80000002; /* a transient object with the stClear attribute SET */
    |                                          ^^^^^^^^^^^^^ not found in this scope

   Compiling alloy-primitives v1.6.0
error[E0277]: the trait bound `u32: std::convert::From<Saved>` is not satisfied
  --> /home/iiztp/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tss-esapi-8.0.0-alpha.2/src/structures/tpm_context.rs:75:46
   |
75 |             savedHandle: native.saved_handle.into(),
   |                                              ^^^^ the trait `std::convert::From<Saved>` is not implemented for `u32`
   |
   = help: the following other types implement trait `std::convert::From<T>`:
             `u32` implements `std::convert::From<AlgorithmAttributes>`
             `u32` implements `std::convert::From<AttachedComponentTpmHandle>`
             `u32` implements `std::convert::From<AuthHandle>`
             `u32` implements `std::convert::From<CapabilityType>`
             `u32` implements `std::convert::From<Char>`
             `u32` implements `std::convert::From<CommandCode>`
             `u32` implements `std::convert::From<CommandCodeAttributes>`
             `u32` implements `std::convert::From<CommandCodeStructure>`
           and 28 others
   = note: required for `Saved` to implement `Into<u32>`

I checked the code of tss_esys and there are effectively constants missing.
Am I missing something or ?

Have a good day,
iiztp

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the build with tss-esapi 8.0.0-alpha.2 and tss2-esys 0.6.0, then inspect the generated crate bindings for TPMI_DH_SAVED, TSS2_BASE_RC_NOT_PROVISIONED, TSS2_BASE_RC_ALREADY_PROVISIONED, and TPMU_SENSITIVE_CREATE. Done means the reported crate compiles with the dependency combination and the affected conversions and constants resolve correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
security
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.