Skip to content
Merged
Prev Previous commit
Next Next commit
Add const qualifier to fix compiler warnings
  • Loading branch information
vstinner committed Mar 20, 2026
commit 4ee447a19341bcff180cadeca310ad66139b7faf
10 changes: 5 additions & 5 deletions Modules/_ssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1158,7 +1158,7 @@ _asn1obj2py(_sslmodulestate *state, const ASN1_OBJECT *name, int no_name)

static PyObject *
_create_tuple_for_attribute(_sslmodulestate *state,
ASN1_OBJECT *name, ASN1_STRING *value)
const ASN1_OBJECT *name, const ASN1_STRING *value)
{
Py_ssize_t buflen;
PyObject *pyattr;
Expand Down Expand Up @@ -1187,16 +1187,16 @@ _create_tuple_for_attribute(_sslmodulestate *state,
}

static PyObject *
_create_tuple_for_X509_NAME (_sslmodulestate *state, X509_NAME *xname)
_create_tuple_for_X509_NAME (_sslmodulestate *state, const X509_NAME *xname)
Comment thread
vstinner marked this conversation as resolved.
Outdated
{
PyObject *dn = NULL; /* tuple which represents the "distinguished name" */
PyObject *rdn = NULL; /* tuple to hold a "relative distinguished name" */
PyObject *rdnt;
PyObject *attr = NULL; /* tuple to hold an attribute */
int entry_count = X509_NAME_entry_count(xname);
X509_NAME_ENTRY *entry;
ASN1_OBJECT *name;
ASN1_STRING *value;
const X509_NAME_ENTRY *entry;
const ASN1_OBJECT *name;
const ASN1_STRING *value;
int index_counter;
int rdn_level = -1;
int retcode;
Expand Down
3 changes: 2 additions & 1 deletion Modules/_ssl/cert.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@ _ssl_Certificate_get_info_impl(PySSLCertificate *self)
}

static PyObject*
_x509name_print(_sslmodulestate *state, X509_NAME *name, int indent, unsigned long flags)
_x509name_print(_sslmodulestate *state, const X509_NAME *name,
int indent, unsigned long flags)
{
PyObject *res;
BIO *biobuf;
Expand Down
Loading