diff options
author | Jean-Paul Calderone <exarkun@divmod.com> | 2011-04-01 17:07:24 -0400 |
---|---|---|
committer | Jean-Paul Calderone <exarkun@divmod.com> | 2011-04-01 17:07:24 -0400 |
commit | 24ebc4f5dd9fbe4721f39829708cb93921728233 (patch) | |
tree | fb75ce90d81afefeab5be04402107e06b7dce0f6 /OpenSSL/crypto/x509.c | |
parent | 7e4930eb0354627380d2c520bfc1f7b719bfed1e (diff) | |
download | pyopenssl-24ebc4f5dd9fbe4721f39829708cb93921728233.tar.gz |
Fix some style oddities
Diffstat (limited to 'OpenSSL/crypto/x509.c')
-rw-r--r-- | OpenSSL/crypto/x509.c | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/OpenSSL/crypto/x509.c b/OpenSSL/crypto/x509.c index 273f557..b8f2e83 100644 --- a/OpenSSL/crypto/x509.c +++ b/OpenSSL/crypto/x509.c @@ -301,7 +301,7 @@ crypto_X509_get_pubkey(crypto_X509Obj *self, PyObject *args) py_pkey = crypto_PKey_New(pkey, 1); if (py_pkey != NULL) { - py_pkey->only_public = 1; + py_pkey->only_public = 1; } return (PyObject *)py_pkey; } @@ -689,47 +689,46 @@ crypto_X509_add_extensions(crypto_X509Obj *self, PyObject *args) static char crypto_X509_get_extension_count_doc[] = "\n\ Get the number of extensions on the certificate.\n\ \n\ -Arguments: self - X509 object\n\ -Returns: Number of extensions as a Python integer\n\ +@return: Number of extensions as a Python integer\n\ "; static PyObject * -crypto_X509_get_extension_count(crypto_X509Obj *self, PyObject *args) -{ - if (!PyArg_ParseTuple(args, ":get_extension_count")) +crypto_X509_get_extension_count(crypto_X509Obj *self, PyObject *args) { + if (!PyArg_ParseTuple(args, ":get_extension_count")) { return NULL; + } return PyInt_FromLong((long)X509_get_ext_count(self->x509)); } static char crypto_X509_get_extension_doc[] = "\n\ -Get a specific extension of the certificate.\n\ +Get a specific extension of the certificate by index.\n\ \n\ -Arguments: self - X509 object\n\ -Returns: An X509 extension object\n\ +@param index: The index of the extension to retrieve. +@return: The X509Extension object at the specified index.\n\ "; static PyObject * -crypto_X509_get_extension(crypto_X509Obj *self, PyObject *args) -{ +crypto_X509_get_extension(crypto_X509Obj *self, PyObject *args) { crypto_X509ExtensionObj *extobj; int loc; X509_EXTENSION *ext; - if (!PyArg_ParseTuple(args, "i:get_extension", &loc)) + if (!PyArg_ParseTuple(args, "i:get_extension", &loc)) { return NULL; + } /* will return NULL if loc is outside the range of extensions, - not registered as an error*/ + not registered as an error*/ ext = X509_get_ext(self->x509, loc); if (!ext) { return NULL; /* Should be reported as an IndexError ? */ /*exception_from_error_queue();*/ } - + extobj = PyObject_New(crypto_X509ExtensionObj, &crypto_X509Extension_Type); extobj->x509_extension = X509_EXTENSION_dup(ext); - + return extobj; } |