fix cancellation

This commit is contained in:
NIIBE Yutaka
2015-09-10 14:14:37 +09:00
parent d0e7aad11e
commit 115a7ba67a
5 changed files with 180 additions and 14 deletions

View File

@@ -25,7 +25,6 @@
#include <stdint.h>
#include <string.h>
#include <stdlib.h>
#include <chopstx.h>
#include "config.h"
@@ -2060,10 +2059,7 @@ gpg_do_keygen (uint8_t kk_byte)
if (attr == ALGO_RSA2K || attr == ALGO_RSA4K)
{
int cs = chopstx_setcancelstate (0); /* Allow cancellation. */
/* XXX: We need to free up the allocated memory on cancellation. */
p_q_modulus = rsa_genkey (prvkey_len);
chopstx_setcancelstate (cs);
if (p_q_modulus == NULL)
{
GPG_MEMORY_FAILURE ();