X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/catacomb-python/blobdiff_plain/a42955d587b9ed267aa9a22d5b68f89b4d88beb5..930d78e3e2045f6f810c73edd81f44321b039ea5:/pubkey.c diff --git a/pubkey.c b/pubkey.c index 44454df..77f0b93 100644 --- a/pubkey.c +++ b/pubkey.c @@ -733,10 +733,12 @@ static PyObject *meth__RSAPriv_generate(PyObject *me, unsigned n = 0; rsa_priv rp; mp *e = 0; - pgev evt = { 0 }; + struct excinfo exc = EXCINFO_INIT; + pypgev evt = { { 0 } }; char *kwlist[] = { "class", "nbits", "event", "rng", "nsteps", "e", 0 }; PyObject *rc = 0; + evt.exc = &exc; if (!PyArg_ParseTupleAndKeywords(arg, kw, "OO&|O&O&O&O&:generate", kwlist, &me, convuint, &nbits, convpgev, &evt, convgrand, &r, convuint, &n, @@ -744,8 +746,8 @@ static PyObject *meth__RSAPriv_generate(PyObject *me, goto end; if (e) MP_COPY(e); else e = mp_fromulong(MP_NEW, 65537); - if (rsa_gen_e(&rp, nbits, e, r, n, evt.proc, evt.ctx)) - PGENERR; + if (rsa_gen_e(&rp, nbits, e, r, n, evt.ev.proc, evt.ev.ctx)) + PGENERR(&exc); rc = rsapriv_pywrap(&rp); end: droppgev(&evt);