Skip to main content

BaseError

Enum BaseError 

Source
#[repr(u16)]
pub enum BaseError {
Show 53 variants GeneralFailure = 1, NotImplemented = 2, BadContext = 3, AbiMismatch = 4, BadReference = 5, InsufficientBuffer = 6, BadSequence = 7, NoConnection = 8, TryAgain = 9, IoError = 10, BadValue = 11, NotPermitted = 12, InvalidSessions = 13, NoDecryptParam = 14, NoEncryptParam = 15, BadSize = 16, MalformedResponse = 17, InsufficientContext = 18, InsufficientResponse = 19, IncompatibleTcti = 20, NotSupported = 21, BadTctiStructure = 22, Memory = 23, BadTr = 24, MultipleDecryptSessions = 25, MultipleEncryptSessions = 26, RspAuthFailed = 27, NoConfig = 28, BadPath = 29, NotDeletable = 30, PathAlreadyExists = 31, KeyNotFound = 32, SignatureVerificationFailed = 33, HashMismatch = 34, KeyNotDuplicable = 35, PathNotFound = 36, NoCert = 37, NoPcr = 38, PcrNotResettable = 39, BadTemplate = 40, AuthorizationFailed = 41, AuthorizationUnknown = 42, NvNotReadable = 43, NvTooSmall = 44, NvNotWriteable = 45, PolicyUnknown = 46, NvWrongType = 47, NameAlreadyExists = 48, NoTpm = 49, BadKey = 50, NoHandle = 51, NotProvisioned = 52, AlreadyProvisioned = 53,
}
Expand description

Enum representing the base error values for the TSS return code.

§Details

These values are only returned by non TPM layers of the software stack. For some layers only a subset of these are used.

Note: In order to create a complete TSS return value for non TPM layers. This error code needs to be combined with the information about the layer that produced it.

TCG TSS 2.0 Overview and Common Structures Specification:

“For return values other than SUCCESS, the second most significant byte of the return value is a layer code indicating the software layer that generated the error.”

“Base return codes. These base codes indicate the error that occurred. They are logical-ORed with a layer code to produce the TSS2 return value.”

Variants§

§

GeneralFailure = 1

Catch all for all errors not otherwise specified.

§

NotImplemented = 2

If called functionality isn’t implemented.

§

BadContext = 3

A context structure is bad.

§

AbiMismatch = 4

Passed in ABI version doesn’t match called module’s ABI version.

§

BadReference = 5

A pointer is NULL that isn’t allowed to be NULL.

§

InsufficientBuffer = 6

A buffer isn’t large enough.

§

BadSequence = 7

Function called in the wrong order.

§

NoConnection = 8

Fails to connect to next lower layer.

§

TryAgain = 9

Operation timed out; function must be called again to be completed.

§

IoError = 10

IO failure.

§

BadValue = 11

A parameter has a bad value.

§

NotPermitted = 12

Operation not permitted.

§

InvalidSessions = 13

The TPM command doesn’t use the number of sessions provided by the caller.

§

NoDecryptParam = 14

A session with decrypt set in its SessionAttributes (TPMA_SESSION_DECRYPT bit set) was passed to a TPM command that doesn’t support encryption of the first command parameter.

§

NoEncryptParam = 15

A session with encrypt set in its SessionAttributes (TPMA_SESSION_ENCRYPT bit set) was passed to a TPM command that doesn’t support encryption of the first response parameter.

§

BadSize = 16

If size of a parameter is incorrect.

§

MalformedResponse = 17

Response is malformed.

§

InsufficientContext = 18

Context not large enough.

§

InsufficientResponse = 19

Response is not long enough.

§

IncompatibleTcti = 20

Unknown or unusable TCTI version.

§

NotSupported = 21

Functionality not supported.

§

BadTctiStructure = 22

TCTI context is bad.

§

Memory = 23

Memory allocation failed.

§

BadTr = 24

Invalid ObjectHandle (ESYS_TR handle).

§

MultipleDecryptSessions = 25

More than one session with decrypt set in its SessionAttributes (TPMA_SESSION_DECRYPT bit set).

