Skip to content

Commit a09b9bb

Browse files
committed
tpm2_rsa(enc/dec)rypt: Report error message on invalid scheme
Fixes #2729 Signed-off-by: Imran Desai <imran.desai@intel.com>
1 parent 77ce6ca commit a09b9bb

2 files changed

Lines changed: 2 additions & 0 deletions

File tree

tools/tpm2_rsadecrypt.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ static bool on_option(char key, char *value) {
9191
ctx.scheme.scheme = tpm2_alg_util_from_optarg(value,
9292
tpm2_alg_util_flags_rsa_scheme);
9393
if (ctx.scheme.scheme == TPM2_ALG_ERROR) {
94+
LOG_ERR("Invalid scheme.");
9495
return false;
9596
}
9697
ctx.scheme.details.oaep.hashAlg = ctx.scheme.scheme == TPM2_ALG_OAEP ?

tools/tpm2_rsaencrypt.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ static bool on_option(char key, char *value) {
6666
ctx.scheme.scheme = tpm2_alg_util_from_optarg(value,
6767
tpm2_alg_util_flags_rsa_scheme);
6868
if (ctx.scheme.scheme == TPM2_ALG_ERROR) {
69+
LOG_ERR("Invalid scheme.");
6970
return false;
7071
}
7172
ctx.scheme.details.oaep.hashAlg = ctx.scheme.scheme == TPM2_ALG_OAEP ?

0 commit comments

Comments
 (0)