Skip to content
This repository has been archived by the owner on Jul 29, 2024. It is now read-only.

remove #[derive(Default)] in bitflags data structure #89

Closed
wants to merge 1 commit into from

Conversation

longlongyang
Copy link
Contributor

fix #64

pub struct SpdmOpaqueSupport: u8 {
const OPAQUE_DATA_FMT_DISABLED = 0b0000_0000;
const OPAQUE_DATA_FMT0 = 0b0000_0000;
Copy link
Contributor

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;
Copy link
Contributor

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;
Copy link
Contributor

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;
Copy link
Contributor

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;
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

better remove #[derive(Default)] in bitflags data structure
2 participants