diff options
author | Jean-Paul Calderone <exarkun@divmod.com> | 2011-05-19 18:02:11 -0400 |
---|---|---|
committer | Jean-Paul Calderone <exarkun@divmod.com> | 2011-05-19 18:02:11 -0400 |
commit | fcced2ae07bf778a2039b342059d86afb373d779 (patch) | |
tree | 363cdbcb3bc50630e8c55b3382528615da3c36dd /OpenSSL/ssl | |
parent | 95b92c7888b4acce21e87ec975cac31661469e8a (diff) | |
download | pyopenssl-fcced2ae07bf778a2039b342059d86afb373d779.tar.gz |
Braces everywhere, cuddled, whitespace and docstring fixes
Diffstat (limited to 'OpenSSL/ssl')
-rwxr-xr-x | OpenSSL/ssl/connection.c | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/OpenSSL/ssl/connection.c b/OpenSSL/ssl/connection.c index 09e2607..201eb45 100755 --- a/OpenSSL/ssl/connection.c +++ b/OpenSSL/ssl/connection.c @@ -1101,34 +1101,28 @@ ssl_Connection_get_peer_certificate(ssl_ConnectionObj *self, PyObject *args) static char ssl_Connection_get_peer_cert_chain_doc[] = "\n\ Retrieve the other side's certificate (if any)\n\ \n\ -Arguments: self - The Connection object\n\ - args - The Python argument tuple, should be empty\n\ -Returns: The peer's certificates chain tuple\n\ +@return: A tuple of X509 instances giving the peer's certificate chain.\n\ "; static PyObject * -ssl_Connection_get_peer_cert_chain(ssl_ConnectionObj *self, PyObject *args) -{ +ssl_Connection_get_peer_cert_chain(ssl_ConnectionObj *self, PyObject *args) { STACK_OF(X509) *sk; PyObject *tpl, *item; Py_ssize_t i; - if (!PyArg_ParseTuple(args, ":get_peer_cert_chain")) + if (!PyArg_ParseTuple(args, ":get_peer_cert_chain")) { return NULL; + } sk = SSL_get_peer_cert_chain(self->ssl); - if (sk != NULL) - { + if (sk != NULL) { tpl = PyTuple_New(sk_X509_num(sk)); - for (i=0; i<sk_X509_num(sk); i++) - { - item = (PyObject *)crypto_X509_New(sk_X509_value(sk,i), 1); + for (i = 0; i < sk_X509_num(sk); i++) { + item = (PyObject *)crypto_X509_New(sk_X509_value(sk, i), 1); Py_INCREF(item); PyTuple_SET_ITEM(tpl, i, item); } return tpl; - } - else - { + } else { Py_INCREF(Py_None); return Py_None; } |