diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2012-06-27 23:45:48 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2012-06-27 23:45:48 (GMT) |
commit | 591c1cca325af53db16b302fac212107d5500ec9 (patch) | |
tree | b99a12f4c81add2fbd35350377b7f844feb28387 /Modules/posixmodule.c | |
parent | 8afc243a767327af8874cfee11a8341d254316aa (diff) | |
download | cpython-591c1cca325af53db16b302fac212107d5500ec9.zip cpython-591c1cca325af53db16b302fac212107d5500ec9.tar.gz cpython-591c1cca325af53db16b302fac212107d5500ec9.tar.bz2 |
Remove dead code
os.urandom() has now one unique implementation, posix_urandom() which
calls _PyOS_URandom(). _PyOS_URandom() uses RAND_pseudo_bytes() on VMS.
Diffstat (limited to 'Modules/posixmodule.c')
-rw-r--r-- | Modules/posixmodule.c | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 82626a8..1bd5e97 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -10344,42 +10344,6 @@ device_encoding(PyObject *self, PyObject *args) return _Py_device_encoding(fd); } -#ifdef __VMS -/* Use openssl random routine */ -#include <openssl/rand.h> -PyDoc_STRVAR(vms_urandom__doc__, -"urandom(n) -> str\n\n\ -Return n random bytes suitable for cryptographic use."); - -static PyObject* -vms_urandom(PyObject *self, PyObject *args) -{ - int howMany; - PyObject* result; - - /* Read arguments */ - if (! PyArg_ParseTuple(args, "i:urandom", &howMany)) - return NULL; - if (howMany < 0) - return PyErr_Format(PyExc_ValueError, - "negative argument not allowed"); - - /* Allocate bytes */ - result = PyBytes_FromStringAndSize(NULL, howMany); - if (result != NULL) { - /* Get random data */ - if (RAND_pseudo_bytes((unsigned char*) - PyBytes_AS_STRING(result), - howMany) < 0) { - Py_DECREF(result); - return PyErr_Format(PyExc_ValueError, - "RAND_pseudo_bytes"); - } - } - return result; -} -#endif - #ifdef HAVE_SETRESUID PyDoc_STRVAR(posix_setresuid__doc__, "setresuid(ruid, euid, suid)\n\n\ |