X-Git-Url: https://git.distorted.org.uk/~mdw/catacomb-python/blobdiff_plain/11cb3d97caae1888a6d6ae63ff6e2dea9f7cce01..f368b46e168e8accdb0c578ccbba7e7d2ee8c0de:/pubkey.c diff --git a/pubkey.c b/pubkey.c index 9e50806..735a2c0 100644 --- a/pubkey.c +++ b/pubkey.c @@ -670,7 +670,9 @@ static PyObject *rsaget_rng(PyObject *me, void *hunoz) static int rsaset_rng(PyObject *me, PyObject *val, void *hunoz) { int rc = -1; - if (val != Py_None && !GRAND_PYCHECK(val)) + if (!val) + val = Py_None; + else if (val != Py_None && !GRAND_PYCHECK(val)) TYERR("expected grand or None"); Py_DECREF(RSA_RNG(me)); RSA_RNG(me) = val;