§

MultipleEncryptSessions = 26

More than one session with encrypt set its SessionAttributes (TPMA_SESSION_ENCRYPT bit set).

§

RspAuthFailed = 27

Authorizing the TPM response failed.

§

NoConfig = 28

No config is available.

§

BadPath = 29

The provided path is bad.

§

NotDeletable = 30

The object is not deletable.

§

PathAlreadyExists = 31

The provided path already exists.

§

KeyNotFound = 32

The key was not found.

§

SignatureVerificationFailed = 33

Signature verification failed.

§

HashMismatch = 34

Hash mismatch.

§

KeyNotDuplicable = 35

Key is not duplicatable.

§

PathNotFound = 36

The path was not found.

§

NoCert = 37

No certificate.

§

NoPcr = 38

No PCR.

§

PcrNotResettable = 39

PCR not resettable.

§

BadTemplate = 40

The template is bad.

§

AuthorizationFailed = 41

Authorization failed.

§

AuthorizationUnknown = 42

Authorization is unknown.

§

NvNotReadable = 43

NV is not readable.

§

NvTooSmall = 44

NV is too small.

§

NvNotWriteable = 45

NV is not writable.

§

PolicyUnknown = 46

The policy is unknown.

§

NvWrongType = 47

The NV type is wrong.

§

NameAlreadyExists = 48

The name already exists.

§

NoTpm = 49

No TPM available.

§

BadKey = 50

The key is bad.

§

NoHandle = 51

No handle provided.

§

NotProvisioned = 52

Provisioning was not executed.

§

AlreadyProvisioned = 53

Already provisioned.

Trait Implementations§

Source§

impl Clone for BaseError

Source§

fn clone(&self) -> BaseError

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for BaseError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<BaseError> for BaseReturnCode

Source§

fn from(base_error: BaseError) -> Self

Converts to this type from the input type.
Source§

impl From<BaseError> for u16

Source§

fn from(tss_base_error: BaseError) -> u16

Converts to this type from the input type.
Source§

impl From<BaseReturnCode> for BaseError

Source§

fn from(base_response_code: BaseReturnCode) -> Self

Converts to this type from the input type.
Source§

impl From<EsapiReturnCode> for BaseError

Source§

fn from(esapi_return_code: EsapiReturnCode) -> Self

Converts to this type from the input type.
Source§

impl From<FapiReturnCode> for BaseError

Source§

fn from(fapi_return_code: FapiReturnCode) -> Self

Converts to this type from the input type.
Source§

impl From<MuapiReturnCode> for BaseError

Source§

fn from(muapi_return_code: MuapiReturnCode) -> Self

Converts to this type from the input type.
Source§

impl From<SapiReturnCode> for BaseError

Source§

fn from(sapi_return_code: SapiReturnCode) -> Self

Converts to this type from the input type.
Source§

impl From<TctiReturnCode> for BaseError

Source§

fn from(tcti_return_code: TctiReturnCode) -> Self

Converts to this type from the input type.
Source§

impl FromPrimitive for BaseError

Source§

fn from_i64(n: i64) -> Option<Self>

Converts an i64 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Source§

fn from_u64(n: u64) -> Option<Self>

Converts an u64 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Source§

fn from_isize(n: isize) -> Option<Self>

Converts an isize to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Source§

fn from_i8(n: i8) -> Option<Self>

Converts an i8 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Source§

fn from_i16(n: i16) -> Option<Self>

Converts an i16 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Source§

fn from_i32(n: i32) -> Option<Self>

Converts an i32 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Source§

fn from_i128(n: i128) -> Option<Self>

Converts an i128 to return an optional value of this type. If the value cannot be represented by this type, then None is returned. Read more
Source§

fn from_usize(n: usize) -> Option<Self>

Converts a usize to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Source§

fn from_u8(n: u8) -> Option<Self>

Converts an u8 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Source§

fn from_u16(n: u16) -> Option<Self>

Converts an u16 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Source§

fn from_u32(n: u32) -> Option<Self>

Converts an u32 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Source§

fn from_u128(n: u128) -> Option<Self>

