common: Fix openpgp_is_curve_supported.

* common/openpgp-oid.c (openpgp_is_curve_supported): Support both of
canonical name of the curve and alias.

--
Only alias (the name for print) was allowed before this change.

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
NIIBE Yutaka 2016-10-24 11:20:14 +09:00
parent acef095164
commit 945e7ab0dd
1 changed files with 2 additions and 2 deletions

View File

@ -424,8 +424,8 @@ openpgp_is_curve_supported (const char *name, int *r_algo)
*r_algo = 0;
for (idx = 0; idx < DIM (oidtable) && oidtable[idx].name; idx++)
{
if (!strcmp (name, (oidtable[idx].alias? oidtable[idx].alias
/**/ : oidtable[idx].name))
if ((!strcmp (name, oidtable[idx].name)
|| (oidtable[idx].alias && !strcmp (name, (oidtable[idx].alias))))
&& curve_supported_p (oidtable[idx].name))
{
if (r_algo)