-
Notifications
You must be signed in to change notification settings - Fork 8
remove #[derive(Default)] in bitflags data structure #89
Conversation
fix intel#64 Signed-off-by: Yang, Longlong <[email protected]>
pub struct SpdmOpaqueSupport: u8 { | ||
const OPAQUE_DATA_FMT_DISABLED = 0b0000_0000; | ||
const OPAQUE_DATA_FMT0 = 0b0000_0000; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it should be 1.
@@ -8,12 +8,17 @@ use crate::{common, error::SpdmStatus}; | |||
use codec::{Codec, Reader, Writer}; | |||
|
|||
bitflags! { | |||
#[derive(Default)] | |||
pub struct SpdmEndSessionRequestAttributes: u8 { | |||
const PRESERVE_NEGOTIATED_STATE = 0b00000001; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
0 should be supported.
@@ -11,12 +11,17 @@ use crate::protocol::{ | |||
use codec::{Codec, Reader, Writer}; | |||
|
|||
bitflags! { | |||
#[derive(Default)] | |||
pub struct SpdmFinishRequestAttributes: u8 { | |||
const SIGNATURE_INCLUDED = 0b00000001; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
0 should be supported
@@ -18,13 +18,18 @@ pub const MEASUREMENT_RESPONDER_PARAM2_SLOT_ID_MASK: u8 = 0b0000_1111; | |||
pub const MEASUREMENT_RESPONDER_PARAM2_CONTENT_CHANGED_MASK: u8 = 0b0011_0000; | |||
|
|||
bitflags! { | |||
#[derive(Default)] | |||
pub struct SpdmMeasurementAttributes: u8 { | |||
const SIGNATURE_REQUESTED = 0b00000001; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
0 should be supported.
@@ -54,13 +54,18 @@ pub const SPDM_MAX_AEAD_IV_SIZE: usize = 12; | |||
pub const SPDM_MAX_HKDF_OKM_SIZE: usize = SPDM_MAX_HASH_SIZE; | |||
|
|||
bitflags! { | |||
#[derive(Default)] | |||
pub struct SpdmMeasurementSpecification: u8 { | |||
const DMTF = 0b0000_0001; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
0 is supported.
@@ -100,6 +104,12 @@ bitflags! { | |||
} | |||
} | |||
|
|||
impl Default for SpdmResponseCapabilityFlags { | |||
fn default() -> Self { | |||
Self::VALID_MASK |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dont think MASK should be default.
@@ -38,6 +37,12 @@ bitflags! { | |||
} | |||
} | |||
|
|||
impl Default for SpdmRequestCapabilityFlags { | |||
fn default() -> Self { | |||
Self::VALID_MASK |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dont think MASK should be default.
fix #64