Skip to content

Commit 636e734

Browse files
DGonzalezVillallarrydewey
authored andcommitted
Merge pull request #73 from DGonzalezVillal/case
Fixing case sensitivity bug
2 parents 49494ff + a413042 commit 636e734

File tree

6 files changed

+27
-14
lines changed

6 files changed

+27
-14
lines changed

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
- uses: actions-rs/toolchain@v1
2727
with:
2828
components: clippy
29-
toolchain: 1.80
29+
toolchain: 1.80.0
3030
profile: minimal
3131
override: true
3232
- uses: actions-rs/cargo@v1

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "snpguest"
3-
version = "0.7.0"
3+
version = "0.7.1"
44
authors = ["The VirTEE Project Developers"]
55
edition = "2021"
66
license = "Apache-2.0"

src/certs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ pub fn write_cert(
168168
#[derive(Parser)]
169169
pub struct CertificatesArgs {
170170
/// Specify encoding to use for certificates.
171-
#[arg(value_name = "encoding", required = true)]
171+
#[arg(value_name = "encoding", required = true, ignore_case = true)]
172172
pub encoding: CertFormat,
173173

174174
/// Directory to store certificates in. Required if requesting an extended-report.

src/fetch.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,19 +115,19 @@ mod cert_authority {
115115
#[derive(Parser)]
116116
pub struct Args {
117117
/// Specify encoding to use for certificates.
118-
#[arg(value_name = "encoding", required = true)]
118+
#[arg(value_name = "encoding", required = true, ignore_case = true)]
119119
pub encoding: CertFormat,
120120

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

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

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

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

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

214214
/// Directory to store the certificates in.

src/key.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ pub struct KeyArgs {
1313
pub key_path: PathBuf,
1414

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

1919
/// Specify an integer VMPL level between 0 and 3 that the Guest is running on.

src/preattestation.rs

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ mod measurement {
5757
/// Milan-v1, EPYC-Milan-v2, EPYC-Genoa, EPYC-Genoa-v1)
5858
#[arg(long, value_name = "vcpu-type",
5959
conflicts_with_all = ["vcpu_sig", "vcpu_family", "vcpu_model", "vcpu_stepping"],
60-
required_unless_present_all(["vcpu_sig", "vcpu_family", "vcpu_model", "vcpu_stepping"]))]
60+
required_unless_present_all(["vcpu_sig", "vcpu_family", "vcpu_model", "vcpu_stepping"],
61+
), ignore_case = true)]
6162
pub vcpu_type: Option<String>,
6263

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

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

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

112113
///Choose output format (base64, hex).
113-
#[arg(long, short = 'f', value_name = "output-format", default_value = "hex")]
114+
#[arg(
115+
long,
116+
short = 'f',
117+
value_name = "output-format",
118+
default_value = "hex",
119+
ignore_case = true
120+
)]
114121
pub output_format: String,
115122

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

205212
/// Choose output format (base64, hex). Defaults to hex
206-
#[arg(short = 'f', long, value_name = "output-format", default_value = "hex")]
213+
#[arg(
214+
short = 'f',
215+
long,
216+
value_name = "output-format",
217+
default_value = "hex",
218+
ignore_case = true
219+
)]
207220
pub output_format: String,
208221

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

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

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

0 commit comments

Comments
 (0)