return error sooner for decryption

This commit is contained in:
NIIBE Yutaka 2012-07-09 09:29:00 +09:00
parent 29b68186bf
commit 51435e7dba
2 changed files with 12 additions and 4 deletions

View File

@ -1,5 +1,8 @@
2012-07-09 Niibe Yutaka <gniibe@fsij.org>
* src/openpgp.c (cmd_pso): For decryption, return error sooner for
invalid data.
* tool/stlinkv2.py (stlinkv2.setup_gpio): Fix GPIOB_CRL.
* test/rsa_keys.py (integer_to_bytes_256): Rename from

View File

@ -776,11 +776,16 @@ cmd_pso (void)
/* Skip padding 0x00 */
len--;
if (len != KEY_CONTENT_LEN)
GPG_CONDITION_NOT_SATISFIED ();
else
{
r = rsa_decrypt (apdu.cmd_apdu_data+1, res_APDU, len,
&kd[GPG_KEY_FOR_DECRYPTION]);
if (r < 0)
GPG_ERROR ();
}
}
else
{
DEBUG_INFO (" - ??");