Skip to content

Commit

Permalink
Merge pull request #73 from DGonzalezVillal/case
Browse files Browse the repository at this point in the history
Fixing case sensitivity bug
  • Loading branch information
DGonzalezVillal authored Sep 11, 2024
2 parents 49494ff + a413042 commit 1c7e697
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- uses: actions-rs/toolchain@v1
with:
components: clippy
toolchain: 1.80
toolchain: 1.80.0
profile: minimal
override: true
- uses: actions-rs/cargo@v1
Expand Down
2 changes: 1 addition & 1 deletion src/certs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ pub fn write_cert(
#[derive(Parser)]
pub struct CertificatesArgs {
/// Specify encoding to use for certificates.
#[arg(value_name = "encoding", required = true)]
#[arg(value_name = "encoding", required = true, ignore_case = true)]
pub encoding: CertFormat,

/// Directory to store certificates in. Required if requesting an extended-report.
Expand Down
10 changes: 5 additions & 5 deletions src/fetch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,19 +115,19 @@ mod cert_authority {
#[derive(Parser)]
pub struct Args {
/// Specify encoding to use for certificates.
#[arg(value_name = "encoding", required = true)]
#[arg(value_name = "encoding", required = true, ignore_case = true)]
pub encoding: CertFormat,

/// Specify the processor model for the certificate chain.
#[arg(value_name = "processor-model", required = true)]
#[arg(value_name = "processor-model", required = true, ignore_case = true)]
pub processor_model: ProcType,

/// Directory to store the certificates in.
#[arg(value_name = "certs-dir", required = true)]
pub certs_dir: PathBuf,

/// Specify which endorsement certificate chain to pull, either VCEK or VLEK.
#[arg(short, long, value_name = "endorser", default_value_t = Endorsement::Vcek)]
#[arg(short, long, value_name = "endorser", default_value_t = Endorsement::Vcek, ignore_case = true)]
pub endorser: Endorsement,
}

Expand Down Expand Up @@ -204,11 +204,11 @@ mod vcek {
#[derive(Parser)]
pub struct Args {
/// Specify encoding to use for certificates.
#[arg(value_name = "encoding", required = true)]
#[arg(value_name = "encoding", required = true, ignore_case = true)]
pub encoding: CertFormat,

/// Specify the processor model for the certificate chain.
#[arg(value_name = "processor-model", required = true)]
#[arg(value_name = "processor-model", required = true, ignore_case = true)]
pub processor_model: ProcType,

/// Directory to store the certificates in.
Expand Down
2 changes: 1 addition & 1 deletion src/key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pub struct KeyArgs {
pub key_path: PathBuf,

/// This is the root key from which to derive the key. Input either VCEK or VMRK.
#[arg(value_name = "root-key-select", required = true)]
#[arg(value_name = "root-key-select", required = true, ignore_case = true)]
pub root_key_select: String,

/// Specify an integer VMPL level between 0 and 3 that the Guest is running on.
Expand Down
23 changes: 18 additions & 5 deletions src/preattestation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ mod measurement {
/// Milan-v1, EPYC-Milan-v2, EPYC-Genoa, EPYC-Genoa-v1)
#[arg(long, value_name = "vcpu-type",
conflicts_with_all = ["vcpu_sig", "vcpu_family", "vcpu_model", "vcpu_stepping"],
required_unless_present_all(["vcpu_sig", "vcpu_family", "vcpu_model", "vcpu_stepping"]))]
required_unless_present_all(["vcpu_sig", "vcpu_family", "vcpu_model", "vcpu_stepping"],
), ignore_case = true)]
pub vcpu_type: Option<String>,

/// Guest vcpu signature value
Expand All @@ -77,7 +78,7 @@ mod measurement {
pub vcpu_stepping: Option<i32>,

/// Type of guest vmm (QEMU, ec2, KRUN)
#[arg(long, short = 't', value_name = "vmm-type")]
#[arg(long, short = 't', value_name = "vmm-type", ignore_case = true)]
pub vmm_type: Option<String>,

/// OVMF file to calculate measurement from
Expand Down Expand Up @@ -110,7 +111,13 @@ mod measurement {
pub ovmf_hash: Option<String>,

///Choose output format (base64, hex).
#[arg(long, short = 'f', value_name = "output-format", default_value = "hex")]
#[arg(
long,
short = 'f',
value_name = "output-format",
default_value = "hex",
ignore_case = true
)]
pub output_format: String,

/// Optional file path where measurement value can be stored in
Expand Down Expand Up @@ -203,7 +210,13 @@ mod ovmf_hash {
pub ovmf: PathBuf,

/// Choose output format (base64, hex). Defaults to hex
#[arg(short = 'f', long, value_name = "output-format", default_value = "hex")]
#[arg(
short = 'f',
long,
value_name = "output-format",
default_value = "hex",
ignore_case = true
)]
pub output_format: String,

/// Optional file where hash value can be stored in
Expand Down Expand Up @@ -261,7 +274,7 @@ mod idblock {
pub launch_digest: String,

/// Family ID of the guest provided by the guest owner. Has to be 16 characters.
#[arg(short, long, value_name = "familiy-id")]
#[arg(short, long, value_name = "family-id")]
pub family_id: Option<String>,

/// Image ID of the guest provided by the guest owner. Has to be 16 characters.
Expand Down

0 comments on commit 1c7e697

Please sign in to comment.