summaryrefslogtreecommitdiffstats
path: root/Modules/_ssl.c
Commit message (Collapse)AuthorAgeFilesLines
* Issue #7133: SSL objects now support the new buffer API.Antoine Pitrou2009-10-191-11/+16
| | | | This fixes the test_ssl failure.
* Fix nearly all compilation warnings under Apple gcc-4.0. Tested with OPT="-gJeffrey Yasskin2009-05-291-1/+1
| | | | | | -Wall -Wstrict-prototypes -Werror" in both --with-pydebug mode and --without. There's still a batch of non-prototype warnings in Xlib.h that I don't know how to fix.
* Fix signed/unsigned mismatch.Raymond Hettinger2009-01-261-1/+1
|
* various SSL fixes; issues 1251, 3162, 3212Bill Janssen2008-06-281-58/+145
|
* This reverts r63675 based on the discussion in this thread:Gregory P. Smith2008-06-091-21/+21
| | | | | | | http://mail.python.org/pipermail/python-dev/2008-June/079988.html Python 2.6 should stick with PyString_* in its codebase. The PyBytes_* names in the spirit of 3.0 are available via a #define only. See the email thread.
* Renamed PyString to PyBytesChristian Heimes2008-05-261-21/+21
|
* Fix compiler warningsNeal Norwitz2008-03-271-2/+2
|
* Initialize variable to prevent warning on some platform/config.Neal Norwitz2008-01-271-2/+2
|
* #1629: Renamed Py_Size, Py_Type and Py_Refcnt to Py_SIZE, Py_TYPE and ↵Christian Heimes2007-12-191-3/+3
| | | | Py_REFCNT. Macros for b/w compatibility are available.
* Fixed warning in ssl moduleChristian Heimes2007-12-141-1/+1
|
* Add support for asyncore server-side SSL support. This requiresBill Janssen2007-09-161-49/+4
| | | | | | | | | | | | | | | adding the 'makefile' method to ssl.SSLSocket, and importing the requisite fakefile class from socket.py, and making the appropriate changes to it to make it use the SSL connection. Added sample HTTPS server to test_ssl.py, and test that uses it. Change SSL tests to use https://svn.python.org/, instead of www.sf.net and pop.gmail.com. Added utility function to ssl module, get_server_certificate, to wrap up the several things to be done to pull a certificate from a remote server.
* More work on SSL support.Bill Janssen2007-09-101-131/+672
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Much expanded test suite: All protocols tested against all other protocols. All protocols tested with all certificate options. Tests for bad key and bad cert. Test of STARTTLS functionality. Test of RAND_* functions. * Fixes for threading/malloc bug. * Issue 1065 fixed: sslsocket class renamed to SSLSocket. sslerror class renamed to SSLError. Function "wrap_socket" now used to wrap an existing socket. * Issue 1583946 finally fixed: Support for subjectAltName added. Subject name now returned as proper DN list of RDNs. * SSLError exported from socket as "sslerror". * RAND_* functions properly exported from ssl.py. * Documentation improved: Example of how to create a self-signed certificate. Better indexing.
* SSL certificate distinguished names should be represented by tuplesBill Janssen2007-09-051-10/+15
|
* > Some of the code sets the error string in this directly beforeGuido van Rossum2007-08-271-88/+110
| | | | | | | | | | | | | | | | | | | | | | | | | | | > returning NULL, and other pieces of the code call PySSL_SetError, > which creates the error string. I think some of the places which set > the string directly probably shouldn't; instead, they should call > PySSL_SetError to cons up the error name directly from the err code. > However, PySSL_SetError only works after the construction of an ssl > object, which means it can't be used there... I'll take a longer look > at it and see if there's a reasonable fix. Here's a patch which addresses this. It also fixes the indentation in PySSL_SetError, bringing it into line with PEP 7, fixes a compile warning about one of the OpenSSL macros, and makes the namespace a bit more consistent. I've tested it on FC 7 and OS X 10.4. % ./python ./Lib/test/regrtest.py -R :1: -u all test_ssl test_ssl beginning 6 repetitions 123456 ...... 1 test OK. [29244 refs] % [GvR: slightly edited to enforce 79-char line length, even if it required violating the style guide.]
* Fix a few more variables to try to get this to compile with Visual Studio.Neal Norwitz2007-08-251-2/+3
|
* Try to get this to build with Visual Studio by moving all the variableNeal Norwitz2007-08-251-17/+24
| | | | declarations to the beginning of a scope.
* Server-side SSL and certificate validation, by Bill Janssen.Guido van Rossum2007-08-251-91/+386
| | | | | While cleaning up Bill's C style, I may have cleaned up some code he didn't touch as well (in _ssl.c).
* PEP 3123: Provide forward compatibility with Python 3.0, while keepingMartin v. Löwis2007-07-211-5/+4
| | | | | backwards compatibility. Add Py_Refcnt, Py_Type, Py_Size, and PyVarObject_HEAD_INIT.
* Fix various minor errors in passing arguments toMartin v. Löwis2006-10-191-1/+1
| | | | PyArg_ParseTuple.
* #1494314: Fix a regression with high-numbered sockets in 2.4.3. ThisAnthony Baxter2006-07-111-1/+28
| | | | | means that select() on sockets > FD_SETSIZE (typically 1024) work again. The patch makes sockets use poll() internally where available.
* Don't mask a no memory error with a less meaningful one as discussed on ↵Neal Norwitz2006-05-111-3/+1
| | | | python-checkins
* Fix problems found by Coverity.Neal Norwitz2006-05-101-3/+3
| | | | | | | | | | | | | longobject.c: also fix an ssize_t problem <a> could have been NULL, so hoist the size calc to not use <a>. _ssl.c: under fail: self is DECREF'd, but it would have been NULL. _elementtree.c: delete self if there was an error. _csv.c: I'm not sure if lineterminator could have been anything other than a string. However, other string method calls are checked, so check this one too.
* Remove unused fieldNeal Norwitz2006-04-171-1/+0
|
* Patch #1380952: fix SSL objects timing out on consecutive read()sGeorg Brandl2006-03-311-8/+15
|
* Try to improve name based on discussion on python-checkins with Jim JewettNeal Norwitz2006-02-131-5/+5
|
* Introduce Py_SOCKET_FD_CAN_BE_GE_FD_SETSIZE.Martin v. Löwis2006-02-111-0/+2
| | | | Proposed by Tim Peters.
* Bug #876637, prevent stack corruption when socket descriptorNeal Norwitz2006-02-071-0/+14
| | | | | | | | | | | | | | | | | | is larger than FD_SETSIZE. This can only be acheived with ulimit -n SOME_NUMBER_BIGGER_THAN_FD_SETSIZE which is typically only available to root. Since this wouldn't normally be run in a test (ie, run as root), it doesn't seem too worthwhile to add a normal test. The bug report has one version of a test. I've written another. Not sure what the best thing to do is. Do the check before calling internal_select() because we can't set an error in between Py_BEGIN_ALLOW_THREADS and Py_END_ALLOW_THREADS. This seemed the clearest solution, ie handle before calling internal_select() rather than inside. Plus there is at least one place outside of internal_select() that needed to be handled. Will backport.
* Fix indentation (whitespace only).Neal Norwitz2006-02-071-3/+3
|
* Check return result from Py_InitModule*(). This API can fail.Neal Norwitz2006-01-191-0/+2
| | | | Probably should be backported.
* Add a missing decref -- PyErr_SetObject increfs the 'object'!Michael W. Hudson2004-08-041-0/+1
|
* [Patch #909007] Enable a bunch of safe bug workarounds in OpenSSL, for ↵Andrew M. Kuchling2004-07-101-0/+1
| | | | compatibility with various broken SSL implementations out there.
* [Patch #945642] Fix non-blocking SSL sockets, which blocked on reads/writes ↵Andrew M. Kuchling2004-07-101-26/+60
| | | | | | | in Python 2.3. (It turns out that the Debian unstable packaging of Python 2.3.4 includes this patch.) Patch by Tino Lange.
* Make socket.sslerror a subclass of socket.error .Brett Cannon2004-03-231-1/+3
| | | | Added socket.error to the socket module's C API.
* Patch #803998: Correctly check for error in SSL_write.Martin v. Löwis2003-10-271-2/+3
|
* Fix a bunch of typos in documentation, docstrings and comments.Walter Dörwald2003-10-201-1/+1
| | | | (From SF patch #810751)
* Fix SF #754870, SSL crash interpreter when remote side closes during connectNeal Norwitz2003-06-301-1/+2
| | | | Also fix a memory leak.
* Patch #751916: Check for signals, fix some refcounting errors.Martin v. Löwis2003-06-281-2/+13
|
* Fix compiler warningNeal Norwitz2003-02-021-0/+1
|
* SF patch 676472 by Geoff Talvola, reviewed by Ben Laurie.Guido van Rossum2003-01-311-13/+65
| | | | | | | | | | | | Geoff writes: This is yet another patch to _ssl.c that sets the underlying BIO to non-blocking if the socket being wrapped is non-blocking. It also correctly loops when SSL_connect, SSL_write, or SSL_read indicates that it needs to read or write more bytes. This seems to fix bug #673797 which was not fixed by my previous patch.
* Support socket timeout in SSL, by Geoff Talvola.Guido van Rossum2003-01-271-0/+51
| | | | (SF patch #675750, to fix SF bug #675552.)
* Excise DL_EXPORT/DL_IMPORT from Modules/*. Required adding a prototypeMark Hammond2002-08-021-1/+1
| | | | | | for Py_Main(). Thanks to Kalle Svensson and Skip Montanaro for the patches.
* Patch #575827: allow threads inside SSL creation.Martin v. Löwis2002-07-281-4/+19
|
* staticforward bites the dust.Jeremy Hylton2002-07-171-4/+4
| | | | | | | | | | | | | | | The staticforward define was needed to support certain broken C compilers (notably SCO ODT 3.0, perhaps early AIX as well) botched the static keyword when it was used with a forward declaration of a static initialized structure. Standard C allows the forward declaration with static, and we've decided to stop catering to broken C compilers. (In fact, we expect that the compilers are all fixed eight years later.) I'm leaving staticforward and statichere defined in object.h as static. This is only for backwards compatibility with C extensions that might still use it. XXX I haven't updated the documentation.
* Repair badly formatted code.Jeremy Hylton2002-07-021-19/+17
|
* Patch #568124: Add doc string macros.Martin v. Löwis2002-06-131-14/+14
|
* Repair widespread misuse of _PyString_Resize. Since it's clear peopleTim Peters2002-04-271-2/+2
| | | | | | | | | | | | | | | | | | | | | | don't understand how this function works, also beefed up the docs. The most common usage error is of this form (often spread out across gotos): if (_PyString_Resize(&s, n) < 0) { Py_DECREF(s); s = NULL; goto outtahere; } The error is that if _PyString_Resize runs out of memory, it automatically decrefs the input string object s (which also deallocates it, since its refcount must be 1 upon entry), and sets s to NULL. So if the "if" branch ever triggers, it's an error to call Py_DECREF(s): s is already NULL! A correct way to write the above is the simpler (and intended) if (_PyString_Resize(&s, n) < 0) goto outtahere; Bugfix candidate.
* Forward port of patch # 500311: Work around for buggy https servers.Martin v. Löwis2002-04-201-24/+72
| | | | Fixes #494762.
* Break SSL support out of _socket module and place it into a newMarc-André Lemburg2002-02-161-0/+461
helper module _ssl. The support for the RAND_* APIs in _ssl is now only enabled for OpenSSL 0.9.5 and up since they were added in that release. Note that socketmodule.* should really be renamed to _socket.* -- unfortunately, this seems to lose the CVS history of the file. Please review and test... I was only able to test the header file chaos in socketmodule.c/h on Linux. The test run through fine and compiles don't give errors or warnings. WARNING: This patch does *not* include changes to the various non-Unix build process files.