From: Wouter v. B. <wou...@gm...> - 2008-09-25 09:16:18
|
diff -ru pyOpenSSL-0.6.org/src/crypto/x509req.c pyOpenSSL-0.6/src/crypto/x509req.c --- pyOpenSSL-0.6.org/src/crypto/x509req.c 2002-09-05 09:49:22.000000000 +0200 +++ pyOpenSSL-0.6/src/crypto/x509req.c 2008-09-25 10:53:18.000000000 +0200 @@ -221,6 +221,30 @@ return Py_None; } +static char crypto_X509Req_set_version_doc[] = "\n\ +Add extensions to the request.\n\ +\n\ +Arguments: self - X509Req object\n\ + args - The Python argument tuple, should be:\n\ + version - The version numer (usually 0)\n\ +Returns: None\n\ +"; + +static PyObject * +crypto_X509Req_set_version(crypto_X509ReqObj *self, PyObject *args) +{ + long version; + + if (!PyArg_ParseTuple(args, "l:version", &version)) + return NULL; + + if (!X509_REQ_set_version(self->x509_req, version)) + return NULL; + + Py_INCREF(Py_None); + return Py_None; +} + /* * ADD_METHOD(name) expands to a correct PyMethodDef declaration * { 'name', (PyCFunction)crypto_X509Req_name, METH_VARARGS } @@ -236,6 +260,7 @@ ADD_METHOD(sign), ADD_METHOD(verify), ADD_METHOD(add_extensions), + ADD_METHOD(set_version), { NULL, NULL } }; #undef ADD_METHOD |