internal authenticate input check
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
2012-06-07 Niibe Yutaka <gniibe@fsij.org>
|
||||
|
||||
* src/openpgp.c (cmd_internal_authenticate): Add check for input
|
||||
length.
|
||||
|
||||
Implement key generation.
|
||||
* src/openpgp.c (cmd_pgp_gakp): Call gpg_do_keygen.
|
||||
* src/openpgp-do.c (proc_key_import): Call with modulus = NULL.
|
||||
|
||||
@@ -744,6 +744,8 @@ cmd_pso (void)
|
||||
DEBUG_INFO ("PSO done.\r\n");
|
||||
}
|
||||
|
||||
|
||||
#define MAX_DIGEST_INFO_LEN 102 /* 40% */
|
||||
static void
|
||||
cmd_internal_authenticate (void)
|
||||
{
|
||||
@@ -763,6 +765,13 @@ cmd_internal_authenticate (void)
|
||||
return;
|
||||
}
|
||||
|
||||
if (len > MAX_DIGEST_INFO_LEN)
|
||||
{
|
||||
DEBUG_INFO ("input is too long.");
|
||||
GPG_CONDITION_NOT_SATISFIED ();
|
||||
return;
|
||||
}
|
||||
|
||||
r = rsa_sign (apdu.cmd_apdu_data, res_APDU, len,
|
||||
&kd[GPG_KEY_FOR_AUTHENTICATION]);
|
||||
if (r < 0)
|
||||
|
||||
Reference in New Issue
Block a user