diff options
author | shadchin <shadchin@yandex-team.ru> | 2022-02-10 16:44:30 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:44:30 +0300 |
commit | 2598ef1d0aee359b4b6d5fdd1758916d5907d04f (patch) | |
tree | 012bb94d777798f1f56ac1cec429509766d05181 /contrib/tools/python3/src/Modules/clinic/_ssl.c.h | |
parent | 6751af0b0c1b952fede40b19b71da8025b5d8bcf (diff) | |
download | ydb-2598ef1d0aee359b4b6d5fdd1758916d5907d04f.tar.gz |
Restoring authorship annotation for <shadchin@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/tools/python3/src/Modules/clinic/_ssl.c.h')
-rw-r--r-- | contrib/tools/python3/src/Modules/clinic/_ssl.c.h | 706 |
1 files changed, 353 insertions, 353 deletions
diff --git a/contrib/tools/python3/src/Modules/clinic/_ssl.c.h b/contrib/tools/python3/src/Modules/clinic/_ssl.c.h index ce8669ae21..15fe9201fe 100644 --- a/contrib/tools/python3/src/Modules/clinic/_ssl.c.h +++ b/contrib/tools/python3/src/Modules/clinic/_ssl.c.h @@ -36,7 +36,7 @@ _ssl__test_decode_cert(PyObject *module, PyObject *arg) PyObject *return_value = NULL; PyObject *path; - if (!PyUnicode_FSConverter(arg, &path)) { + if (!PyUnicode_FSConverter(arg, &path)) { goto exit; } return_value = _ssl__test_decode_cert_impl(module, path); @@ -60,7 +60,7 @@ PyDoc_STRVAR(_ssl__SSLSocket_getpeercert__doc__, "return the certificate even if it wasn\'t validated."); #define _SSL__SSLSOCKET_GETPEERCERT_METHODDEF \ - {"getpeercert", (PyCFunction)(void(*)(void))_ssl__SSLSocket_getpeercert, METH_FASTCALL, _ssl__SSLSocket_getpeercert__doc__}, + {"getpeercert", (PyCFunction)(void(*)(void))_ssl__SSLSocket_getpeercert, METH_FASTCALL, _ssl__SSLSocket_getpeercert__doc__}, static PyObject * _ssl__SSLSocket_getpeercert_impl(PySSLSocket *self, int binary_mode); @@ -71,17 +71,17 @@ _ssl__SSLSocket_getpeercert(PySSLSocket *self, PyObject *const *args, Py_ssize_t PyObject *return_value = NULL; int binary_mode = 0; - if (!_PyArg_CheckPositional("getpeercert", nargs, 0, 1)) { + if (!_PyArg_CheckPositional("getpeercert", nargs, 0, 1)) { goto exit; } - if (nargs < 1) { - goto skip_optional; - } - binary_mode = PyObject_IsTrue(args[0]); - if (binary_mode < 0) { - goto exit; - } -skip_optional: + if (nargs < 1) { + goto skip_optional; + } + binary_mode = PyObject_IsTrue(args[0]); + if (binary_mode < 0) { + goto exit; + } +skip_optional: return_value = _ssl__SSLSocket_getpeercert_impl(self, binary_mode); exit: @@ -218,13 +218,13 @@ _ssl__SSLSocket_write(PySSLSocket *self, PyObject *arg) PyObject *return_value = NULL; Py_buffer b = {NULL, NULL}; - if (PyObject_GetBuffer(arg, &b, PyBUF_SIMPLE) != 0) { - goto exit; - } - if (!PyBuffer_IsContiguous(&b, 'C')) { - _PyArg_BadArgument("write", "argument", "contiguous buffer", arg); + if (PyObject_GetBuffer(arg, &b, PyBUF_SIMPLE) != 0) { goto exit; } + if (!PyBuffer_IsContiguous(&b, 'C')) { + _PyArg_BadArgument("write", "argument", "contiguous buffer", arg); + goto exit; + } return_value = _ssl__SSLSocket_write_impl(self, &b); exit: @@ -329,7 +329,7 @@ PyDoc_STRVAR(_ssl__SSLSocket_get_channel_binding__doc__, "Only \'tls-unique\' channel binding data from RFC 5929 is supported."); #define _SSL__SSLSOCKET_GET_CHANNEL_BINDING_METHODDEF \ - {"get_channel_binding", (PyCFunction)(void(*)(void))_ssl__SSLSocket_get_channel_binding, METH_FASTCALL|METH_KEYWORDS, _ssl__SSLSocket_get_channel_binding__doc__}, + {"get_channel_binding", (PyCFunction)(void(*)(void))_ssl__SSLSocket_get_channel_binding, METH_FASTCALL|METH_KEYWORDS, _ssl__SSLSocket_get_channel_binding__doc__}, static PyObject * _ssl__SSLSocket_get_channel_binding_impl(PySSLSocket *self, @@ -340,32 +340,32 @@ _ssl__SSLSocket_get_channel_binding(PySSLSocket *self, PyObject *const *args, Py { PyObject *return_value = NULL; static const char * const _keywords[] = {"cb_type", NULL}; - static _PyArg_Parser _parser = {NULL, _keywords, "get_channel_binding", 0}; - PyObject *argsbuf[1]; - Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0; + static _PyArg_Parser _parser = {NULL, _keywords, "get_channel_binding", 0}; + PyObject *argsbuf[1]; + Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0; const char *cb_type = "tls-unique"; - args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 1, 0, argsbuf); - if (!args) { - goto exit; - } - if (!noptargs) { - goto skip_optional_pos; - } - if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("get_channel_binding", "argument 'cb_type'", "str", args[0]); - goto exit; - } - Py_ssize_t cb_type_length; - cb_type = PyUnicode_AsUTF8AndSize(args[0], &cb_type_length); - if (cb_type == NULL) { - goto exit; - } - if (strlen(cb_type) != (size_t)cb_type_length) { - PyErr_SetString(PyExc_ValueError, "embedded null character"); + args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 1, 0, argsbuf); + if (!args) { goto exit; } -skip_optional_pos: + if (!noptargs) { + goto skip_optional_pos; + } + if (!PyUnicode_Check(args[0])) { + _PyArg_BadArgument("get_channel_binding", "argument 'cb_type'", "str", args[0]); + goto exit; + } + Py_ssize_t cb_type_length; + cb_type = PyUnicode_AsUTF8AndSize(args[0], &cb_type_length); + if (cb_type == NULL) { + goto exit; + } + if (strlen(cb_type) != (size_t)cb_type_length) { + PyErr_SetString(PyExc_ValueError, "embedded null character"); + goto exit; + } +skip_optional_pos: return_value = _ssl__SSLSocket_get_channel_binding_impl(self, cb_type); exit: @@ -403,18 +403,18 @@ _ssl__SSLContext(PyTypeObject *type, PyObject *args, PyObject *kwargs) !_PyArg_NoKeywords("_SSLContext", kwargs)) { goto exit; } - if (!_PyArg_CheckPositional("_SSLContext", PyTuple_GET_SIZE(args), 1, 1)) { - goto exit; - } - if (PyFloat_Check(PyTuple_GET_ITEM(args, 0))) { - PyErr_SetString(PyExc_TypeError, - "integer argument expected, got float" ); - goto exit; - } - proto_version = _PyLong_AsInt(PyTuple_GET_ITEM(args, 0)); - if (proto_version == -1 && PyErr_Occurred()) { + if (!_PyArg_CheckPositional("_SSLContext", PyTuple_GET_SIZE(args), 1, 1)) { goto exit; } + if (PyFloat_Check(PyTuple_GET_ITEM(args, 0))) { + PyErr_SetString(PyExc_TypeError, + "integer argument expected, got float" ); + goto exit; + } + proto_version = _PyLong_AsInt(PyTuple_GET_ITEM(args, 0)); + if (proto_version == -1 && PyErr_Occurred()) { + goto exit; + } return_value = _ssl__SSLContext_impl(type, proto_version); exit: @@ -438,19 +438,19 @@ _ssl__SSLContext_set_ciphers(PySSLContext *self, PyObject *arg) PyObject *return_value = NULL; const char *cipherlist; - if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("set_ciphers", "argument", "str", arg); - goto exit; - } - Py_ssize_t cipherlist_length; - cipherlist = PyUnicode_AsUTF8AndSize(arg, &cipherlist_length); - if (cipherlist == NULL) { - goto exit; - } - if (strlen(cipherlist) != (size_t)cipherlist_length) { - PyErr_SetString(PyExc_ValueError, "embedded null character"); + if (!PyUnicode_Check(arg)) { + _PyArg_BadArgument("set_ciphers", "argument", "str", arg); goto exit; } + Py_ssize_t cipherlist_length; + cipherlist = PyUnicode_AsUTF8AndSize(arg, &cipherlist_length); + if (cipherlist == NULL) { + goto exit; + } + if (strlen(cipherlist) != (size_t)cipherlist_length) { + PyErr_SetString(PyExc_ValueError, "embedded null character"); + goto exit; + } return_value = _ssl__SSLContext_set_ciphers_impl(self, cipherlist); exit: @@ -496,13 +496,13 @@ _ssl__SSLContext__set_npn_protocols(PySSLContext *self, PyObject *arg) PyObject *return_value = NULL; Py_buffer protos = {NULL, NULL}; - if (PyObject_GetBuffer(arg, &protos, PyBUF_SIMPLE) != 0) { - goto exit; - } - if (!PyBuffer_IsContiguous(&protos, 'C')) { - _PyArg_BadArgument("_set_npn_protocols", "argument", "contiguous buffer", arg); + if (PyObject_GetBuffer(arg, &protos, PyBUF_SIMPLE) != 0) { goto exit; } + if (!PyBuffer_IsContiguous(&protos, 'C')) { + _PyArg_BadArgument("_set_npn_protocols", "argument", "contiguous buffer", arg); + goto exit; + } return_value = _ssl__SSLContext__set_npn_protocols_impl(self, &protos); exit: @@ -532,13 +532,13 @@ _ssl__SSLContext__set_alpn_protocols(PySSLContext *self, PyObject *arg) PyObject *return_value = NULL; Py_buffer protos = {NULL, NULL}; - if (PyObject_GetBuffer(arg, &protos, PyBUF_SIMPLE) != 0) { - goto exit; - } - if (!PyBuffer_IsContiguous(&protos, 'C')) { - _PyArg_BadArgument("_set_alpn_protocols", "argument", "contiguous buffer", arg); + if (PyObject_GetBuffer(arg, &protos, PyBUF_SIMPLE) != 0) { goto exit; } + if (!PyBuffer_IsContiguous(&protos, 'C')) { + _PyArg_BadArgument("_set_alpn_protocols", "argument", "contiguous buffer", arg); + goto exit; + } return_value = _ssl__SSLContext__set_alpn_protocols_impl(self, &protos); exit: @@ -556,7 +556,7 @@ PyDoc_STRVAR(_ssl__SSLContext_load_cert_chain__doc__, "\n"); #define _SSL__SSLCONTEXT_LOAD_CERT_CHAIN_METHODDEF \ - {"load_cert_chain", (PyCFunction)(void(*)(void))_ssl__SSLContext_load_cert_chain, METH_FASTCALL|METH_KEYWORDS, _ssl__SSLContext_load_cert_chain__doc__}, + {"load_cert_chain", (PyCFunction)(void(*)(void))_ssl__SSLContext_load_cert_chain, METH_FASTCALL|METH_KEYWORDS, _ssl__SSLContext_load_cert_chain__doc__}, static PyObject * _ssl__SSLContext_load_cert_chain_impl(PySSLContext *self, PyObject *certfile, @@ -567,29 +567,29 @@ _ssl__SSLContext_load_cert_chain(PySSLContext *self, PyObject *const *args, Py_s { PyObject *return_value = NULL; static const char * const _keywords[] = {"certfile", "keyfile", "password", NULL}; - static _PyArg_Parser _parser = {NULL, _keywords, "load_cert_chain", 0}; - PyObject *argsbuf[3]; - Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1; + static _PyArg_Parser _parser = {NULL, _keywords, "load_cert_chain", 0}; + PyObject *argsbuf[3]; + Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1; PyObject *certfile; - PyObject *keyfile = Py_None; - PyObject *password = Py_None; + PyObject *keyfile = Py_None; + PyObject *password = Py_None; - args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 3, 0, argsbuf); - if (!args) { + args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 3, 0, argsbuf); + if (!args) { goto exit; } - certfile = args[0]; - if (!noptargs) { - goto skip_optional_pos; - } - if (args[1]) { - keyfile = args[1]; - if (!--noptargs) { - goto skip_optional_pos; - } - } - password = args[2]; -skip_optional_pos: + certfile = args[0]; + if (!noptargs) { + goto skip_optional_pos; + } + if (args[1]) { + keyfile = args[1]; + if (!--noptargs) { + goto skip_optional_pos; + } + } + password = args[2]; +skip_optional_pos: return_value = _ssl__SSLContext_load_cert_chain_impl(self, certfile, keyfile, password); exit: @@ -602,7 +602,7 @@ PyDoc_STRVAR(_ssl__SSLContext_load_verify_locations__doc__, "\n"); #define _SSL__SSLCONTEXT_LOAD_VERIFY_LOCATIONS_METHODDEF \ - {"load_verify_locations", (PyCFunction)(void(*)(void))_ssl__SSLContext_load_verify_locations, METH_FASTCALL|METH_KEYWORDS, _ssl__SSLContext_load_verify_locations__doc__}, + {"load_verify_locations", (PyCFunction)(void(*)(void))_ssl__SSLContext_load_verify_locations, METH_FASTCALL|METH_KEYWORDS, _ssl__SSLContext_load_verify_locations__doc__}, static PyObject * _ssl__SSLContext_load_verify_locations_impl(PySSLContext *self, @@ -615,34 +615,34 @@ _ssl__SSLContext_load_verify_locations(PySSLContext *self, PyObject *const *args { PyObject *return_value = NULL; static const char * const _keywords[] = {"cafile", "capath", "cadata", NULL}; - static _PyArg_Parser _parser = {NULL, _keywords, "load_verify_locations", 0}; - PyObject *argsbuf[3]; - Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0; - PyObject *cafile = Py_None; - PyObject *capath = Py_None; - PyObject *cadata = Py_None; - - args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 3, 0, argsbuf); - if (!args) { + static _PyArg_Parser _parser = {NULL, _keywords, "load_verify_locations", 0}; + PyObject *argsbuf[3]; + Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0; + PyObject *cafile = Py_None; + PyObject *capath = Py_None; + PyObject *cadata = Py_None; + + args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 3, 0, argsbuf); + if (!args) { goto exit; } - if (!noptargs) { - goto skip_optional_pos; - } - if (args[0]) { - cafile = args[0]; - if (!--noptargs) { - goto skip_optional_pos; - } - } - if (args[1]) { - capath = args[1]; - if (!--noptargs) { - goto skip_optional_pos; - } - } - cadata = args[2]; -skip_optional_pos: + if (!noptargs) { + goto skip_optional_pos; + } + if (args[0]) { + cafile = args[0]; + if (!--noptargs) { + goto skip_optional_pos; + } + } + if (args[1]) { + capath = args[1]; + if (!--noptargs) { + goto skip_optional_pos; + } + } + cadata = args[2]; +skip_optional_pos: return_value = _ssl__SSLContext_load_verify_locations_impl(self, cafile, capath, cadata); exit: @@ -664,7 +664,7 @@ PyDoc_STRVAR(_ssl__SSLContext__wrap_socket__doc__, "\n"); #define _SSL__SSLCONTEXT__WRAP_SOCKET_METHODDEF \ - {"_wrap_socket", (PyCFunction)(void(*)(void))_ssl__SSLContext__wrap_socket, METH_FASTCALL|METH_KEYWORDS, _ssl__SSLContext__wrap_socket__doc__}, + {"_wrap_socket", (PyCFunction)(void(*)(void))_ssl__SSLContext__wrap_socket, METH_FASTCALL|METH_KEYWORDS, _ssl__SSLContext__wrap_socket__doc__}, static PyObject * _ssl__SSLContext__wrap_socket_impl(PySSLContext *self, PyObject *sock, @@ -676,54 +676,54 @@ _ssl__SSLContext__wrap_socket(PySSLContext *self, PyObject *const *args, Py_ssiz { PyObject *return_value = NULL; static const char * const _keywords[] = {"sock", "server_side", "server_hostname", "owner", "session", NULL}; - static _PyArg_Parser _parser = {NULL, _keywords, "_wrap_socket", 0}; - PyObject *argsbuf[5]; - Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 2; + static _PyArg_Parser _parser = {NULL, _keywords, "_wrap_socket", 0}; + PyObject *argsbuf[5]; + Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 2; PyObject *sock; int server_side; PyObject *hostname_obj = Py_None; PyObject *owner = Py_None; PyObject *session = Py_None; - args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 2, 3, 0, argsbuf); - if (!args) { - goto exit; - } - if (!PyObject_TypeCheck(args[0], PySocketModule.Sock_Type)) { - _PyArg_BadArgument("_wrap_socket", "argument 'sock'", (PySocketModule.Sock_Type)->tp_name, args[0]); - goto exit; - } - sock = args[0]; - if (PyFloat_Check(args[1])) { - PyErr_SetString(PyExc_TypeError, - "integer argument expected, got float" ); + args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 2, 3, 0, argsbuf); + if (!args) { goto exit; } - server_side = _PyLong_AsInt(args[1]); - if (server_side == -1 && PyErr_Occurred()) { - goto exit; - } - if (!noptargs) { - goto skip_optional_pos; - } - if (args[2]) { - hostname_obj = args[2]; - if (!--noptargs) { - goto skip_optional_pos; - } - } -skip_optional_pos: - if (!noptargs) { - goto skip_optional_kwonly; - } - if (args[3]) { - owner = args[3]; - if (!--noptargs) { - goto skip_optional_kwonly; - } - } - session = args[4]; -skip_optional_kwonly: + if (!PyObject_TypeCheck(args[0], PySocketModule.Sock_Type)) { + _PyArg_BadArgument("_wrap_socket", "argument 'sock'", (PySocketModule.Sock_Type)->tp_name, args[0]); + goto exit; + } + sock = args[0]; + if (PyFloat_Check(args[1])) { + PyErr_SetString(PyExc_TypeError, + "integer argument expected, got float" ); + goto exit; + } + server_side = _PyLong_AsInt(args[1]); + if (server_side == -1 && PyErr_Occurred()) { + goto exit; + } + if (!noptargs) { + goto skip_optional_pos; + } + if (args[2]) { + hostname_obj = args[2]; + if (!--noptargs) { + goto skip_optional_pos; + } + } +skip_optional_pos: + if (!noptargs) { + goto skip_optional_kwonly; + } + if (args[3]) { + owner = args[3]; + if (!--noptargs) { + goto skip_optional_kwonly; + } + } + session = args[4]; +skip_optional_kwonly: return_value = _ssl__SSLContext__wrap_socket_impl(self, sock, server_side, hostname_obj, owner, session); exit: @@ -737,7 +737,7 @@ PyDoc_STRVAR(_ssl__SSLContext__wrap_bio__doc__, "\n"); #define _SSL__SSLCONTEXT__WRAP_BIO_METHODDEF \ - {"_wrap_bio", (PyCFunction)(void(*)(void))_ssl__SSLContext__wrap_bio, METH_FASTCALL|METH_KEYWORDS, _ssl__SSLContext__wrap_bio__doc__}, + {"_wrap_bio", (PyCFunction)(void(*)(void))_ssl__SSLContext__wrap_bio, METH_FASTCALL|METH_KEYWORDS, _ssl__SSLContext__wrap_bio__doc__}, static PyObject * _ssl__SSLContext__wrap_bio_impl(PySSLContext *self, PySSLMemoryBIO *incoming, @@ -750,9 +750,9 @@ _ssl__SSLContext__wrap_bio(PySSLContext *self, PyObject *const *args, Py_ssize_t { PyObject *return_value = NULL; static const char * const _keywords[] = {"incoming", "outgoing", "server_side", "server_hostname", "owner", "session", NULL}; - static _PyArg_Parser _parser = {NULL, _keywords, "_wrap_bio", 0}; - PyObject *argsbuf[6]; - Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 3; + static _PyArg_Parser _parser = {NULL, _keywords, "_wrap_bio", 0}; + PyObject *argsbuf[6]; + Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 3; PySSLMemoryBIO *incoming; PySSLMemoryBIO *outgoing; int server_side; @@ -760,50 +760,50 @@ _ssl__SSLContext__wrap_bio(PySSLContext *self, PyObject *const *args, Py_ssize_t PyObject *owner = Py_None; PyObject *session = Py_None; - args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 3, 4, 0, argsbuf); - if (!args) { - goto exit; - } - if (!PyObject_TypeCheck(args[0], &PySSLMemoryBIO_Type)) { - _PyArg_BadArgument("_wrap_bio", "argument 'incoming'", (&PySSLMemoryBIO_Type)->tp_name, args[0]); - goto exit; - } - incoming = (PySSLMemoryBIO *)args[0]; - if (!PyObject_TypeCheck(args[1], &PySSLMemoryBIO_Type)) { - _PyArg_BadArgument("_wrap_bio", "argument 'outgoing'", (&PySSLMemoryBIO_Type)->tp_name, args[1]); - goto exit; - } - outgoing = (PySSLMemoryBIO *)args[1]; - if (PyFloat_Check(args[2])) { - PyErr_SetString(PyExc_TypeError, - "integer argument expected, got float" ); + args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 3, 4, 0, argsbuf); + if (!args) { goto exit; } - server_side = _PyLong_AsInt(args[2]); - if (server_side == -1 && PyErr_Occurred()) { - goto exit; - } - if (!noptargs) { - goto skip_optional_pos; - } - if (args[3]) { - hostname_obj = args[3]; - if (!--noptargs) { - goto skip_optional_pos; - } - } -skip_optional_pos: - if (!noptargs) { - goto skip_optional_kwonly; - } - if (args[4]) { - owner = args[4]; - if (!--noptargs) { - goto skip_optional_kwonly; - } - } - session = args[5]; -skip_optional_kwonly: + if (!PyObject_TypeCheck(args[0], &PySSLMemoryBIO_Type)) { + _PyArg_BadArgument("_wrap_bio", "argument 'incoming'", (&PySSLMemoryBIO_Type)->tp_name, args[0]); + goto exit; + } + incoming = (PySSLMemoryBIO *)args[0]; + if (!PyObject_TypeCheck(args[1], &PySSLMemoryBIO_Type)) { + _PyArg_BadArgument("_wrap_bio", "argument 'outgoing'", (&PySSLMemoryBIO_Type)->tp_name, args[1]); + goto exit; + } + outgoing = (PySSLMemoryBIO *)args[1]; + if (PyFloat_Check(args[2])) { + PyErr_SetString(PyExc_TypeError, + "integer argument expected, got float" ); + goto exit; + } + server_side = _PyLong_AsInt(args[2]); + if (server_side == -1 && PyErr_Occurred()) { + goto exit; + } + if (!noptargs) { + goto skip_optional_pos; + } + if (args[3]) { + hostname_obj = args[3]; + if (!--noptargs) { + goto skip_optional_pos; + } + } +skip_optional_pos: + if (!noptargs) { + goto skip_optional_kwonly; + } + if (args[4]) { + owner = args[4]; + if (!--noptargs) { + goto skip_optional_kwonly; + } + } + session = args[5]; +skip_optional_kwonly: return_value = _ssl__SSLContext__wrap_bio_impl(self, incoming, outgoing, server_side, hostname_obj, owner, session); exit: @@ -893,7 +893,7 @@ PyDoc_STRVAR(_ssl__SSLContext_get_ca_certs__doc__, "been used at least once."); #define _SSL__SSLCONTEXT_GET_CA_CERTS_METHODDEF \ - {"get_ca_certs", (PyCFunction)(void(*)(void))_ssl__SSLContext_get_ca_certs, METH_FASTCALL|METH_KEYWORDS, _ssl__SSLContext_get_ca_certs__doc__}, + {"get_ca_certs", (PyCFunction)(void(*)(void))_ssl__SSLContext_get_ca_certs, METH_FASTCALL|METH_KEYWORDS, _ssl__SSLContext_get_ca_certs__doc__}, static PyObject * _ssl__SSLContext_get_ca_certs_impl(PySSLContext *self, int binary_form); @@ -903,23 +903,23 @@ _ssl__SSLContext_get_ca_certs(PySSLContext *self, PyObject *const *args, Py_ssiz { PyObject *return_value = NULL; static const char * const _keywords[] = {"binary_form", NULL}; - static _PyArg_Parser _parser = {NULL, _keywords, "get_ca_certs", 0}; - PyObject *argsbuf[1]; - Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0; + static _PyArg_Parser _parser = {NULL, _keywords, "get_ca_certs", 0}; + PyObject *argsbuf[1]; + Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0; int binary_form = 0; - args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 1, 0, argsbuf); - if (!args) { - goto exit; - } - if (!noptargs) { - goto skip_optional_pos; - } - binary_form = PyObject_IsTrue(args[0]); - if (binary_form < 0) { + args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 1, 0, argsbuf); + if (!args) { goto exit; } -skip_optional_pos: + if (!noptargs) { + goto skip_optional_pos; + } + binary_form = PyObject_IsTrue(args[0]); + if (binary_form < 0) { + goto exit; + } +skip_optional_pos: return_value = _ssl__SSLContext_get_ca_certs_impl(self, binary_form); exit: @@ -960,7 +960,7 @@ PyDoc_STRVAR(_ssl_MemoryBIO_read__doc__, "distinguish between the two."); #define _SSL_MEMORYBIO_READ_METHODDEF \ - {"read", (PyCFunction)(void(*)(void))_ssl_MemoryBIO_read, METH_FASTCALL, _ssl_MemoryBIO_read__doc__}, + {"read", (PyCFunction)(void(*)(void))_ssl_MemoryBIO_read, METH_FASTCALL, _ssl_MemoryBIO_read__doc__}, static PyObject * _ssl_MemoryBIO_read_impl(PySSLMemoryBIO *self, int len); @@ -971,22 +971,22 @@ _ssl_MemoryBIO_read(PySSLMemoryBIO *self, PyObject *const *args, Py_ssize_t narg PyObject *return_value = NULL; int len = -1; - if (!_PyArg_CheckPositional("read", nargs, 0, 1)) { + if (!_PyArg_CheckPositional("read", nargs, 0, 1)) { goto exit; } - if (nargs < 1) { - goto skip_optional; - } - if (PyFloat_Check(args[0])) { - PyErr_SetString(PyExc_TypeError, - "integer argument expected, got float" ); - goto exit; - } - len = _PyLong_AsInt(args[0]); - if (len == -1 && PyErr_Occurred()) { - goto exit; - } -skip_optional: + if (nargs < 1) { + goto skip_optional; + } + if (PyFloat_Check(args[0])) { + PyErr_SetString(PyExc_TypeError, + "integer argument expected, got float" ); + goto exit; + } + len = _PyLong_AsInt(args[0]); + if (len == -1 && PyErr_Occurred()) { + goto exit; + } +skip_optional: return_value = _ssl_MemoryBIO_read_impl(self, len); exit: @@ -1013,13 +1013,13 @@ _ssl_MemoryBIO_write(PySSLMemoryBIO *self, PyObject *arg) PyObject *return_value = NULL; Py_buffer b = {NULL, NULL}; - if (PyObject_GetBuffer(arg, &b, PyBUF_SIMPLE) != 0) { - goto exit; - } - if (!PyBuffer_IsContiguous(&b, 'C')) { - _PyArg_BadArgument("write", "argument", "contiguous buffer", arg); + if (PyObject_GetBuffer(arg, &b, PyBUF_SIMPLE) != 0) { goto exit; } + if (!PyBuffer_IsContiguous(&b, 'C')) { + _PyArg_BadArgument("write", "argument", "contiguous buffer", arg); + goto exit; + } return_value = _ssl_MemoryBIO_write_impl(self, &b); exit: @@ -1061,7 +1061,7 @@ PyDoc_STRVAR(_ssl_RAND_add__doc__, "string. See RFC 4086."); #define _SSL_RAND_ADD_METHODDEF \ - {"RAND_add", (PyCFunction)(void(*)(void))_ssl_RAND_add, METH_FASTCALL, _ssl_RAND_add__doc__}, + {"RAND_add", (PyCFunction)(void(*)(void))_ssl_RAND_add, METH_FASTCALL, _ssl_RAND_add__doc__}, static PyObject * _ssl_RAND_add_impl(PyObject *module, Py_buffer *view, double entropy); @@ -1073,36 +1073,36 @@ _ssl_RAND_add(PyObject *module, PyObject *const *args, Py_ssize_t nargs) Py_buffer view = {NULL, NULL}; double entropy; - if (!_PyArg_CheckPositional("RAND_add", nargs, 2, 2)) { + if (!_PyArg_CheckPositional("RAND_add", nargs, 2, 2)) { goto exit; } - if (PyUnicode_Check(args[0])) { - Py_ssize_t len; - const char *ptr = PyUnicode_AsUTF8AndSize(args[0], &len); - if (ptr == NULL) { - goto exit; - } - PyBuffer_FillInfo(&view, args[0], (void *)ptr, len, 1, 0); - } - else { /* any bytes-like object */ - if (PyObject_GetBuffer(args[0], &view, PyBUF_SIMPLE) != 0) { - goto exit; - } - if (!PyBuffer_IsContiguous(&view, 'C')) { - _PyArg_BadArgument("RAND_add", "argument 1", "contiguous buffer", args[0]); - goto exit; - } - } - if (PyFloat_CheckExact(args[1])) { - entropy = PyFloat_AS_DOUBLE(args[1]); - } - else - { - entropy = PyFloat_AsDouble(args[1]); - if (entropy == -1.0 && PyErr_Occurred()) { - goto exit; - } - } + if (PyUnicode_Check(args[0])) { + Py_ssize_t len; + const char *ptr = PyUnicode_AsUTF8AndSize(args[0], &len); + if (ptr == NULL) { + goto exit; + } + PyBuffer_FillInfo(&view, args[0], (void *)ptr, len, 1, 0); + } + else { /* any bytes-like object */ + if (PyObject_GetBuffer(args[0], &view, PyBUF_SIMPLE) != 0) { + goto exit; + } + if (!PyBuffer_IsContiguous(&view, 'C')) { + _PyArg_BadArgument("RAND_add", "argument 1", "contiguous buffer", args[0]); + goto exit; + } + } + if (PyFloat_CheckExact(args[1])) { + entropy = PyFloat_AS_DOUBLE(args[1]); + } + else + { + entropy = PyFloat_AsDouble(args[1]); + if (entropy == -1.0 && PyErr_Occurred()) { + goto exit; + } + } return_value = _ssl_RAND_add_impl(module, &view, entropy); exit: @@ -1132,15 +1132,15 @@ _ssl_RAND_bytes(PyObject *module, PyObject *arg) PyObject *return_value = NULL; int n; - if (PyFloat_Check(arg)) { - PyErr_SetString(PyExc_TypeError, - "integer argument expected, got float" ); - goto exit; - } - n = _PyLong_AsInt(arg); - if (n == -1 && PyErr_Occurred()) { + if (PyFloat_Check(arg)) { + PyErr_SetString(PyExc_TypeError, + "integer argument expected, got float" ); goto exit; } + n = _PyLong_AsInt(arg); + if (n == -1 && PyErr_Occurred()) { + goto exit; + } return_value = _ssl_RAND_bytes_impl(module, n); exit: @@ -1168,15 +1168,15 @@ _ssl_RAND_pseudo_bytes(PyObject *module, PyObject *arg) PyObject *return_value = NULL; int n; - if (PyFloat_Check(arg)) { - PyErr_SetString(PyExc_TypeError, - "integer argument expected, got float" ); - goto exit; - } - n = _PyLong_AsInt(arg); - if (n == -1 && PyErr_Occurred()) { + if (PyFloat_Check(arg)) { + PyErr_SetString(PyExc_TypeError, + "integer argument expected, got float" ); goto exit; } + n = _PyLong_AsInt(arg); + if (n == -1 && PyErr_Occurred()) { + goto exit; + } return_value = _ssl_RAND_pseudo_bytes_impl(module, n); exit: @@ -1227,7 +1227,7 @@ _ssl_RAND_egd(PyObject *module, PyObject *arg) PyObject *return_value = NULL; PyObject *path; - if (!PyUnicode_FSConverter(arg, &path)) { + if (!PyUnicode_FSConverter(arg, &path)) { goto exit; } return_value = _ssl_RAND_egd_impl(module, path); @@ -1268,7 +1268,7 @@ PyDoc_STRVAR(_ssl_txt2obj__doc__, "long name are also matched."); #define _SSL_TXT2OBJ_METHODDEF \ - {"txt2obj", (PyCFunction)(void(*)(void))_ssl_txt2obj, METH_FASTCALL|METH_KEYWORDS, _ssl_txt2obj__doc__}, + {"txt2obj", (PyCFunction)(void(*)(void))_ssl_txt2obj, METH_FASTCALL|METH_KEYWORDS, _ssl_txt2obj__doc__}, static PyObject * _ssl_txt2obj_impl(PyObject *module, const char *txt, int name); @@ -1278,37 +1278,37 @@ _ssl_txt2obj(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject { PyObject *return_value = NULL; static const char * const _keywords[] = {"txt", "name", NULL}; - static _PyArg_Parser _parser = {NULL, _keywords, "txt2obj", 0}; - PyObject *argsbuf[2]; - Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1; + static _PyArg_Parser _parser = {NULL, _keywords, "txt2obj", 0}; + PyObject *argsbuf[2]; + Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1; const char *txt; int name = 0; - args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 2, 0, argsbuf); - if (!args) { - goto exit; - } - if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("txt2obj", "argument 'txt'", "str", args[0]); - goto exit; - } - Py_ssize_t txt_length; - txt = PyUnicode_AsUTF8AndSize(args[0], &txt_length); - if (txt == NULL) { - goto exit; - } - if (strlen(txt) != (size_t)txt_length) { - PyErr_SetString(PyExc_ValueError, "embedded null character"); - goto exit; - } - if (!noptargs) { - goto skip_optional_pos; - } - name = PyObject_IsTrue(args[1]); - if (name < 0) { + args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 2, 0, argsbuf); + if (!args) { goto exit; } -skip_optional_pos: + if (!PyUnicode_Check(args[0])) { + _PyArg_BadArgument("txt2obj", "argument 'txt'", "str", args[0]); + goto exit; + } + Py_ssize_t txt_length; + txt = PyUnicode_AsUTF8AndSize(args[0], &txt_length); + if (txt == NULL) { + goto exit; + } + if (strlen(txt) != (size_t)txt_length) { + PyErr_SetString(PyExc_ValueError, "embedded null character"); + goto exit; + } + if (!noptargs) { + goto skip_optional_pos; + } + name = PyObject_IsTrue(args[1]); + if (name < 0) { + goto exit; + } +skip_optional_pos: return_value = _ssl_txt2obj_impl(module, txt, name); exit: @@ -1333,15 +1333,15 @@ _ssl_nid2obj(PyObject *module, PyObject *arg) PyObject *return_value = NULL; int nid; - if (PyFloat_Check(arg)) { - PyErr_SetString(PyExc_TypeError, - "integer argument expected, got float" ); - goto exit; - } - nid = _PyLong_AsInt(arg); - if (nid == -1 && PyErr_Occurred()) { + if (PyFloat_Check(arg)) { + PyErr_SetString(PyExc_TypeError, + "integer argument expected, got float" ); goto exit; } + nid = _PyLong_AsInt(arg); + if (nid == -1 && PyErr_Occurred()) { + goto exit; + } return_value = _ssl_nid2obj_impl(module, nid); exit: @@ -1363,7 +1363,7 @@ PyDoc_STRVAR(_ssl_enum_certificates__doc__, "a set of OIDs or the boolean True."); #define _SSL_ENUM_CERTIFICATES_METHODDEF \ - {"enum_certificates", (PyCFunction)(void(*)(void))_ssl_enum_certificates, METH_FASTCALL|METH_KEYWORDS, _ssl_enum_certificates__doc__}, + {"enum_certificates", (PyCFunction)(void(*)(void))_ssl_enum_certificates, METH_FASTCALL|METH_KEYWORDS, _ssl_enum_certificates__doc__}, static PyObject * _ssl_enum_certificates_impl(PyObject *module, const char *store_name); @@ -1373,27 +1373,27 @@ _ssl_enum_certificates(PyObject *module, PyObject *const *args, Py_ssize_t nargs { PyObject *return_value = NULL; static const char * const _keywords[] = {"store_name", NULL}; - static _PyArg_Parser _parser = {NULL, _keywords, "enum_certificates", 0}; - PyObject *argsbuf[1]; + static _PyArg_Parser _parser = {NULL, _keywords, "enum_certificates", 0}; + PyObject *argsbuf[1]; const char *store_name; - args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf); - if (!args) { - goto exit; - } - if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("enum_certificates", "argument 'store_name'", "str", args[0]); - goto exit; - } - Py_ssize_t store_name_length; - store_name = PyUnicode_AsUTF8AndSize(args[0], &store_name_length); - if (store_name == NULL) { - goto exit; - } - if (strlen(store_name) != (size_t)store_name_length) { - PyErr_SetString(PyExc_ValueError, "embedded null character"); + args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf); + if (!args) { goto exit; } + if (!PyUnicode_Check(args[0])) { + _PyArg_BadArgument("enum_certificates", "argument 'store_name'", "str", args[0]); + goto exit; + } + Py_ssize_t store_name_length; + store_name = PyUnicode_AsUTF8AndSize(args[0], &store_name_length); + if (store_name == NULL) { + goto exit; + } + if (strlen(store_name) != (size_t)store_name_length) { + PyErr_SetString(PyExc_ValueError, "embedded null character"); + goto exit; + } return_value = _ssl_enum_certificates_impl(module, store_name); exit: @@ -1416,7 +1416,7 @@ PyDoc_STRVAR(_ssl_enum_crls__doc__, "X509_ASN_ENCODING or PKCS_7_ASN_ENCODING."); #define _SSL_ENUM_CRLS_METHODDEF \ - {"enum_crls", (PyCFunction)(void(*)(void))_ssl_enum_crls, METH_FASTCALL|METH_KEYWORDS, _ssl_enum_crls__doc__}, + {"enum_crls", (PyCFunction)(void(*)(void))_ssl_enum_crls, METH_FASTCALL|METH_KEYWORDS, _ssl_enum_crls__doc__}, static PyObject * _ssl_enum_crls_impl(PyObject *module, const char *store_name); @@ -1426,27 +1426,27 @@ _ssl_enum_crls(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObje { PyObject *return_value = NULL; static const char * const _keywords[] = {"store_name", NULL}; - static _PyArg_Parser _parser = {NULL, _keywords, "enum_crls", 0}; - PyObject *argsbuf[1]; + static _PyArg_Parser _parser = {NULL, _keywords, "enum_crls", 0}; + PyObject *argsbuf[1]; const char *store_name; - args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf); - if (!args) { - goto exit; - } - if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("enum_crls", "argument 'store_name'", "str", args[0]); - goto exit; - } - Py_ssize_t store_name_length; - store_name = PyUnicode_AsUTF8AndSize(args[0], &store_name_length); - if (store_name == NULL) { - goto exit; - } - if (strlen(store_name) != (size_t)store_name_length) { - PyErr_SetString(PyExc_ValueError, "embedded null character"); + args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf); + if (!args) { goto exit; } + if (!PyUnicode_Check(args[0])) { + _PyArg_BadArgument("enum_crls", "argument 'store_name'", "str", args[0]); + goto exit; + } + Py_ssize_t store_name_length; + store_name = PyUnicode_AsUTF8AndSize(args[0], &store_name_length); + if (store_name == NULL) { + goto exit; + } + if (strlen(store_name) != (size_t)store_name_length) { + PyErr_SetString(PyExc_ValueError, "embedded null character"); + goto exit; + } return_value = _ssl_enum_crls_impl(module, store_name); exit: @@ -1482,4 +1482,4 @@ exit: #ifndef _SSL_ENUM_CRLS_METHODDEF #define _SSL_ENUM_CRLS_METHODDEF #endif /* !defined(_SSL_ENUM_CRLS_METHODDEF) */ -/*[clinic end generated code: output=a4aeb3f92a091c64 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=a4aeb3f92a091c64 input=a9049054013a1b77]*/ |