Serhiy Storchaka | 4b7b82f | 2015-05-03 16:14:08 +0300 | [diff] [blame] | 1 | /*[clinic input] |
| 2 | preserve |
| 3 | [clinic start generated code]*/ |
| 4 | |
| 5 | PyDoc_STRVAR(_ssl__SSLSocket_do_handshake__doc__, |
| 6 | "do_handshake($self, /)\n" |
| 7 | "--\n" |
| 8 | "\n"); |
| 9 | |
| 10 | #define _SSL__SSLSOCKET_DO_HANDSHAKE_METHODDEF \ |
| 11 | {"do_handshake", (PyCFunction)_ssl__SSLSocket_do_handshake, METH_NOARGS, _ssl__SSLSocket_do_handshake__doc__}, |
| 12 | |
| 13 | static PyObject * |
| 14 | _ssl__SSLSocket_do_handshake_impl(PySSLSocket *self); |
| 15 | |
| 16 | static PyObject * |
| 17 | _ssl__SSLSocket_do_handshake(PySSLSocket *self, PyObject *Py_UNUSED(ignored)) |
| 18 | { |
| 19 | return _ssl__SSLSocket_do_handshake_impl(self); |
| 20 | } |
| 21 | |
| 22 | PyDoc_STRVAR(_ssl__test_decode_cert__doc__, |
| 23 | "_test_decode_cert($module, path, /)\n" |
| 24 | "--\n" |
| 25 | "\n"); |
| 26 | |
| 27 | #define _SSL__TEST_DECODE_CERT_METHODDEF \ |
| 28 | {"_test_decode_cert", (PyCFunction)_ssl__test_decode_cert, METH_O, _ssl__test_decode_cert__doc__}, |
| 29 | |
| 30 | static PyObject * |
| 31 | _ssl__test_decode_cert_impl(PyModuleDef *module, PyObject *path); |
| 32 | |
| 33 | static PyObject * |
| 34 | _ssl__test_decode_cert(PyModuleDef *module, PyObject *arg) |
| 35 | { |
| 36 | PyObject *return_value = NULL; |
| 37 | PyObject *path; |
| 38 | |
Serhiy Storchaka | 5dee655 | 2016-06-09 16:16:06 +0300 | [diff] [blame] | 39 | if (!PyArg_Parse(arg, "O&:_test_decode_cert", PyUnicode_FSConverter, &path)) { |
Serhiy Storchaka | 4b7b82f | 2015-05-03 16:14:08 +0300 | [diff] [blame] | 40 | goto exit; |
Serhiy Storchaka | 5dee655 | 2016-06-09 16:16:06 +0300 | [diff] [blame] | 41 | } |
Serhiy Storchaka | 4b7b82f | 2015-05-03 16:14:08 +0300 | [diff] [blame] | 42 | return_value = _ssl__test_decode_cert_impl(module, path); |
| 43 | |
| 44 | exit: |
| 45 | return return_value; |
| 46 | } |
| 47 | |
| 48 | PyDoc_STRVAR(_ssl__SSLSocket_peer_certificate__doc__, |
| 49 | "peer_certificate($self, der=False, /)\n" |
| 50 | "--\n" |
| 51 | "\n" |
| 52 | "Returns the certificate for the peer.\n" |
| 53 | "\n" |
| 54 | "If no certificate was provided, returns None. If a certificate was\n" |
| 55 | "provided, but not validated, returns an empty dictionary. Otherwise\n" |
| 56 | "returns a dict containing information about the peer certificate.\n" |
| 57 | "\n" |
| 58 | "If the optional argument is True, returns a DER-encoded copy of the\n" |
| 59 | "peer certificate, or None if no certificate was provided. This will\n" |
| 60 | "return the certificate even if it wasn\'t validated."); |
| 61 | |
| 62 | #define _SSL__SSLSOCKET_PEER_CERTIFICATE_METHODDEF \ |
| 63 | {"peer_certificate", (PyCFunction)_ssl__SSLSocket_peer_certificate, METH_VARARGS, _ssl__SSLSocket_peer_certificate__doc__}, |
| 64 | |
| 65 | static PyObject * |
| 66 | _ssl__SSLSocket_peer_certificate_impl(PySSLSocket *self, int binary_mode); |
| 67 | |
| 68 | static PyObject * |
| 69 | _ssl__SSLSocket_peer_certificate(PySSLSocket *self, PyObject *args) |
| 70 | { |
| 71 | PyObject *return_value = NULL; |
| 72 | int binary_mode = 0; |
| 73 | |
| 74 | if (!PyArg_ParseTuple(args, "|p:peer_certificate", |
Serhiy Storchaka | 5dee655 | 2016-06-09 16:16:06 +0300 | [diff] [blame] | 75 | &binary_mode)) { |
Serhiy Storchaka | 4b7b82f | 2015-05-03 16:14:08 +0300 | [diff] [blame] | 76 | goto exit; |
Serhiy Storchaka | 5dee655 | 2016-06-09 16:16:06 +0300 | [diff] [blame] | 77 | } |
Serhiy Storchaka | 4b7b82f | 2015-05-03 16:14:08 +0300 | [diff] [blame] | 78 | return_value = _ssl__SSLSocket_peer_certificate_impl(self, binary_mode); |
| 79 | |
| 80 | exit: |
| 81 | return return_value; |
| 82 | } |
| 83 | |
| 84 | PyDoc_STRVAR(_ssl__SSLSocket_shared_ciphers__doc__, |
| 85 | "shared_ciphers($self, /)\n" |
| 86 | "--\n" |
| 87 | "\n"); |
| 88 | |
| 89 | #define _SSL__SSLSOCKET_SHARED_CIPHERS_METHODDEF \ |
| 90 | {"shared_ciphers", (PyCFunction)_ssl__SSLSocket_shared_ciphers, METH_NOARGS, _ssl__SSLSocket_shared_ciphers__doc__}, |
| 91 | |
| 92 | static PyObject * |
| 93 | _ssl__SSLSocket_shared_ciphers_impl(PySSLSocket *self); |
| 94 | |
| 95 | static PyObject * |
| 96 | _ssl__SSLSocket_shared_ciphers(PySSLSocket *self, PyObject *Py_UNUSED(ignored)) |
| 97 | { |
| 98 | return _ssl__SSLSocket_shared_ciphers_impl(self); |
| 99 | } |
| 100 | |
| 101 | PyDoc_STRVAR(_ssl__SSLSocket_cipher__doc__, |
| 102 | "cipher($self, /)\n" |
| 103 | "--\n" |
| 104 | "\n"); |
| 105 | |
| 106 | #define _SSL__SSLSOCKET_CIPHER_METHODDEF \ |
| 107 | {"cipher", (PyCFunction)_ssl__SSLSocket_cipher, METH_NOARGS, _ssl__SSLSocket_cipher__doc__}, |
| 108 | |
| 109 | static PyObject * |
| 110 | _ssl__SSLSocket_cipher_impl(PySSLSocket *self); |
| 111 | |
| 112 | static PyObject * |
| 113 | _ssl__SSLSocket_cipher(PySSLSocket *self, PyObject *Py_UNUSED(ignored)) |
| 114 | { |
| 115 | return _ssl__SSLSocket_cipher_impl(self); |
| 116 | } |
| 117 | |
| 118 | PyDoc_STRVAR(_ssl__SSLSocket_version__doc__, |
| 119 | "version($self, /)\n" |
| 120 | "--\n" |
| 121 | "\n"); |
| 122 | |
| 123 | #define _SSL__SSLSOCKET_VERSION_METHODDEF \ |
| 124 | {"version", (PyCFunction)_ssl__SSLSocket_version, METH_NOARGS, _ssl__SSLSocket_version__doc__}, |
| 125 | |
| 126 | static PyObject * |
| 127 | _ssl__SSLSocket_version_impl(PySSLSocket *self); |
| 128 | |
| 129 | static PyObject * |
| 130 | _ssl__SSLSocket_version(PySSLSocket *self, PyObject *Py_UNUSED(ignored)) |
| 131 | { |
| 132 | return _ssl__SSLSocket_version_impl(self); |
| 133 | } |
| 134 | |
| 135 | #if defined(OPENSSL_NPN_NEGOTIATED) |
| 136 | |
| 137 | PyDoc_STRVAR(_ssl__SSLSocket_selected_npn_protocol__doc__, |
| 138 | "selected_npn_protocol($self, /)\n" |
| 139 | "--\n" |
| 140 | "\n"); |
| 141 | |
| 142 | #define _SSL__SSLSOCKET_SELECTED_NPN_PROTOCOL_METHODDEF \ |
| 143 | {"selected_npn_protocol", (PyCFunction)_ssl__SSLSocket_selected_npn_protocol, METH_NOARGS, _ssl__SSLSocket_selected_npn_protocol__doc__}, |
| 144 | |
| 145 | static PyObject * |
| 146 | _ssl__SSLSocket_selected_npn_protocol_impl(PySSLSocket *self); |
| 147 | |
| 148 | static PyObject * |
| 149 | _ssl__SSLSocket_selected_npn_protocol(PySSLSocket *self, PyObject *Py_UNUSED(ignored)) |
| 150 | { |
| 151 | return _ssl__SSLSocket_selected_npn_protocol_impl(self); |
| 152 | } |
| 153 | |
| 154 | #endif /* defined(OPENSSL_NPN_NEGOTIATED) */ |
| 155 | |
| 156 | #if defined(HAVE_ALPN) |
| 157 | |
| 158 | PyDoc_STRVAR(_ssl__SSLSocket_selected_alpn_protocol__doc__, |
| 159 | "selected_alpn_protocol($self, /)\n" |
| 160 | "--\n" |
| 161 | "\n"); |
| 162 | |
| 163 | #define _SSL__SSLSOCKET_SELECTED_ALPN_PROTOCOL_METHODDEF \ |
| 164 | {"selected_alpn_protocol", (PyCFunction)_ssl__SSLSocket_selected_alpn_protocol, METH_NOARGS, _ssl__SSLSocket_selected_alpn_protocol__doc__}, |
| 165 | |
| 166 | static PyObject * |
| 167 | _ssl__SSLSocket_selected_alpn_protocol_impl(PySSLSocket *self); |
| 168 | |
| 169 | static PyObject * |
| 170 | _ssl__SSLSocket_selected_alpn_protocol(PySSLSocket *self, PyObject *Py_UNUSED(ignored)) |
| 171 | { |
| 172 | return _ssl__SSLSocket_selected_alpn_protocol_impl(self); |
| 173 | } |
| 174 | |
| 175 | #endif /* defined(HAVE_ALPN) */ |
| 176 | |
| 177 | PyDoc_STRVAR(_ssl__SSLSocket_compression__doc__, |
| 178 | "compression($self, /)\n" |
| 179 | "--\n" |
| 180 | "\n"); |
| 181 | |
| 182 | #define _SSL__SSLSOCKET_COMPRESSION_METHODDEF \ |
| 183 | {"compression", (PyCFunction)_ssl__SSLSocket_compression, METH_NOARGS, _ssl__SSLSocket_compression__doc__}, |
| 184 | |
| 185 | static PyObject * |
| 186 | _ssl__SSLSocket_compression_impl(PySSLSocket *self); |
| 187 | |
| 188 | static PyObject * |
| 189 | _ssl__SSLSocket_compression(PySSLSocket *self, PyObject *Py_UNUSED(ignored)) |
| 190 | { |
| 191 | return _ssl__SSLSocket_compression_impl(self); |
| 192 | } |
| 193 | |
| 194 | PyDoc_STRVAR(_ssl__SSLSocket_write__doc__, |
| 195 | "write($self, b, /)\n" |
| 196 | "--\n" |
| 197 | "\n" |
| 198 | "Writes the bytes-like object b into the SSL object.\n" |
| 199 | "\n" |
| 200 | "Returns the number of bytes written."); |
| 201 | |
| 202 | #define _SSL__SSLSOCKET_WRITE_METHODDEF \ |
| 203 | {"write", (PyCFunction)_ssl__SSLSocket_write, METH_O, _ssl__SSLSocket_write__doc__}, |
| 204 | |
| 205 | static PyObject * |
| 206 | _ssl__SSLSocket_write_impl(PySSLSocket *self, Py_buffer *b); |
| 207 | |
| 208 | static PyObject * |
| 209 | _ssl__SSLSocket_write(PySSLSocket *self, PyObject *arg) |
| 210 | { |
| 211 | PyObject *return_value = NULL; |
| 212 | Py_buffer b = {NULL, NULL}; |
| 213 | |
Serhiy Storchaka | 5dee655 | 2016-06-09 16:16:06 +0300 | [diff] [blame] | 214 | if (!PyArg_Parse(arg, "y*:write", &b)) { |
Serhiy Storchaka | 4b7b82f | 2015-05-03 16:14:08 +0300 | [diff] [blame] | 215 | goto exit; |
Serhiy Storchaka | 5dee655 | 2016-06-09 16:16:06 +0300 | [diff] [blame] | 216 | } |
Serhiy Storchaka | 4b7b82f | 2015-05-03 16:14:08 +0300 | [diff] [blame] | 217 | return_value = _ssl__SSLSocket_write_impl(self, &b); |
| 218 | |
| 219 | exit: |
| 220 | /* Cleanup for b */ |
Serhiy Storchaka | 5dee655 | 2016-06-09 16:16:06 +0300 | [diff] [blame] | 221 | if (b.obj) { |
Serhiy Storchaka | 4b7b82f | 2015-05-03 16:14:08 +0300 | [diff] [blame] | 222 | PyBuffer_Release(&b); |
Serhiy Storchaka | 5dee655 | 2016-06-09 16:16:06 +0300 | [diff] [blame] | 223 | } |
Serhiy Storchaka | 4b7b82f | 2015-05-03 16:14:08 +0300 | [diff] [blame] | 224 | |
| 225 | return return_value; |
| 226 | } |
| 227 | |
| 228 | PyDoc_STRVAR(_ssl__SSLSocket_pending__doc__, |
| 229 | "pending($self, /)\n" |
| 230 | "--\n" |
| 231 | "\n" |
| 232 | "Returns the number of already decrypted bytes available for read, pending on the connection."); |
| 233 | |
| 234 | #define _SSL__SSLSOCKET_PENDING_METHODDEF \ |
| 235 | {"pending", (PyCFunction)_ssl__SSLSocket_pending, METH_NOARGS, _ssl__SSLSocket_pending__doc__}, |
| 236 | |
| 237 | static PyObject * |
| 238 | _ssl__SSLSocket_pending_impl(PySSLSocket *self); |
| 239 | |
| 240 | static PyObject * |
| 241 | _ssl__SSLSocket_pending(PySSLSocket *self, PyObject *Py_UNUSED(ignored)) |
| 242 | { |
| 243 | return _ssl__SSLSocket_pending_impl(self); |
| 244 | } |
| 245 | |
| 246 | PyDoc_STRVAR(_ssl__SSLSocket_read__doc__, |
| 247 | "read(size, [buffer])\n" |
| 248 | "Read up to size bytes from the SSL socket."); |
| 249 | |
| 250 | #define _SSL__SSLSOCKET_READ_METHODDEF \ |
| 251 | {"read", (PyCFunction)_ssl__SSLSocket_read, METH_VARARGS, _ssl__SSLSocket_read__doc__}, |
| 252 | |
| 253 | static PyObject * |
| 254 | _ssl__SSLSocket_read_impl(PySSLSocket *self, int len, int group_right_1, |
| 255 | Py_buffer *buffer); |
| 256 | |
| 257 | static PyObject * |
| 258 | _ssl__SSLSocket_read(PySSLSocket *self, PyObject *args) |
| 259 | { |
| 260 | PyObject *return_value = NULL; |
| 261 | int len; |
| 262 | int group_right_1 = 0; |
| 263 | Py_buffer buffer = {NULL, NULL}; |
| 264 | |
| 265 | switch (PyTuple_GET_SIZE(args)) { |
| 266 | case 1: |
Serhiy Storchaka | 5dee655 | 2016-06-09 16:16:06 +0300 | [diff] [blame] | 267 | if (!PyArg_ParseTuple(args, "i:read", &len)) { |
Serhiy Storchaka | 4b7b82f | 2015-05-03 16:14:08 +0300 | [diff] [blame] | 268 | goto exit; |
Serhiy Storchaka | 5dee655 | 2016-06-09 16:16:06 +0300 | [diff] [blame] | 269 | } |
Serhiy Storchaka | 4b7b82f | 2015-05-03 16:14:08 +0300 | [diff] [blame] | 270 | break; |
| 271 | case 2: |
Serhiy Storchaka | 5dee655 | 2016-06-09 16:16:06 +0300 | [diff] [blame] | 272 | if (!PyArg_ParseTuple(args, "iw*:read", &len, &buffer)) { |
Serhiy Storchaka | 4b7b82f | 2015-05-03 16:14:08 +0300 | [diff] [blame] | 273 | goto exit; |
Serhiy Storchaka | 5dee655 | 2016-06-09 16:16:06 +0300 | [diff] [blame] | 274 | } |
Serhiy Storchaka | 4b7b82f | 2015-05-03 16:14:08 +0300 | [diff] [blame] | 275 | group_right_1 = 1; |
| 276 | break; |
| 277 | default: |
| 278 | PyErr_SetString(PyExc_TypeError, "_ssl._SSLSocket.read requires 1 to 2 arguments"); |
| 279 | goto exit; |
| 280 | } |
| 281 | return_value = _ssl__SSLSocket_read_impl(self, len, group_right_1, &buffer); |
| 282 | |
| 283 | exit: |
| 284 | /* Cleanup for buffer */ |
Serhiy Storchaka | 5dee655 | 2016-06-09 16:16:06 +0300 | [diff] [blame] | 285 | if (buffer.obj) { |
Serhiy Storchaka | 4b7b82f | 2015-05-03 16:14:08 +0300 | [diff] [blame] | 286 | PyBuffer_Release(&buffer); |
Serhiy Storchaka | 5dee655 | 2016-06-09 16:16:06 +0300 | [diff] [blame] | 287 | } |
Serhiy Storchaka | 4b7b82f | 2015-05-03 16:14:08 +0300 | [diff] [blame] | 288 | |
| 289 | return return_value; |
| 290 | } |
| 291 | |
| 292 | PyDoc_STRVAR(_ssl__SSLSocket_shutdown__doc__, |
| 293 | "shutdown($self, /)\n" |
| 294 | "--\n" |
| 295 | "\n" |
| 296 | "Does the SSL shutdown handshake with the remote end.\n" |
| 297 | "\n" |
| 298 | "Returns the underlying socket object."); |
| 299 | |
| 300 | #define _SSL__SSLSOCKET_SHUTDOWN_METHODDEF \ |
| 301 | {"shutdown", (PyCFunction)_ssl__SSLSocket_shutdown, METH_NOARGS, _ssl__SSLSocket_shutdown__doc__}, |
| 302 | |
| 303 | static PyObject * |
| 304 | _ssl__SSLSocket_shutdown_impl(PySSLSocket *self); |
| 305 | |
| 306 | static PyObject * |
| 307 | _ssl__SSLSocket_shutdown(PySSLSocket *self, PyObject *Py_UNUSED(ignored)) |
| 308 | { |
| 309 | return _ssl__SSLSocket_shutdown_impl(self); |
| 310 | } |
| 311 | |
| 312 | PyDoc_STRVAR(_ssl__SSLSocket_tls_unique_cb__doc__, |
| 313 | "tls_unique_cb($self, /)\n" |
| 314 | "--\n" |
| 315 | "\n" |
| 316 | "Returns the \'tls-unique\' channel binding data, as defined by RFC 5929.\n" |
| 317 | "\n" |
| 318 | "If the TLS handshake is not yet complete, None is returned."); |
| 319 | |
| 320 | #define _SSL__SSLSOCKET_TLS_UNIQUE_CB_METHODDEF \ |
| 321 | {"tls_unique_cb", (PyCFunction)_ssl__SSLSocket_tls_unique_cb, METH_NOARGS, _ssl__SSLSocket_tls_unique_cb__doc__}, |
| 322 | |
| 323 | static PyObject * |
| 324 | _ssl__SSLSocket_tls_unique_cb_impl(PySSLSocket *self); |
| 325 | |
| 326 | static PyObject * |
| 327 | _ssl__SSLSocket_tls_unique_cb(PySSLSocket *self, PyObject *Py_UNUSED(ignored)) |
| 328 | { |
| 329 | return _ssl__SSLSocket_tls_unique_cb_impl(self); |
| 330 | } |
| 331 | |
| 332 | static PyObject * |
| 333 | _ssl__SSLContext_impl(PyTypeObject *type, int proto_version); |
| 334 | |
| 335 | static PyObject * |
| 336 | _ssl__SSLContext(PyTypeObject *type, PyObject *args, PyObject *kwargs) |
| 337 | { |
| 338 | PyObject *return_value = NULL; |
| 339 | int proto_version; |
| 340 | |
| 341 | if ((type == &PySSLContext_Type) && |
Serhiy Storchaka | 5dee655 | 2016-06-09 16:16:06 +0300 | [diff] [blame] | 342 | !_PyArg_NoKeywords("_SSLContext", kwargs)) { |
Serhiy Storchaka | 4b7b82f | 2015-05-03 16:14:08 +0300 | [diff] [blame] | 343 | goto exit; |
Serhiy Storchaka | 5dee655 | 2016-06-09 16:16:06 +0300 | [diff] [blame] | 344 | } |
Serhiy Storchaka | 4b7b82f | 2015-05-03 16:14:08 +0300 | [diff] [blame] | 345 | if (!PyArg_ParseTuple(args, "i:_SSLContext", |
Serhiy Storchaka | 5dee655 | 2016-06-09 16:16:06 +0300 | [diff] [blame] | 346 | &proto_version)) { |
Serhiy Storchaka | 4b7b82f | 2015-05-03 16:14:08 +0300 | [diff] [blame] | 347 | goto exit; |
Serhiy Storchaka | 5dee655 | 2016-06-09 16:16:06 +0300 | [diff] [blame] | 348 | } |
Serhiy Storchaka | 4b7b82f | 2015-05-03 16:14:08 +0300 | [diff] [blame] | 349 | return_value = _ssl__SSLContext_impl(type, proto_version); |
| 350 | |
| 351 | exit: |
| 352 | return return_value; |
| 353 | } |
| 354 | |
| 355 | PyDoc_STRVAR(_ssl__SSLContext_set_ciphers__doc__, |
| 356 | "set_ciphers($self, cipherlist, /)\n" |
| 357 | "--\n" |
| 358 | "\n"); |
| 359 | |
| 360 | #define _SSL__SSLCONTEXT_SET_CIPHERS_METHODDEF \ |
| 361 | {"set_ciphers", (PyCFunction)_ssl__SSLContext_set_ciphers, METH_O, _ssl__SSLContext_set_ciphers__doc__}, |
| 362 | |
| 363 | static PyObject * |
| 364 | _ssl__SSLContext_set_ciphers_impl(PySSLContext *self, const char *cipherlist); |
| 365 | |
| 366 | static PyObject * |
| 367 | _ssl__SSLContext_set_ciphers(PySSLContext *self, PyObject *arg) |
| 368 | { |
| 369 | PyObject *return_value = NULL; |
| 370 | const char *cipherlist; |
| 371 | |
Serhiy Storchaka | 5dee655 | 2016-06-09 16:16:06 +0300 | [diff] [blame] | 372 | if (!PyArg_Parse(arg, "s:set_ciphers", &cipherlist)) { |
Serhiy Storchaka | 4b7b82f | 2015-05-03 16:14:08 +0300 | [diff] [blame] | 373 | goto exit; |
Serhiy Storchaka | 5dee655 | 2016-06-09 16:16:06 +0300 | [diff] [blame] | 374 | } |
Serhiy Storchaka | 4b7b82f | 2015-05-03 16:14:08 +0300 | [diff] [blame] | 375 | return_value = _ssl__SSLContext_set_ciphers_impl(self, cipherlist); |
| 376 | |
| 377 | exit: |
| 378 | return return_value; |
| 379 | } |
| 380 | |
| 381 | PyDoc_STRVAR(_ssl__SSLContext__set_npn_protocols__doc__, |
| 382 | "_set_npn_protocols($self, protos, /)\n" |
| 383 | "--\n" |
| 384 | "\n"); |
| 385 | |
| 386 | #define _SSL__SSLCONTEXT__SET_NPN_PROTOCOLS_METHODDEF \ |
| 387 | {"_set_npn_protocols", (PyCFunction)_ssl__SSLContext__set_npn_protocols, METH_O, _ssl__SSLContext__set_npn_protocols__doc__}, |
| 388 | |
| 389 | static PyObject * |
| 390 | _ssl__SSLContext__set_npn_protocols_impl(PySSLContext *self, |
| 391 | Py_buffer *protos); |
| 392 | |
| 393 | static PyObject * |
| 394 | _ssl__SSLContext__set_npn_protocols(PySSLContext *self, PyObject *arg) |
| 395 | { |
| 396 | PyObject *return_value = NULL; |
| 397 | Py_buffer protos = {NULL, NULL}; |
| 398 | |
Serhiy Storchaka | 5dee655 | 2016-06-09 16:16:06 +0300 | [diff] [blame] | 399 | if (!PyArg_Parse(arg, "y*:_set_npn_protocols", &protos)) { |
Serhiy Storchaka | 4b7b82f | 2015-05-03 16:14:08 +0300 | [diff] [blame] | 400 | goto exit; |
Serhiy Storchaka | 5dee655 | 2016-06-09 16:16:06 +0300 | [diff] [blame] | 401 | } |
Serhiy Storchaka | 4b7b82f | 2015-05-03 16:14:08 +0300 | [diff] [blame] | 402 | return_value = _ssl__SSLContext__set_npn_protocols_impl(self, &protos); |
| 403 | |
| 404 | exit: |
| 405 | /* Cleanup for protos */ |
Serhiy Storchaka | 5dee655 | 2016-06-09 16:16:06 +0300 | [diff] [blame] | 406 | if (protos.obj) { |
Serhiy Storchaka | 4b7b82f | 2015-05-03 16:14:08 +0300 | [diff] [blame] | 407 | PyBuffer_Release(&protos); |
Serhiy Storchaka | 5dee655 | 2016-06-09 16:16:06 +0300 | [diff] [blame] | 408 | } |
Serhiy Storchaka | 4b7b82f | 2015-05-03 16:14:08 +0300 | [diff] [blame] | 409 | |
| 410 | return return_value; |
| 411 | } |
| 412 | |
| 413 | PyDoc_STRVAR(_ssl__SSLContext__set_alpn_protocols__doc__, |
| 414 | "_set_alpn_protocols($self, protos, /)\n" |
| 415 | "--\n" |
| 416 | "\n"); |
| 417 | |
| 418 | #define _SSL__SSLCONTEXT__SET_ALPN_PROTOCOLS_METHODDEF \ |
| 419 | {"_set_alpn_protocols", (PyCFunction)_ssl__SSLContext__set_alpn_protocols, METH_O, _ssl__SSLContext__set_alpn_protocols__doc__}, |
| 420 | |
| 421 | static PyObject * |
| 422 | _ssl__SSLContext__set_alpn_protocols_impl(PySSLContext *self, |
| 423 | Py_buffer *protos); |
| 424 | |
| 425 | static PyObject * |
| 426 | _ssl__SSLContext__set_alpn_protocols(PySSLContext *self, PyObject *arg) |
| 427 | { |
| 428 | PyObject *return_value = NULL; |
| 429 | Py_buffer protos = {NULL, NULL}; |
| 430 | |
Serhiy Storchaka | 5dee655 | 2016-06-09 16:16:06 +0300 | [diff] [blame] | 431 | if (!PyArg_Parse(arg, "y*:_set_alpn_protocols", &protos)) { |
Serhiy Storchaka | 4b7b82f | 2015-05-03 16:14:08 +0300 | [diff] [blame] | 432 | goto exit; |
Serhiy Storchaka | 5dee655 | 2016-06-09 16:16:06 +0300 | [diff] [blame] | 433 | } |
Serhiy Storchaka | 4b7b82f | 2015-05-03 16:14:08 +0300 | [diff] [blame] | 434 | return_value = _ssl__SSLContext__set_alpn_protocols_impl(self, &protos); |
| 435 | |
| 436 | exit: |
| 437 | /* Cleanup for protos */ |
Serhiy Storchaka | 5dee655 | 2016-06-09 16:16:06 +0300 | [diff] [blame] | 438 | if (protos.obj) { |
Serhiy Storchaka | 4b7b82f | 2015-05-03 16:14:08 +0300 | [diff] [blame] | 439 | PyBuffer_Release(&protos); |
Serhiy Storchaka | 5dee655 | 2016-06-09 16:16:06 +0300 | [diff] [blame] | 440 | } |
Serhiy Storchaka | 4b7b82f | 2015-05-03 16:14:08 +0300 | [diff] [blame] | 441 | |
| 442 | return return_value; |
| 443 | } |
| 444 | |
| 445 | PyDoc_STRVAR(_ssl__SSLContext_load_cert_chain__doc__, |
| 446 | "load_cert_chain($self, /, certfile, keyfile=None, password=None)\n" |
| 447 | "--\n" |
| 448 | "\n"); |
| 449 | |
| 450 | #define _SSL__SSLCONTEXT_LOAD_CERT_CHAIN_METHODDEF \ |
| 451 | {"load_cert_chain", (PyCFunction)_ssl__SSLContext_load_cert_chain, METH_VARARGS|METH_KEYWORDS, _ssl__SSLContext_load_cert_chain__doc__}, |
| 452 | |
| 453 | static PyObject * |
| 454 | _ssl__SSLContext_load_cert_chain_impl(PySSLContext *self, PyObject *certfile, |
| 455 | PyObject *keyfile, PyObject *password); |
| 456 | |
| 457 | static PyObject * |
| 458 | _ssl__SSLContext_load_cert_chain(PySSLContext *self, PyObject *args, PyObject *kwargs) |
| 459 | { |
| 460 | PyObject *return_value = NULL; |
| 461 | static char *_keywords[] = {"certfile", "keyfile", "password", NULL}; |
| 462 | PyObject *certfile; |
| 463 | PyObject *keyfile = NULL; |
| 464 | PyObject *password = NULL; |
| 465 | |
| 466 | if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O|OO:load_cert_chain", _keywords, |
Serhiy Storchaka | 5dee655 | 2016-06-09 16:16:06 +0300 | [diff] [blame] | 467 | &certfile, &keyfile, &password)) { |
Serhiy Storchaka | 4b7b82f | 2015-05-03 16:14:08 +0300 | [diff] [blame] | 468 | goto exit; |
Serhiy Storchaka | 5dee655 | 2016-06-09 16:16:06 +0300 | [diff] [blame] | 469 | } |
Serhiy Storchaka | 4b7b82f | 2015-05-03 16:14:08 +0300 | [diff] [blame] | 470 | return_value = _ssl__SSLContext_load_cert_chain_impl(self, certfile, keyfile, password); |
| 471 | |
| 472 | exit: |
| 473 | return return_value; |
| 474 | } |
| 475 | |
| 476 | PyDoc_STRVAR(_ssl__SSLContext_load_verify_locations__doc__, |
| 477 | "load_verify_locations($self, /, cafile=None, capath=None, cadata=None)\n" |
| 478 | "--\n" |
| 479 | "\n"); |
| 480 | |
| 481 | #define _SSL__SSLCONTEXT_LOAD_VERIFY_LOCATIONS_METHODDEF \ |
| 482 | {"load_verify_locations", (PyCFunction)_ssl__SSLContext_load_verify_locations, METH_VARARGS|METH_KEYWORDS, _ssl__SSLContext_load_verify_locations__doc__}, |
| 483 | |
| 484 | static PyObject * |
| 485 | _ssl__SSLContext_load_verify_locations_impl(PySSLContext *self, |
| 486 | PyObject *cafile, |
| 487 | PyObject *capath, |
| 488 | PyObject *cadata); |
| 489 | |
| 490 | static PyObject * |
| 491 | _ssl__SSLContext_load_verify_locations(PySSLContext *self, PyObject *args, PyObject *kwargs) |
| 492 | { |
| 493 | PyObject *return_value = NULL; |
| 494 | static char *_keywords[] = {"cafile", "capath", "cadata", NULL}; |
| 495 | PyObject *cafile = NULL; |
| 496 | PyObject *capath = NULL; |
| 497 | PyObject *cadata = NULL; |
| 498 | |
| 499 | if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OOO:load_verify_locations", _keywords, |
Serhiy Storchaka | 5dee655 | 2016-06-09 16:16:06 +0300 | [diff] [blame] | 500 | &cafile, &capath, &cadata)) { |
Serhiy Storchaka | 4b7b82f | 2015-05-03 16:14:08 +0300 | [diff] [blame] | 501 | goto exit; |
Serhiy Storchaka | 5dee655 | 2016-06-09 16:16:06 +0300 | [diff] [blame] | 502 | } |
Serhiy Storchaka | 4b7b82f | 2015-05-03 16:14:08 +0300 | [diff] [blame] | 503 | return_value = _ssl__SSLContext_load_verify_locations_impl(self, cafile, capath, cadata); |
| 504 | |
| 505 | exit: |
| 506 | return return_value; |
| 507 | } |
| 508 | |
| 509 | PyDoc_STRVAR(_ssl__SSLContext_load_dh_params__doc__, |
| 510 | "load_dh_params($self, path, /)\n" |
| 511 | "--\n" |
| 512 | "\n"); |
| 513 | |
| 514 | #define _SSL__SSLCONTEXT_LOAD_DH_PARAMS_METHODDEF \ |
| 515 | {"load_dh_params", (PyCFunction)_ssl__SSLContext_load_dh_params, METH_O, _ssl__SSLContext_load_dh_params__doc__}, |
| 516 | |
| 517 | PyDoc_STRVAR(_ssl__SSLContext__wrap_socket__doc__, |
| 518 | "_wrap_socket($self, /, sock, server_side, server_hostname=None)\n" |
| 519 | "--\n" |
| 520 | "\n"); |
| 521 | |
| 522 | #define _SSL__SSLCONTEXT__WRAP_SOCKET_METHODDEF \ |
| 523 | {"_wrap_socket", (PyCFunction)_ssl__SSLContext__wrap_socket, METH_VARARGS|METH_KEYWORDS, _ssl__SSLContext__wrap_socket__doc__}, |
| 524 | |
| 525 | static PyObject * |
| 526 | _ssl__SSLContext__wrap_socket_impl(PySSLContext *self, PyObject *sock, |
| 527 | int server_side, PyObject *hostname_obj); |
| 528 | |
| 529 | static PyObject * |
| 530 | _ssl__SSLContext__wrap_socket(PySSLContext *self, PyObject *args, PyObject *kwargs) |
| 531 | { |
| 532 | PyObject *return_value = NULL; |
| 533 | static char *_keywords[] = {"sock", "server_side", "server_hostname", NULL}; |
| 534 | PyObject *sock; |
| 535 | int server_side; |
| 536 | PyObject *hostname_obj = Py_None; |
| 537 | |
| 538 | if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O!i|O:_wrap_socket", _keywords, |
Serhiy Storchaka | 5dee655 | 2016-06-09 16:16:06 +0300 | [diff] [blame] | 539 | PySocketModule.Sock_Type, &sock, &server_side, &hostname_obj)) { |
Serhiy Storchaka | 4b7b82f | 2015-05-03 16:14:08 +0300 | [diff] [blame] | 540 | goto exit; |
Serhiy Storchaka | 5dee655 | 2016-06-09 16:16:06 +0300 | [diff] [blame] | 541 | } |
Serhiy Storchaka | 4b7b82f | 2015-05-03 16:14:08 +0300 | [diff] [blame] | 542 | return_value = _ssl__SSLContext__wrap_socket_impl(self, sock, server_side, hostname_obj); |
| 543 | |
| 544 | exit: |
| 545 | return return_value; |
| 546 | } |
| 547 | |
| 548 | PyDoc_STRVAR(_ssl__SSLContext__wrap_bio__doc__, |
| 549 | "_wrap_bio($self, /, incoming, outgoing, server_side,\n" |
| 550 | " server_hostname=None)\n" |
| 551 | "--\n" |
| 552 | "\n"); |
| 553 | |
| 554 | #define _SSL__SSLCONTEXT__WRAP_BIO_METHODDEF \ |
| 555 | {"_wrap_bio", (PyCFunction)_ssl__SSLContext__wrap_bio, METH_VARARGS|METH_KEYWORDS, _ssl__SSLContext__wrap_bio__doc__}, |
| 556 | |
| 557 | static PyObject * |
| 558 | _ssl__SSLContext__wrap_bio_impl(PySSLContext *self, PySSLMemoryBIO *incoming, |
| 559 | PySSLMemoryBIO *outgoing, int server_side, |
| 560 | PyObject *hostname_obj); |
| 561 | |
| 562 | static PyObject * |
| 563 | _ssl__SSLContext__wrap_bio(PySSLContext *self, PyObject *args, PyObject *kwargs) |
| 564 | { |
| 565 | PyObject *return_value = NULL; |
| 566 | static char *_keywords[] = {"incoming", "outgoing", "server_side", "server_hostname", NULL}; |
| 567 | PySSLMemoryBIO *incoming; |
| 568 | PySSLMemoryBIO *outgoing; |
| 569 | int server_side; |
| 570 | PyObject *hostname_obj = Py_None; |
| 571 | |
| 572 | if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O!O!i|O:_wrap_bio", _keywords, |
Serhiy Storchaka | 5dee655 | 2016-06-09 16:16:06 +0300 | [diff] [blame] | 573 | &PySSLMemoryBIO_Type, &incoming, &PySSLMemoryBIO_Type, &outgoing, &server_side, &hostname_obj)) { |
Serhiy Storchaka | 4b7b82f | 2015-05-03 16:14:08 +0300 | [diff] [blame] | 574 | goto exit; |
Serhiy Storchaka | 5dee655 | 2016-06-09 16:16:06 +0300 | [diff] [blame] | 575 | } |
Serhiy Storchaka | 4b7b82f | 2015-05-03 16:14:08 +0300 | [diff] [blame] | 576 | return_value = _ssl__SSLContext__wrap_bio_impl(self, incoming, outgoing, server_side, hostname_obj); |
| 577 | |
| 578 | exit: |
| 579 | return return_value; |
| 580 | } |
| 581 | |
| 582 | PyDoc_STRVAR(_ssl__SSLContext_session_stats__doc__, |
| 583 | "session_stats($self, /)\n" |
| 584 | "--\n" |
| 585 | "\n"); |
| 586 | |
| 587 | #define _SSL__SSLCONTEXT_SESSION_STATS_METHODDEF \ |
| 588 | {"session_stats", (PyCFunction)_ssl__SSLContext_session_stats, METH_NOARGS, _ssl__SSLContext_session_stats__doc__}, |
| 589 | |
| 590 | static PyObject * |
| 591 | _ssl__SSLContext_session_stats_impl(PySSLContext *self); |
| 592 | |
| 593 | static PyObject * |
| 594 | _ssl__SSLContext_session_stats(PySSLContext *self, PyObject *Py_UNUSED(ignored)) |
| 595 | { |
| 596 | return _ssl__SSLContext_session_stats_impl(self); |
| 597 | } |
| 598 | |
| 599 | PyDoc_STRVAR(_ssl__SSLContext_set_default_verify_paths__doc__, |
| 600 | "set_default_verify_paths($self, /)\n" |
| 601 | "--\n" |
| 602 | "\n"); |
| 603 | |
| 604 | #define _SSL__SSLCONTEXT_SET_DEFAULT_VERIFY_PATHS_METHODDEF \ |
| 605 | {"set_default_verify_paths", (PyCFunction)_ssl__SSLContext_set_default_verify_paths, METH_NOARGS, _ssl__SSLContext_set_default_verify_paths__doc__}, |
| 606 | |
| 607 | static PyObject * |
| 608 | _ssl__SSLContext_set_default_verify_paths_impl(PySSLContext *self); |
| 609 | |
| 610 | static PyObject * |
| 611 | _ssl__SSLContext_set_default_verify_paths(PySSLContext *self, PyObject *Py_UNUSED(ignored)) |
| 612 | { |
| 613 | return _ssl__SSLContext_set_default_verify_paths_impl(self); |
| 614 | } |
| 615 | |
| 616 | #if !defined(OPENSSL_NO_ECDH) |
| 617 | |
| 618 | PyDoc_STRVAR(_ssl__SSLContext_set_ecdh_curve__doc__, |
| 619 | "set_ecdh_curve($self, name, /)\n" |
| 620 | "--\n" |
| 621 | "\n"); |
| 622 | |
| 623 | #define _SSL__SSLCONTEXT_SET_ECDH_CURVE_METHODDEF \ |
| 624 | {"set_ecdh_curve", (PyCFunction)_ssl__SSLContext_set_ecdh_curve, METH_O, _ssl__SSLContext_set_ecdh_curve__doc__}, |
| 625 | |
| 626 | #endif /* !defined(OPENSSL_NO_ECDH) */ |
| 627 | |
| 628 | PyDoc_STRVAR(_ssl__SSLContext_set_servername_callback__doc__, |
| 629 | "set_servername_callback($self, method, /)\n" |
| 630 | "--\n" |
| 631 | "\n" |
| 632 | "Set a callback that will be called when a server name is provided by the SSL/TLS client in the SNI extension.\n" |
| 633 | "\n" |
| 634 | "If the argument is None then the callback is disabled. The method is called\n" |
| 635 | "with the SSLSocket, the server name as a string, and the SSLContext object.\n" |
| 636 | "See RFC 6066 for details of the SNI extension."); |
| 637 | |
| 638 | #define _SSL__SSLCONTEXT_SET_SERVERNAME_CALLBACK_METHODDEF \ |
| 639 | {"set_servername_callback", (PyCFunction)_ssl__SSLContext_set_servername_callback, METH_O, _ssl__SSLContext_set_servername_callback__doc__}, |
| 640 | |
| 641 | PyDoc_STRVAR(_ssl__SSLContext_cert_store_stats__doc__, |
| 642 | "cert_store_stats($self, /)\n" |
| 643 | "--\n" |
| 644 | "\n" |
| 645 | "Returns quantities of loaded X.509 certificates.\n" |
| 646 | "\n" |
| 647 | "X.509 certificates with a CA extension and certificate revocation lists\n" |
| 648 | "inside the context\'s cert store.\n" |
| 649 | "\n" |
| 650 | "NOTE: Certificates in a capath directory aren\'t loaded unless they have\n" |
| 651 | "been used at least once."); |
| 652 | |
| 653 | #define _SSL__SSLCONTEXT_CERT_STORE_STATS_METHODDEF \ |
| 654 | {"cert_store_stats", (PyCFunction)_ssl__SSLContext_cert_store_stats, METH_NOARGS, _ssl__SSLContext_cert_store_stats__doc__}, |
| 655 | |
| 656 | static PyObject * |
| 657 | _ssl__SSLContext_cert_store_stats_impl(PySSLContext *self); |
| 658 | |
| 659 | static PyObject * |
| 660 | _ssl__SSLContext_cert_store_stats(PySSLContext *self, PyObject *Py_UNUSED(ignored)) |
| 661 | { |
| 662 | return _ssl__SSLContext_cert_store_stats_impl(self); |
| 663 | } |
| 664 | |
| 665 | PyDoc_STRVAR(_ssl__SSLContext_get_ca_certs__doc__, |
| 666 | "get_ca_certs($self, /, binary_form=False)\n" |
| 667 | "--\n" |
| 668 | "\n" |
| 669 | "Returns a list of dicts with information of loaded CA certs.\n" |
| 670 | "\n" |
| 671 | "If the optional argument is True, returns a DER-encoded copy of the CA\n" |
| 672 | "certificate.\n" |
| 673 | "\n" |
| 674 | "NOTE: Certificates in a capath directory aren\'t loaded unless they have\n" |
| 675 | "been used at least once."); |
| 676 | |
| 677 | #define _SSL__SSLCONTEXT_GET_CA_CERTS_METHODDEF \ |
| 678 | {"get_ca_certs", (PyCFunction)_ssl__SSLContext_get_ca_certs, METH_VARARGS|METH_KEYWORDS, _ssl__SSLContext_get_ca_certs__doc__}, |
| 679 | |
| 680 | static PyObject * |
| 681 | _ssl__SSLContext_get_ca_certs_impl(PySSLContext *self, int binary_form); |
| 682 | |
| 683 | static PyObject * |
| 684 | _ssl__SSLContext_get_ca_certs(PySSLContext *self, PyObject *args, PyObject *kwargs) |
| 685 | { |
| 686 | PyObject *return_value = NULL; |
| 687 | static char *_keywords[] = {"binary_form", NULL}; |
| 688 | int binary_form = 0; |
| 689 | |
| 690 | if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|p:get_ca_certs", _keywords, |
Serhiy Storchaka | 5dee655 | 2016-06-09 16:16:06 +0300 | [diff] [blame] | 691 | &binary_form)) { |
Serhiy Storchaka | 4b7b82f | 2015-05-03 16:14:08 +0300 | [diff] [blame] | 692 | goto exit; |
Serhiy Storchaka | 5dee655 | 2016-06-09 16:16:06 +0300 | [diff] [blame] | 693 | } |
Serhiy Storchaka | 4b7b82f | 2015-05-03 16:14:08 +0300 | [diff] [blame] | 694 | return_value = _ssl__SSLContext_get_ca_certs_impl(self, binary_form); |
| 695 | |
| 696 | exit: |
| 697 | return return_value; |
| 698 | } |
| 699 | |
| 700 | static PyObject * |
| 701 | _ssl_MemoryBIO_impl(PyTypeObject *type); |
| 702 | |
| 703 | static PyObject * |
| 704 | _ssl_MemoryBIO(PyTypeObject *type, PyObject *args, PyObject *kwargs) |
| 705 | { |
| 706 | PyObject *return_value = NULL; |
| 707 | |
| 708 | if ((type == &PySSLMemoryBIO_Type) && |
Serhiy Storchaka | 5dee655 | 2016-06-09 16:16:06 +0300 | [diff] [blame] | 709 | !_PyArg_NoPositional("MemoryBIO", args)) { |
Serhiy Storchaka | 4b7b82f | 2015-05-03 16:14:08 +0300 | [diff] [blame] | 710 | goto exit; |
Serhiy Storchaka | 5dee655 | 2016-06-09 16:16:06 +0300 | [diff] [blame] | 711 | } |
Serhiy Storchaka | 4b7b82f | 2015-05-03 16:14:08 +0300 | [diff] [blame] | 712 | if ((type == &PySSLMemoryBIO_Type) && |
Serhiy Storchaka | 5dee655 | 2016-06-09 16:16:06 +0300 | [diff] [blame] | 713 | !_PyArg_NoKeywords("MemoryBIO", kwargs)) { |
Serhiy Storchaka | 4b7b82f | 2015-05-03 16:14:08 +0300 | [diff] [blame] | 714 | goto exit; |
Serhiy Storchaka | 5dee655 | 2016-06-09 16:16:06 +0300 | [diff] [blame] | 715 | } |
Serhiy Storchaka | 4b7b82f | 2015-05-03 16:14:08 +0300 | [diff] [blame] | 716 | return_value = _ssl_MemoryBIO_impl(type); |
| 717 | |
| 718 | exit: |
| 719 | return return_value; |
| 720 | } |
| 721 | |
| 722 | PyDoc_STRVAR(_ssl_MemoryBIO_read__doc__, |
| 723 | "read($self, size=-1, /)\n" |
| 724 | "--\n" |
| 725 | "\n" |
| 726 | "Read up to size bytes from the memory BIO.\n" |
| 727 | "\n" |
| 728 | "If size is not specified, read the entire buffer.\n" |
| 729 | "If the return value is an empty bytes instance, this means either\n" |
| 730 | "EOF or that no data is available. Use the \"eof\" property to\n" |
| 731 | "distinguish between the two."); |
| 732 | |
| 733 | #define _SSL_MEMORYBIO_READ_METHODDEF \ |
| 734 | {"read", (PyCFunction)_ssl_MemoryBIO_read, METH_VARARGS, _ssl_MemoryBIO_read__doc__}, |
| 735 | |
| 736 | static PyObject * |
| 737 | _ssl_MemoryBIO_read_impl(PySSLMemoryBIO *self, int len); |
| 738 | |
| 739 | static PyObject * |
| 740 | _ssl_MemoryBIO_read(PySSLMemoryBIO *self, PyObject *args) |
| 741 | { |
| 742 | PyObject *return_value = NULL; |
| 743 | int len = -1; |
| 744 | |
| 745 | if (!PyArg_ParseTuple(args, "|i:read", |
Serhiy Storchaka | 5dee655 | 2016-06-09 16:16:06 +0300 | [diff] [blame] | 746 | &len)) { |
Serhiy Storchaka | 4b7b82f | 2015-05-03 16:14:08 +0300 | [diff] [blame] | 747 | goto exit; |
Serhiy Storchaka | 5dee655 | 2016-06-09 16:16:06 +0300 | [diff] [blame] | 748 | } |
Serhiy Storchaka | 4b7b82f | 2015-05-03 16:14:08 +0300 | [diff] [blame] | 749 | return_value = _ssl_MemoryBIO_read_impl(self, len); |
| 750 | |
| 751 | exit: |
| 752 | return return_value; |
| 753 | } |
| 754 | |
| 755 | PyDoc_STRVAR(_ssl_MemoryBIO_write__doc__, |
| 756 | "write($self, b, /)\n" |
| 757 | "--\n" |
| 758 | "\n" |
| 759 | "Writes the bytes b into the memory BIO.\n" |
| 760 | "\n" |
| 761 | "Returns the number of bytes written."); |
| 762 | |
| 763 | #define _SSL_MEMORYBIO_WRITE_METHODDEF \ |
| 764 | {"write", (PyCFunction)_ssl_MemoryBIO_write, METH_O, _ssl_MemoryBIO_write__doc__}, |
| 765 | |
| 766 | static PyObject * |
| 767 | _ssl_MemoryBIO_write_impl(PySSLMemoryBIO *self, Py_buffer *b); |
| 768 | |
| 769 | static PyObject * |
| 770 | _ssl_MemoryBIO_write(PySSLMemoryBIO *self, PyObject *arg) |
| 771 | { |
| 772 | PyObject *return_value = NULL; |
| 773 | Py_buffer b = {NULL, NULL}; |
| 774 | |
Serhiy Storchaka | 5dee655 | 2016-06-09 16:16:06 +0300 | [diff] [blame] | 775 | if (!PyArg_Parse(arg, "y*:write", &b)) { |
Serhiy Storchaka | 4b7b82f | 2015-05-03 16:14:08 +0300 | [diff] [blame] | 776 | goto exit; |
Serhiy Storchaka | 5dee655 | 2016-06-09 16:16:06 +0300 | [diff] [blame] | 777 | } |
Serhiy Storchaka | 4b7b82f | 2015-05-03 16:14:08 +0300 | [diff] [blame] | 778 | return_value = _ssl_MemoryBIO_write_impl(self, &b); |
| 779 | |
| 780 | exit: |
| 781 | /* Cleanup for b */ |
Serhiy Storchaka | 5dee655 | 2016-06-09 16:16:06 +0300 | [diff] [blame] | 782 | if (b.obj) { |
Serhiy Storchaka | 4b7b82f | 2015-05-03 16:14:08 +0300 | [diff] [blame] | 783 | PyBuffer_Release(&b); |
Serhiy Storchaka | 5dee655 | 2016-06-09 16:16:06 +0300 | [diff] [blame] | 784 | } |
Serhiy Storchaka | 4b7b82f | 2015-05-03 16:14:08 +0300 | [diff] [blame] | 785 | |
| 786 | return return_value; |
| 787 | } |
| 788 | |
| 789 | PyDoc_STRVAR(_ssl_MemoryBIO_write_eof__doc__, |
| 790 | "write_eof($self, /)\n" |
| 791 | "--\n" |
| 792 | "\n" |
| 793 | "Write an EOF marker to the memory BIO.\n" |
| 794 | "\n" |
| 795 | "When all data has been read, the \"eof\" property will be True."); |
| 796 | |
| 797 | #define _SSL_MEMORYBIO_WRITE_EOF_METHODDEF \ |
| 798 | {"write_eof", (PyCFunction)_ssl_MemoryBIO_write_eof, METH_NOARGS, _ssl_MemoryBIO_write_eof__doc__}, |
| 799 | |
| 800 | static PyObject * |
| 801 | _ssl_MemoryBIO_write_eof_impl(PySSLMemoryBIO *self); |
| 802 | |
| 803 | static PyObject * |
| 804 | _ssl_MemoryBIO_write_eof(PySSLMemoryBIO *self, PyObject *Py_UNUSED(ignored)) |
| 805 | { |
| 806 | return _ssl_MemoryBIO_write_eof_impl(self); |
| 807 | } |
| 808 | |
| 809 | PyDoc_STRVAR(_ssl_RAND_add__doc__, |
| 810 | "RAND_add($module, string, entropy, /)\n" |
| 811 | "--\n" |
| 812 | "\n" |
| 813 | "Mix string into the OpenSSL PRNG state.\n" |
| 814 | "\n" |
| 815 | "entropy (a float) is a lower bound on the entropy contained in\n" |
| 816 | "string. See RFC 1750."); |
| 817 | |
| 818 | #define _SSL_RAND_ADD_METHODDEF \ |
| 819 | {"RAND_add", (PyCFunction)_ssl_RAND_add, METH_VARARGS, _ssl_RAND_add__doc__}, |
| 820 | |
| 821 | static PyObject * |
| 822 | _ssl_RAND_add_impl(PyModuleDef *module, Py_buffer *view, double entropy); |
| 823 | |
| 824 | static PyObject * |
| 825 | _ssl_RAND_add(PyModuleDef *module, PyObject *args) |
| 826 | { |
| 827 | PyObject *return_value = NULL; |
| 828 | Py_buffer view = {NULL, NULL}; |
| 829 | double entropy; |
| 830 | |
| 831 | if (!PyArg_ParseTuple(args, "s*d:RAND_add", |
Serhiy Storchaka | 5dee655 | 2016-06-09 16:16:06 +0300 | [diff] [blame] | 832 | &view, &entropy)) { |
Serhiy Storchaka | 4b7b82f | 2015-05-03 16:14:08 +0300 | [diff] [blame] | 833 | goto exit; |
Serhiy Storchaka | 5dee655 | 2016-06-09 16:16:06 +0300 | [diff] [blame] | 834 | } |
Serhiy Storchaka | 4b7b82f | 2015-05-03 16:14:08 +0300 | [diff] [blame] | 835 | return_value = _ssl_RAND_add_impl(module, &view, entropy); |
| 836 | |
| 837 | exit: |
| 838 | /* Cleanup for view */ |
Serhiy Storchaka | 5dee655 | 2016-06-09 16:16:06 +0300 | [diff] [blame] | 839 | if (view.obj) { |
Serhiy Storchaka | 4b7b82f | 2015-05-03 16:14:08 +0300 | [diff] [blame] | 840 | PyBuffer_Release(&view); |
Serhiy Storchaka | 5dee655 | 2016-06-09 16:16:06 +0300 | [diff] [blame] | 841 | } |
Serhiy Storchaka | 4b7b82f | 2015-05-03 16:14:08 +0300 | [diff] [blame] | 842 | |
| 843 | return return_value; |
| 844 | } |
| 845 | |
| 846 | PyDoc_STRVAR(_ssl_RAND_bytes__doc__, |
| 847 | "RAND_bytes($module, n, /)\n" |
| 848 | "--\n" |
| 849 | "\n" |
| 850 | "Generate n cryptographically strong pseudo-random bytes."); |
| 851 | |
| 852 | #define _SSL_RAND_BYTES_METHODDEF \ |
| 853 | {"RAND_bytes", (PyCFunction)_ssl_RAND_bytes, METH_O, _ssl_RAND_bytes__doc__}, |
| 854 | |
| 855 | static PyObject * |
| 856 | _ssl_RAND_bytes_impl(PyModuleDef *module, int n); |
| 857 | |
| 858 | static PyObject * |
| 859 | _ssl_RAND_bytes(PyModuleDef *module, PyObject *arg) |
| 860 | { |
| 861 | PyObject *return_value = NULL; |
| 862 | int n; |
| 863 | |
Serhiy Storchaka | 5dee655 | 2016-06-09 16:16:06 +0300 | [diff] [blame] | 864 | if (!PyArg_Parse(arg, "i:RAND_bytes", &n)) { |
Serhiy Storchaka | 4b7b82f | 2015-05-03 16:14:08 +0300 | [diff] [blame] | 865 | goto exit; |
Serhiy Storchaka | 5dee655 | 2016-06-09 16:16:06 +0300 | [diff] [blame] | 866 | } |
Serhiy Storchaka | 4b7b82f | 2015-05-03 16:14:08 +0300 | [diff] [blame] | 867 | return_value = _ssl_RAND_bytes_impl(module, n); |
| 868 | |
| 869 | exit: |
| 870 | return return_value; |
| 871 | } |
| 872 | |
| 873 | PyDoc_STRVAR(_ssl_RAND_pseudo_bytes__doc__, |
| 874 | "RAND_pseudo_bytes($module, n, /)\n" |
| 875 | "--\n" |
| 876 | "\n" |
| 877 | "Generate n pseudo-random bytes.\n" |
| 878 | "\n" |
| 879 | "Return a pair (bytes, is_cryptographic). is_cryptographic is True\n" |
| 880 | "if the bytes generated are cryptographically strong."); |
| 881 | |
| 882 | #define _SSL_RAND_PSEUDO_BYTES_METHODDEF \ |
| 883 | {"RAND_pseudo_bytes", (PyCFunction)_ssl_RAND_pseudo_bytes, METH_O, _ssl_RAND_pseudo_bytes__doc__}, |
| 884 | |
| 885 | static PyObject * |
| 886 | _ssl_RAND_pseudo_bytes_impl(PyModuleDef *module, int n); |
| 887 | |
| 888 | static PyObject * |
| 889 | _ssl_RAND_pseudo_bytes(PyModuleDef *module, PyObject *arg) |
| 890 | { |
| 891 | PyObject *return_value = NULL; |
| 892 | int n; |
| 893 | |
Serhiy Storchaka | 5dee655 | 2016-06-09 16:16:06 +0300 | [diff] [blame] | 894 | if (!PyArg_Parse(arg, "i:RAND_pseudo_bytes", &n)) { |
Serhiy Storchaka | 4b7b82f | 2015-05-03 16:14:08 +0300 | [diff] [blame] | 895 | goto exit; |
Serhiy Storchaka | 5dee655 | 2016-06-09 16:16:06 +0300 | [diff] [blame] | 896 | } |
Serhiy Storchaka | 4b7b82f | 2015-05-03 16:14:08 +0300 | [diff] [blame] | 897 | return_value = _ssl_RAND_pseudo_bytes_impl(module, n); |
| 898 | |
| 899 | exit: |
| 900 | return return_value; |
| 901 | } |
| 902 | |
| 903 | PyDoc_STRVAR(_ssl_RAND_status__doc__, |
| 904 | "RAND_status($module, /)\n" |
| 905 | "--\n" |
| 906 | "\n" |
| 907 | "Returns 1 if the OpenSSL PRNG has been seeded with enough data and 0 if not.\n" |
| 908 | "\n" |
| 909 | "It is necessary to seed the PRNG with RAND_add() on some platforms before\n" |
| 910 | "using the ssl() function."); |
| 911 | |
| 912 | #define _SSL_RAND_STATUS_METHODDEF \ |
| 913 | {"RAND_status", (PyCFunction)_ssl_RAND_status, METH_NOARGS, _ssl_RAND_status__doc__}, |
| 914 | |
| 915 | static PyObject * |
| 916 | _ssl_RAND_status_impl(PyModuleDef *module); |
| 917 | |
| 918 | static PyObject * |
| 919 | _ssl_RAND_status(PyModuleDef *module, PyObject *Py_UNUSED(ignored)) |
| 920 | { |
| 921 | return _ssl_RAND_status_impl(module); |
| 922 | } |
| 923 | |
| 924 | #if defined(HAVE_RAND_EGD) |
| 925 | |
| 926 | PyDoc_STRVAR(_ssl_RAND_egd__doc__, |
| 927 | "RAND_egd($module, path, /)\n" |
| 928 | "--\n" |
| 929 | "\n" |
| 930 | "Queries the entropy gather daemon (EGD) on the socket named by \'path\'.\n" |
| 931 | "\n" |
| 932 | "Returns number of bytes read. Raises SSLError if connection to EGD\n" |
| 933 | "fails or if it does not provide enough data to seed PRNG."); |
| 934 | |
| 935 | #define _SSL_RAND_EGD_METHODDEF \ |
| 936 | {"RAND_egd", (PyCFunction)_ssl_RAND_egd, METH_O, _ssl_RAND_egd__doc__}, |
| 937 | |
| 938 | static PyObject * |
| 939 | _ssl_RAND_egd_impl(PyModuleDef *module, PyObject *path); |
| 940 | |
| 941 | static PyObject * |
| 942 | _ssl_RAND_egd(PyModuleDef *module, PyObject *arg) |
| 943 | { |
| 944 | PyObject *return_value = NULL; |
| 945 | PyObject *path; |
| 946 | |
Serhiy Storchaka | 5dee655 | 2016-06-09 16:16:06 +0300 | [diff] [blame] | 947 | if (!PyArg_Parse(arg, "O&:RAND_egd", PyUnicode_FSConverter, &path)) { |
Serhiy Storchaka | 4b7b82f | 2015-05-03 16:14:08 +0300 | [diff] [blame] | 948 | goto exit; |
Serhiy Storchaka | 5dee655 | 2016-06-09 16:16:06 +0300 | [diff] [blame] | 949 | } |
Serhiy Storchaka | 4b7b82f | 2015-05-03 16:14:08 +0300 | [diff] [blame] | 950 | return_value = _ssl_RAND_egd_impl(module, path); |
| 951 | |
| 952 | exit: |
| 953 | return return_value; |
| 954 | } |
| 955 | |
| 956 | #endif /* defined(HAVE_RAND_EGD) */ |
| 957 | |
| 958 | PyDoc_STRVAR(_ssl_get_default_verify_paths__doc__, |
| 959 | "get_default_verify_paths($module, /)\n" |
| 960 | "--\n" |
| 961 | "\n" |
| 962 | "Return search paths and environment vars that are used by SSLContext\'s set_default_verify_paths() to load default CAs.\n" |
| 963 | "\n" |
| 964 | "The values are \'cert_file_env\', \'cert_file\', \'cert_dir_env\', \'cert_dir\'."); |
| 965 | |
| 966 | #define _SSL_GET_DEFAULT_VERIFY_PATHS_METHODDEF \ |
| 967 | {"get_default_verify_paths", (PyCFunction)_ssl_get_default_verify_paths, METH_NOARGS, _ssl_get_default_verify_paths__doc__}, |
| 968 | |
| 969 | static PyObject * |
| 970 | _ssl_get_default_verify_paths_impl(PyModuleDef *module); |
| 971 | |
| 972 | static PyObject * |
| 973 | _ssl_get_default_verify_paths(PyModuleDef *module, PyObject *Py_UNUSED(ignored)) |
| 974 | { |
| 975 | return _ssl_get_default_verify_paths_impl(module); |
| 976 | } |
| 977 | |
| 978 | PyDoc_STRVAR(_ssl_txt2obj__doc__, |
| 979 | "txt2obj($module, /, txt, name=False)\n" |
| 980 | "--\n" |
| 981 | "\n" |
| 982 | "Lookup NID, short name, long name and OID of an ASN1_OBJECT.\n" |
| 983 | "\n" |
| 984 | "By default objects are looked up by OID. With name=True short and\n" |
| 985 | "long name are also matched."); |
| 986 | |
| 987 | #define _SSL_TXT2OBJ_METHODDEF \ |
| 988 | {"txt2obj", (PyCFunction)_ssl_txt2obj, METH_VARARGS|METH_KEYWORDS, _ssl_txt2obj__doc__}, |
| 989 | |
| 990 | static PyObject * |
| 991 | _ssl_txt2obj_impl(PyModuleDef *module, const char *txt, int name); |
| 992 | |
| 993 | static PyObject * |
| 994 | _ssl_txt2obj(PyModuleDef *module, PyObject *args, PyObject *kwargs) |
| 995 | { |
| 996 | PyObject *return_value = NULL; |
| 997 | static char *_keywords[] = {"txt", "name", NULL}; |
| 998 | const char *txt; |
| 999 | int name = 0; |
| 1000 | |
| 1001 | if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s|p:txt2obj", _keywords, |
Serhiy Storchaka | 5dee655 | 2016-06-09 16:16:06 +0300 | [diff] [blame] | 1002 | &txt, &name)) { |
Serhiy Storchaka | 4b7b82f | 2015-05-03 16:14:08 +0300 | [diff] [blame] | 1003 | goto exit; |
Serhiy Storchaka | 5dee655 | 2016-06-09 16:16:06 +0300 | [diff] [blame] | 1004 | } |
Serhiy Storchaka | 4b7b82f | 2015-05-03 16:14:08 +0300 | [diff] [blame] | 1005 | return_value = _ssl_txt2obj_impl(module, txt, name); |
| 1006 | |
| 1007 | exit: |
| 1008 | return return_value; |
| 1009 | } |
| 1010 | |
| 1011 | PyDoc_STRVAR(_ssl_nid2obj__doc__, |
| 1012 | "nid2obj($module, nid, /)\n" |
| 1013 | "--\n" |
| 1014 | "\n" |
| 1015 | "Lookup NID, short name, long name and OID of an ASN1_OBJECT by NID."); |
| 1016 | |
| 1017 | #define _SSL_NID2OBJ_METHODDEF \ |
| 1018 | {"nid2obj", (PyCFunction)_ssl_nid2obj, METH_O, _ssl_nid2obj__doc__}, |
| 1019 | |
| 1020 | static PyObject * |
| 1021 | _ssl_nid2obj_impl(PyModuleDef *module, int nid); |
| 1022 | |
| 1023 | static PyObject * |
| 1024 | _ssl_nid2obj(PyModuleDef *module, PyObject *arg) |
| 1025 | { |
| 1026 | PyObject *return_value = NULL; |
| 1027 | int nid; |
| 1028 | |
Serhiy Storchaka | 5dee655 | 2016-06-09 16:16:06 +0300 | [diff] [blame] | 1029 | if (!PyArg_Parse(arg, "i:nid2obj", &nid)) { |
Serhiy Storchaka | 4b7b82f | 2015-05-03 16:14:08 +0300 | [diff] [blame] | 1030 | goto exit; |
Serhiy Storchaka | 5dee655 | 2016-06-09 16:16:06 +0300 | [diff] [blame] | 1031 | } |
Serhiy Storchaka | 4b7b82f | 2015-05-03 16:14:08 +0300 | [diff] [blame] | 1032 | return_value = _ssl_nid2obj_impl(module, nid); |
| 1033 | |
| 1034 | exit: |
| 1035 | return return_value; |
| 1036 | } |
| 1037 | |
| 1038 | #if defined(_MSC_VER) |
| 1039 | |
| 1040 | PyDoc_STRVAR(_ssl_enum_certificates__doc__, |
| 1041 | "enum_certificates($module, /, store_name)\n" |
| 1042 | "--\n" |
| 1043 | "\n" |
| 1044 | "Retrieve certificates from Windows\' cert store.\n" |
| 1045 | "\n" |
| 1046 | "store_name may be one of \'CA\', \'ROOT\' or \'MY\'. The system may provide\n" |
| 1047 | "more cert storages, too. The function returns a list of (bytes,\n" |
| 1048 | "encoding_type, trust) tuples. The encoding_type flag can be interpreted\n" |
| 1049 | "with X509_ASN_ENCODING or PKCS_7_ASN_ENCODING. The trust setting is either\n" |
| 1050 | "a set of OIDs or the boolean True."); |
| 1051 | |
| 1052 | #define _SSL_ENUM_CERTIFICATES_METHODDEF \ |
| 1053 | {"enum_certificates", (PyCFunction)_ssl_enum_certificates, METH_VARARGS|METH_KEYWORDS, _ssl_enum_certificates__doc__}, |
| 1054 | |
| 1055 | static PyObject * |
| 1056 | _ssl_enum_certificates_impl(PyModuleDef *module, const char *store_name); |
| 1057 | |
| 1058 | static PyObject * |
| 1059 | _ssl_enum_certificates(PyModuleDef *module, PyObject *args, PyObject *kwargs) |
| 1060 | { |
| 1061 | PyObject *return_value = NULL; |
| 1062 | static char *_keywords[] = {"store_name", NULL}; |
| 1063 | const char *store_name; |
| 1064 | |
| 1065 | if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s:enum_certificates", _keywords, |
Serhiy Storchaka | 5dee655 | 2016-06-09 16:16:06 +0300 | [diff] [blame] | 1066 | &store_name)) { |
Serhiy Storchaka | 4b7b82f | 2015-05-03 16:14:08 +0300 | [diff] [blame] | 1067 | goto exit; |
Serhiy Storchaka | 5dee655 | 2016-06-09 16:16:06 +0300 | [diff] [blame] | 1068 | } |
Serhiy Storchaka | 4b7b82f | 2015-05-03 16:14:08 +0300 | [diff] [blame] | 1069 | return_value = _ssl_enum_certificates_impl(module, store_name); |
| 1070 | |
| 1071 | exit: |
| 1072 | return return_value; |
| 1073 | } |
| 1074 | |
| 1075 | #endif /* defined(_MSC_VER) */ |
| 1076 | |
| 1077 | #if defined(_MSC_VER) |
| 1078 | |
| 1079 | PyDoc_STRVAR(_ssl_enum_crls__doc__, |
| 1080 | "enum_crls($module, /, store_name)\n" |
| 1081 | "--\n" |
| 1082 | "\n" |
| 1083 | "Retrieve CRLs from Windows\' cert store.\n" |
| 1084 | "\n" |
| 1085 | "store_name may be one of \'CA\', \'ROOT\' or \'MY\'. The system may provide\n" |
| 1086 | "more cert storages, too. The function returns a list of (bytes,\n" |
| 1087 | "encoding_type) tuples. The encoding_type flag can be interpreted with\n" |
| 1088 | "X509_ASN_ENCODING or PKCS_7_ASN_ENCODING."); |
| 1089 | |
| 1090 | #define _SSL_ENUM_CRLS_METHODDEF \ |
| 1091 | {"enum_crls", (PyCFunction)_ssl_enum_crls, METH_VARARGS|METH_KEYWORDS, _ssl_enum_crls__doc__}, |
| 1092 | |
| 1093 | static PyObject * |
| 1094 | _ssl_enum_crls_impl(PyModuleDef *module, const char *store_name); |
| 1095 | |
| 1096 | static PyObject * |
| 1097 | _ssl_enum_crls(PyModuleDef *module, PyObject *args, PyObject *kwargs) |
| 1098 | { |
| 1099 | PyObject *return_value = NULL; |
| 1100 | static char *_keywords[] = {"store_name", NULL}; |
| 1101 | const char *store_name; |
| 1102 | |
| 1103 | if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s:enum_crls", _keywords, |
Serhiy Storchaka | 5dee655 | 2016-06-09 16:16:06 +0300 | [diff] [blame] | 1104 | &store_name)) { |
Serhiy Storchaka | 4b7b82f | 2015-05-03 16:14:08 +0300 | [diff] [blame] | 1105 | goto exit; |
Serhiy Storchaka | 5dee655 | 2016-06-09 16:16:06 +0300 | [diff] [blame] | 1106 | } |
Serhiy Storchaka | 4b7b82f | 2015-05-03 16:14:08 +0300 | [diff] [blame] | 1107 | return_value = _ssl_enum_crls_impl(module, store_name); |
| 1108 | |
| 1109 | exit: |
| 1110 | return return_value; |
| 1111 | } |
| 1112 | |
| 1113 | #endif /* defined(_MSC_VER) */ |
| 1114 | |
| 1115 | #ifndef _SSL__SSLSOCKET_SELECTED_NPN_PROTOCOL_METHODDEF |
| 1116 | #define _SSL__SSLSOCKET_SELECTED_NPN_PROTOCOL_METHODDEF |
| 1117 | #endif /* !defined(_SSL__SSLSOCKET_SELECTED_NPN_PROTOCOL_METHODDEF) */ |
| 1118 | |
| 1119 | #ifndef _SSL__SSLSOCKET_SELECTED_ALPN_PROTOCOL_METHODDEF |
| 1120 | #define _SSL__SSLSOCKET_SELECTED_ALPN_PROTOCOL_METHODDEF |
| 1121 | #endif /* !defined(_SSL__SSLSOCKET_SELECTED_ALPN_PROTOCOL_METHODDEF) */ |
| 1122 | |
| 1123 | #ifndef _SSL__SSLCONTEXT_SET_ECDH_CURVE_METHODDEF |
| 1124 | #define _SSL__SSLCONTEXT_SET_ECDH_CURVE_METHODDEF |
| 1125 | #endif /* !defined(_SSL__SSLCONTEXT_SET_ECDH_CURVE_METHODDEF) */ |
| 1126 | |
| 1127 | #ifndef _SSL_RAND_EGD_METHODDEF |
| 1128 | #define _SSL_RAND_EGD_METHODDEF |
| 1129 | #endif /* !defined(_SSL_RAND_EGD_METHODDEF) */ |
| 1130 | |
| 1131 | #ifndef _SSL_ENUM_CERTIFICATES_METHODDEF |
| 1132 | #define _SSL_ENUM_CERTIFICATES_METHODDEF |
| 1133 | #endif /* !defined(_SSL_ENUM_CERTIFICATES_METHODDEF) */ |
| 1134 | |
| 1135 | #ifndef _SSL_ENUM_CRLS_METHODDEF |
| 1136 | #define _SSL_ENUM_CRLS_METHODDEF |
| 1137 | #endif /* !defined(_SSL_ENUM_CRLS_METHODDEF) */ |
Serhiy Storchaka | 5dee655 | 2016-06-09 16:16:06 +0300 | [diff] [blame] | 1138 | /*[clinic end generated code: output=c6fe203099a5aa89 input=a9049054013a1b77]*/ |