~myers-1/pyopenssl/npn

« back to all changes in this revision

Viewing changes to OpenSSL/crypto/pkey.c

  • Committer: Jean-Paul Calderone
  • Date: 2010-10-08 02:19:58 UTC
  • mfrom: (132.2.57 py3k-port)
  • Revision ID: exarkun@divmod.com-20101008021958-xhodr0riwrhtmqvj
Python 3.x support

Show diffs side-by-side

added added

removed removed

Lines of Context:
88
88
    if (!PyArg_ParseTuple(args, ":bits"))
89
89
        return NULL;
90
90
 
91
 
    return PyInt_FromLong(EVP_PKEY_bits(self->pkey));
 
91
    return PyLong_FromLong(EVP_PKEY_bits(self->pkey));
92
92
}
93
93
 
94
94
static char crypto_PKey_type_doc[] = "\n\
103
103
    if (!PyArg_ParseTuple(args, ":type"))
104
104
        return NULL;
105
105
 
106
 
    return PyInt_FromLong(self->pkey->type);
 
106
    return PyLong_FromLong(self->pkey->type);
107
107
}
108
108
 
109
109
 
196
196
    PyObject_Del(self);
197
197
}
198
198
 
199
 
/*
200
 
 * Find attribute
201
 
 *
202
 
 * Arguments: self - The PKey object
203
 
 *            name - The attribute name
204
 
 * Returns:   A Python object for the attribute, or NULL if something went
205
 
 *            wrong
206
 
 */
207
 
static PyObject *
208
 
crypto_PKey_getattr(crypto_PKeyObj *self, char *name)
209
 
{
210
 
    return Py_FindMethod(crypto_PKey_methods, (PyObject *)self, name);
211
 
}
212
 
 
213
199
PyTypeObject crypto_PKey_Type = {
214
 
    PyObject_HEAD_INIT(NULL)
215
 
    0,
 
200
    PyOpenSSL_HEAD_INIT(&PyType_Type, 0)
216
201
    "OpenSSL.crypto.PKey",
217
202
    sizeof(crypto_PKeyObj),
218
203
    0,
219
204
    (destructor)crypto_PKey_dealloc,
220
205
    NULL, /* print */
221
 
    (getattrfunc)crypto_PKey_getattr,
 
206
    NULL, /* getattr */
222
207
    NULL, /* setattr */
223
208
    NULL, /* compare */
224
209
    NULL, /* repr */