From: Mark Wooding Date: Tue, 7 Apr 2020 23:56:01 +0000 (+0100) Subject: Merge branch '1.2.x' into 1.3.x X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/catacomb-python/commitdiff_plain/2a3f4da1c95d71e6045ddf1617754bacddfd46c3 Merge branch '1.2.x' into 1.3.x * 1.2.x: rand.c: More `Py_ssize_t' fixes. --- 2a3f4da1c95d71e6045ddf1617754bacddfd46c3 diff --cc rand.c index b662fd5,641b9bd..841a402 --- a/rand.c +++ b/rand.c @@@ -938,12 -935,12 +938,12 @@@ static PyTypeObject gclatinrand_pytype_ static PyObject *sslprf_pynew(PyTypeObject *ty, PyObject *arg, PyObject *kw) { char *k, *s; - int ksz, ssz; + Py_ssize_t ksz, ssz; const gchash *hco = &md5, *hci = &sha; PyObject *rc = 0; - char *kwlist[] = { "key", "seed", "ohash", "ihash", 0 }; + static const char *const kwlist[] = { "key", "seed", "ohash", "ihash", 0 }; - if (!PyArg_ParseTupleAndKeywords(arg, kw, "s#s#|O&O&:new", kwlist, + if (!PyArg_ParseTupleAndKeywords(arg, kw, "s#s#|O&O&:new", KWLIST, &k, &ksz, &s, &ssz, convgchash, &hco, convgchash, &hci)) goto end; @@@ -955,12 -952,12 +955,12 @@@ end static PyObject *tlsdx_pynew(PyTypeObject *ty, PyObject *arg, PyObject *kw) { char *k, *s; - int ksz, ssz; + Py_ssize_t ksz, ssz; const gcmac *mc = &sha_hmac; PyObject *rc = 0; - char *kwlist[] = { "key", "seed", "mac", 0 }; + static const char *const kwlist[] = { "key", "seed", "mac", 0 }; - if (!PyArg_ParseTupleAndKeywords(arg, kw, "s#s#|O&:new", kwlist, + if (!PyArg_ParseTupleAndKeywords(arg, kw, "s#s#|O&:new", KWLIST, &k, &ksz, &s, &ssz, convgcmac, &mc)) goto end; @@@ -972,12 -969,12 +972,12 @@@ end static PyObject *tlsprf_pynew(PyTypeObject *ty, PyObject *arg, PyObject *kw) { char *k, *s; - int ksz, ssz; + Py_ssize_t ksz, ssz; const gcmac *mcl = &md5_hmac, *mcr = &sha_hmac; PyObject *rc = 0; - char *kwlist[] = { "key", "seed", "lmac", "rmac", 0 }; + static const char *const kwlist[] = { "key", "seed", "lmac", "rmac", 0 }; - if (!PyArg_ParseTupleAndKeywords(arg, kw, "s#s#|O&O&:new", kwlist, + if (!PyArg_ParseTupleAndKeywords(arg, kw, "s#s#|O&O&:new", KWLIST, &k, &ksz, &s, &ssz, convgcmac, &mcl, convgcmac, &mcr)) goto end; @@@ -1138,11 -1132,11 +1138,11 @@@ static PyTypeObject tlsprf_pytype_skel static PyObject *dsarand_pynew(PyTypeObject *ty, PyObject *arg, PyObject *kw) { char *p; - int sz; + Py_ssize_t sz; PyObject *rc = 0; - char *kwlist[] = { "seed", 0 }; + static const char *const kwlist[] = { "seed", 0 }; - if (!PyArg_ParseTupleAndKeywords(arg, kw, "s#:new", kwlist, &p, &sz)) + if (!PyArg_ParseTupleAndKeywords(arg, kw, "s#:new", KWLIST, &p, &sz)) goto end; rc = grand_dopywrap(ty, dsarand_create(p, sz), f_freeme); end: