Skip to content

Commit

Permalink
ePass: Do not return positive exit code when the digest is not supported
Browse files Browse the repository at this point in the history
The code paths for the ECDSA signatures provide SHA1 and SHA256 padding.
Any other padding should return an error as unsopported operation, but
given that the variable r was reused for some temporary calculation
it returned positive value, which was handled by the calling code as
a success.

Moreover, the calling code in use_key() function skipped the key operation
with this return value causing returning the uninitialized memory to the
calling process.
  • Loading branch information
Jakuje committed Oct 8, 2023
1 parent c3b1af0 commit 3844602
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/libopensc/card-epass2003.c
Original file line number Diff line number Diff line change
Expand Up @@ -2204,6 +2204,7 @@ epass2003_set_security_env(struct sc_card *card, const sc_security_env_t * env,
}
else
{
r = SC_ERROR_NOT_SUPPORTED;
sc_log(card->ctx, "%0x Alg Not Support! ", env->algorithm_flags);
goto err;
}
Expand Down

0 comments on commit 3844602

Please sign in to comment.