~myers-1/pyopenssl/npn

« back to all changes in this revision

Viewing changes to OpenSSL/crypto/crl.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:
116
116
@type cert: L{X509}\n\
117
117
@param key: Used to sign CRL.\n\
118
118
@type key: L{PKey}\n\
119
 
@return: None\n\
 
119
@param type: The export format, either L{FILETYPE_PEM}, L{FILETYPE_ASN1}, or L{FILETYPE_TEXT}.\n\
 
120
@param days: The number of days until the next update of this CRL.\n\
 
121
@type days: L{int}\n\
 
122
@return: L{str}\n\
120
123
";
121
124
static PyObject *
122
125
crypto_CRL_export(crypto_CRLObj *self, PyObject *args, PyObject *keywds) {
172
175
        return NULL;
173
176
    }
174
177
    buf_len = BIO_get_mem_data(bio, &temp);
175
 
    buffer = PyString_FromStringAndSize(temp, buf_len);
 
178
    buffer = PyBytes_FromStringAndSize(temp, buf_len);
176
179
    BIO_free(bio);
177
180
    return buffer;
178
181
}
207
210
#undef ADD_METHOD
208
211
 
209
212
 
210
 
static PyObject *
211
 
crypto_CRL_getattr(crypto_CRLObj *self, char *name) {
212
 
    return Py_FindMethod(crypto_CRL_methods, (PyObject *)self, name);
213
 
}
214
 
 
215
213
static void
216
214
crypto_CRL_dealloc(crypto_CRLObj *self) {
217
215
    X509_CRL_free(self->crl);
237
235
}
238
236
 
239
237
PyTypeObject crypto_CRL_Type = {
240
 
    PyObject_HEAD_INIT(NULL)
241
 
    0,
 
238
    PyOpenSSL_HEAD_INIT(&PyType_Type, 0)
242
239
    "CRL",
243
240
    sizeof(crypto_CRLObj),
244
241
    0,
245
242
    (destructor)crypto_CRL_dealloc,
246
243
    NULL, /* print */
247
 
    (getattrfunc)crypto_CRL_getattr,
 
244
    NULL, /* getattr */
248
245
    NULL, /* setattr */
249
246
    NULL, /* compare */
250
247
    NULL, /* repr */