scd: Fix for X448.

* scd/app-openpgp.c (do_decipher): Support with no prefix.

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
NIIBE Yutaka 2021-03-08 16:23:26 +09:00
parent 8c41b8aac3
commit fc99f77b14
1 changed files with 2 additions and 0 deletions

View File

@ -5537,6 +5537,8 @@ do_decipher (app_t app, ctrl_t ctrl, const char *keyidstr,
if (app->app_local->keyattr[1].ecc.flags & ECC_FLAG_DJB_TWEAK)
prefix = 0x40;
else if (*outdatalen == 56) /* It's X448 with no prefix. */
;
else if ((*outdatalen % 2) == 0) /* No 0x04 -> x-coordinate only */
prefix = 0x41;