Converts an u128 to return an optional value of this type. If the value cannot be represented by this type, then None is returned. Read more
Source§

fn from_f32(n: f32) -> Option<Self>

Converts a f32 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Source§

fn from_f64(n: f64) -> Option<Self>

Converts a f64 to return an optional value of this type. If the value cannot be represented by this type, then None is returned. Read more
Source§

impl Hash for BaseError

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for BaseError

Source§

fn eq(&self, other: &BaseError) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl ToPrimitive for BaseError

Source§

fn to_i64(&self) -> Option<i64>

Converts the value of self to an i64. If the value cannot be represented by an i64, then None is returned.
Source§

fn to_u64(&self) -> Option<u64>

Converts the value of self to a u64. If the value cannot be represented by a u64, then None is returned.
Source§

fn to_isize(&self) -> Option<isize>

Converts the value of self to an isize. If the value cannot be represented by an isize, then None is returned.
Source§

fn to_i8(&self) -> Option<i8>

Converts the value of self to an i8. If the value cannot be represented by an i8, then None is returned.
Source§

fn to_i16(&self) -> Option<i16>

Converts the value of self to an i16. If the value cannot be represented by an i16, then None is returned.
Source§

fn to_i32(&self) -> Option<i32>

Converts the value of self to an i32. If the value cannot be represented by an i32, then None is returned.
Source§

fn to_i128(&self) -> Option<i128>

Converts the value of self to an i128. If the value cannot be represented by an i128 (i64 under the default implementation), then None is returned. Read more
Source§

fn to_usize(&self) -> Option<usize>

Converts the value of self to a usize. If the value cannot be represented by a usize, then None is returned.
Source§

fn to_u8(&self) -> Option<u8>

Converts the value of self to a u8. If the value cannot be represented by a u8, then None is returned.
Source§

fn to_u16(&self) -> Option<u16>

Converts the value of self to a u16. If the value cannot be represented by a u16, then None is returned.
Source§

fn to_u32(&self) -> Option<u32>

Converts the value of self to a u32. If the value cannot be represented by a u32, then None is returned.
Source§

fn to_u128(&self) -> Option<u128>

Converts the value of self to a u128. If the value cannot be represented by a u128 (u64 under the default implementation), then None is returned. Read more
Source§

fn to_f32(&self) -> Option<f32>

Converts the value of self to an f32. Overflows may map to positive or negative inifinity, otherwise None is returned if the value cannot be represented by an f32.
Source§

fn to_f64(&self) -> Option<f64>

Converts the value of self to an f64. Overflows may map to positive or negative inifinity, otherwise None is returned if the value cannot be represented by an f64. Read more
Source§

impl TryFrom<BaseError> for EsapiReturnCode

Source§

type Error = Error

The type returned in the event of a conversion error.
Source§

fn try_from(base_error: BaseError) -> Result<Self>

Performs the conversion.
Source§

impl TryFrom<BaseError> for FapiReturnCode

Source§

type Error = Error

The type returned in the event of a conversion error.
Source§

fn try_from(base_error: BaseError) -> Result<Self>

Performs the conversion.
Source§

impl TryFrom<BaseError> for MuapiReturnCode

Source§

type Error = Error

The type returned in the event of a conversion error.
Source§

fn try_from(base_error: BaseError) -> Result<Self>

Performs the conversion.
Source§

impl TryFrom<BaseError> for SapiReturnCode

Source§

type Error = Error

The type returned in the event of a conversion error.
Source§

fn try_from(base_error: BaseError) -> Result<Self>

Performs the conversion.
Source§

impl TryFrom<BaseError> for TctiReturnCode

Source§

type Error = Error

The type returned in the event of a conversion error.
Source§

fn try_from(base_error: BaseError) -> Result<Self>

Performs the conversion.
Source§

impl TryFrom<u16> for BaseError

Source§

type Error = Error

The type returned in the event of a conversion error.
Source§

fn try_from(value: u16) -> Result<BaseError>

Performs the conversion.
Source§

impl Copy for BaseError

Source§

impl Eq for BaseError

Source§

impl StructuralPartialEq for BaseError

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.