chiark / gitweb /
key: Fixing of expiry and deletion time properties.
[catacomb-python] / pubkey.c
index 9e5080671cb3aae03482b926ce828e944dbc9bea..735a2c01d771a80fe83ce3830e5f5065d2ca6ac4 100644 (file)
--- 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;