353 static PyObject *
354 crypto_load_certificate_request(PyObject *spam, PyObject *args)
355 {
356 crypto_X509ReqObj *crypto_X509Req_New(X509_REQ *, int);
357 int type, len;
358 char *buffer;
359 BIO *bio;
360 X509_REQ *req;
361
362 if (!PyArg_ParseTuple(args, "is#:load_certificate_request", &type, &buffer, &len))
when PyArg_ParseTuple() succeeds
taking False path
363 return NULL;
364
365 bio = BIO_new_mem_buf(buffer, len);
366 switch (type)
when following case 1
367 {
368 case X509_FILETYPE_PEM:
369 req = PEM_read_bio_X509_REQ(bio, NULL, NULL, NULL);
370 break;
371
372 case X509_FILETYPE_ASN1:
373 req = d2i_X509_REQ_bio(bio, NULL);
374 break;
375
376 default:
377 PyErr_SetString(PyExc_ValueError, "type argument must be FILETYPE_PEM or FILETYPE_ASN1");
378 BIO_free(bio);
379 return NULL;
380 }
381 BIO_free(bio);
382
383 if (req == NULL)
when treating unknown struct X509_REQ * from OpenSSL/crypto/crypto.c:369 as NULL
taking True path
384 {
385 exception_from_error_queue(crypto_Error);
386 return NULL;
387 }
388
389 return (PyObject *)crypto_X509Req_New(req, 1);
390 }
returning (PyObject*)NULL without setting an exception
found 1 similar trace(s) to this