[PATCH] scd: correct length for RSA public key response

Arnaud Fontaine arnaud.fontaine at ssi.gouv.fr
Wed Aug 23 14:53:10 CEST 2017


---
 scd/app-openpgp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scd/app-openpgp.c b/scd/app-openpgp.c
index 365f24649..381a9d747 100644
--- a/scd/app-openpgp.c
+++ b/scd/app-openpgp.c
@@ -944,7 +944,7 @@ determine_rsa_response (app_t app, int keyno)
    size = 2 + 3 /* header */
     + 4 /* tag+len */ + app->app_local->keyattr[keyno].rsa.n_bits/8
-    + 2 /* tag+len */ + app->app_local->keyattr[keyno].rsa.e_bits/8;
+    + 2 /* tag+len */ + (app->app_local->keyattr[keyno].rsa.e_bits + 7)/8;
    return size;
 }
-- 
2.14.1




More information about the Gnupg-devel mailing list