OpenSSL.crypto builds without warnings
diff --git a/OpenSSL/crypto/pkcs12.c b/OpenSSL/crypto/pkcs12.c
index 2302242..5483e42 100644
--- a/OpenSSL/crypto/pkcs12.c
+++ b/OpenSSL/crypto/pkcs12.c
@@ -202,7 +202,7 @@
kwlist, &name))
return NULL;
- if (name != Py_None && ! PyString_CheckExact(name)) {
+ if (name != Py_None && ! PyBytes_CheckExact(name)) {
PyErr_SetString(PyExc_TypeError, "name must be a str or None");
return NULL;
}
@@ -263,7 +263,7 @@
}
}
if (self->friendlyname != Py_None) {
- friendly_name = PyString_AsString(self->friendlyname);
+ friendly_name = PyBytes_AsString(self->friendlyname);
}
p12 = PKCS12_create(passphrase, friendly_name, pkey, x509, cacerts,
@@ -278,7 +278,7 @@
bio = BIO_new(BIO_s_mem());
i2d_PKCS12_bio(bio, p12);
buf_len = BIO_get_mem_data(bio, &temp);
- buffer = PyString_FromStringAndSize(temp, buf_len);
+ buffer = PyBytes_FromStringAndSize(temp, buf_len);
BIO_free(bio);
return buffer;
}
@@ -439,20 +439,6 @@
}
/*
- * Find attribute
- *
- * Arguments: self - The PKCS12 object
- * name - The attribute name
- * Returns: A Python object for the attribute, or NULL if something went
- * wrong
- */
-static PyObject *
-crypto_PKCS12_getattr(crypto_PKCS12Obj *self, char *name)
-{
- return Py_FindMethod(crypto_PKCS12_methods, (PyObject *)self, name);
-}
-
-/*
* Call the visitproc on all contained objects.
*
* Arguments: self - The PKCS12 object
@@ -512,14 +498,13 @@
}
PyTypeObject crypto_PKCS12_Type = {
- PyObject_HEAD_INIT(NULL)
- 0,
+ PyVarObject_HEAD_INIT(&PyType_Type, 0)
"PKCS12",
sizeof(crypto_PKCS12Obj),
0,
(destructor)crypto_PKCS12_dealloc,
NULL, /* print */
- (getattrfunc)crypto_PKCS12_getattr,
+ NULL, /* getattr */
NULL, /* setattr */
NULL, /* compare */
NULL, /* repr */