Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Act on a bunch of comments saying things are const #7616

Merged
merged 1 commit into from
Sep 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions src/_cffi_src/openssl/asn1.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,11 @@
void ASN1_ENUMERATED_free(ASN1_ENUMERATED *);
int ASN1_ENUMERATED_set(ASN1_ENUMERATED *, long);

/* These became const ASN1_* in 1.1.0 */
int ASN1_STRING_type(ASN1_STRING *);
int ASN1_STRING_to_UTF8(unsigned char **, ASN1_STRING *);
int i2a_ASN1_INTEGER(BIO *, ASN1_INTEGER *);
int ASN1_STRING_type(const ASN1_STRING *);
int ASN1_STRING_to_UTF8(unsigned char **, const ASN1_STRING *);
int i2a_ASN1_INTEGER(BIO *, const ASN1_INTEGER *);

/* This became const ASN1_TIME in 1.1.0f */
ASN1_GENERALIZEDTIME *ASN1_TIME_to_generalizedtime(ASN1_TIME *,
ASN1_GENERALIZEDTIME *ASN1_TIME_to_generalizedtime(const ASN1_TIME *,
ASN1_GENERALIZEDTIME **);

int ASN1_STRING_length(ASN1_STRING *);
Expand Down
1 change: 0 additions & 1 deletion src/_cffi_src/openssl/bio.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
int BIO_read(BIO *, void *, int);
int BIO_gets(BIO *, char *, int);
int BIO_write(BIO *, const void *, int);
/* Added in 1.1.0 */
int BIO_up_ref(BIO *);

BIO *BIO_new(BIO_METHOD *);
Expand Down
1 change: 0 additions & 1 deletion src/_cffi_src/openssl/crypto.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
unsigned long OpenSSL_version_num(void);
const char *OpenSSL_version(int);

/* this is a macro in 1.1.0 */
void *OPENSSL_malloc(size_t);
void OPENSSL_free(void *);

Expand Down
1 change: 0 additions & 1 deletion src/_cffi_src/openssl/dh.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
int DH_generate_key(DH *);
DH *DHparams_dup(DH *);

/* added in 1.1.0 when the DH struct was opaqued */
void DH_get0_pqg(const DH *, const BIGNUM **, const BIGNUM **,
const BIGNUM **);
int DH_set0_pqg(DH *, BIGNUM *, BIGNUM *, BIGNUM *);
Expand Down
1 change: 0 additions & 1 deletion src/_cffi_src/openssl/dsa.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
int DSA_verify(int, const unsigned char *, int, const unsigned char *, int,
DSA *);

/* added in 1.1.0 to access the opaque struct */
void DSA_get0_pqg(const DSA *, const BIGNUM **, const BIGNUM **,
const BIGNUM **);
int DSA_set0_pqg(DSA *, BIGNUM *, BIGNUM *, BIGNUM *);
Expand Down
4 changes: 1 addition & 3 deletions src/_cffi_src/openssl/evp.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,13 +133,11 @@
const unsigned char *, size_t);
int EVP_DigestVerify(EVP_MD_CTX *, const unsigned char *, size_t,
const unsigned char *, size_t);
/* Added in 1.1.0 */
size_t EVP_PKEY_get1_tls_encodedpoint(EVP_PKEY *, unsigned char **);
int EVP_PKEY_set1_tls_encodedpoint(EVP_PKEY *, const unsigned char *,
size_t);

/* EVP_PKEY * became const in 1.1.0 */
int EVP_PKEY_bits(EVP_PKEY *);
int EVP_PKEY_bits(const EVP_PKEY *);

void OpenSSL_add_all_algorithms(void);
int EVP_PKEY_assign_RSA(EVP_PKEY *, RSA *);
Expand Down
1 change: 0 additions & 1 deletion src/_cffi_src/openssl/rsa.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
int RSA_blinding_on(RSA *, BN_CTX *);
int RSA_print(BIO *, const RSA *, int);

/* added in 1.1.0 when the RSA struct was opaqued */
int RSA_set0_key(RSA *, BIGNUM *, BIGNUM *, BIGNUM *);
int RSA_set0_factors(RSA *, BIGNUM *, BIGNUM *);
int RSA_set0_crt_params(RSA *, BIGNUM *, BIGNUM *, BIGNUM *);
Expand Down
3 changes: 0 additions & 3 deletions src/_cffi_src/openssl/ssl.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,9 +321,7 @@
Cryptography_STACK_OF_X509_NAME *SSL_load_client_CA_file(const char *);

const char *SSL_get_servername(const SSL *, const int);
/* Function signature changed to const char * in 1.1.0 */
const char *SSL_CIPHER_get_version(const SSL_CIPHER *);
/* These became macros in 1.1.0 */
int SSL_library_init(void);
void SSL_load_error_strings(void);

Expand Down Expand Up @@ -470,7 +468,6 @@

int SSL_SESSION_set1_id_context(SSL_SESSION *, const unsigned char *,
unsigned int);
/* Added in 1.1.0 for the great opaquing of structs */
size_t SSL_SESSION_get_master_key(const SSL_SESSION *, unsigned char *,
size_t);
size_t SSL_get_client_random(const SSL *, unsigned char *, size_t);
Expand Down
21 changes: 8 additions & 13 deletions src/_cffi_src/openssl/x509.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,24 +156,20 @@
int i2d_RSAPublicKey_bio(BIO *, RSA *);
int i2d_DSAPrivateKey_bio(BIO *, DSA *);

/* These became const X509 in 1.1.0 */
int X509_get_ext_count(X509 *);
X509_EXTENSION *X509_get_ext(X509 *, int);
X509_NAME *X509_get_subject_name(X509 *);
X509_NAME *X509_get_issuer_name(X509 *);
int X509_get_ext_count(const X509 *);
X509_EXTENSION *X509_get_ext(const X509 *, int);
X509_NAME *X509_get_subject_name(const X509 *);
X509_NAME *X509_get_issuer_name(const X509 *);

/* This became const ASN1_OBJECT * in 1.1.0 */
X509_EXTENSION *X509_EXTENSION_create_by_OBJ(X509_EXTENSION **,
ASN1_OBJECT *, int,
const ASN1_OBJECT *, int,
ASN1_OCTET_STRING *);


/* This became const X509_EXTENSION * in 1.1.0 */
int X509_EXTENSION_get_critical(X509_EXTENSION *);
int X509_EXTENSION_get_critical(const X509_EXTENSION *);

/* This became const X509_REVOKED * in 1.1.0 */
int X509_REVOKED_get_ext_count(X509_REVOKED *);
X509_EXTENSION *X509_REVOKED_get_ext(X509_REVOKED *, int);
int X509_REVOKED_get_ext_count(const X509_REVOKED *);
X509_EXTENSION *X509_REVOKED_get_ext(const X509_REVOKED *, int);

X509_REVOKED *X509_REVOKED_dup(X509_REVOKED *);

Expand Down Expand Up @@ -219,7 +215,6 @@
EC_KEY *d2i_ECPrivateKey_bio(BIO *, EC_KEY **);
int i2d_ECPrivateKey_bio(BIO *, EC_KEY *);

/* these functions were added in 1.1.0 */
const ASN1_INTEGER *X509_REVOKED_get0_serialNumber(const X509_REVOKED *);
const ASN1_TIME *X509_REVOKED_get0_revocationDate(const X509_REVOKED *);
"""
Expand Down
18 changes: 7 additions & 11 deletions src/_cffi_src/openssl/x509name.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,23 +32,19 @@
int X509_NAME_get_index_by_NID(X509_NAME *, int, int);
int X509_NAME_cmp(const X509_NAME *, const X509_NAME *);
X509_NAME *X509_NAME_dup(X509_NAME *);
/* These became const X509_NAME * in 1.1.0 */
int X509_NAME_entry_count(X509_NAME *);
X509_NAME_ENTRY *X509_NAME_get_entry(X509_NAME *, int);
char *X509_NAME_oneline(X509_NAME *, char *, int);
int X509_NAME_entry_count(const X509_NAME *);
X509_NAME_ENTRY *X509_NAME_get_entry(const X509_NAME *, int);
char *X509_NAME_oneline(const X509_NAME *, char *, int);

/* These became const X509_NAME_ENTRY * in 1.1.0 */
ASN1_OBJECT *X509_NAME_ENTRY_get_object(X509_NAME_ENTRY *);
ASN1_STRING *X509_NAME_ENTRY_get_data(X509_NAME_ENTRY *);
ASN1_OBJECT *X509_NAME_ENTRY_get_object(const X509_NAME_ENTRY *);
ASN1_STRING *X509_NAME_ENTRY_get_data(const X509_NAME_ENTRY *);
int X509_NAME_add_entry(X509_NAME *, X509_NAME_ENTRY *, int, int);

/* this became const unsigned char * in 1.1.0 */
int X509_NAME_add_entry_by_NID(X509_NAME *, int, int, unsigned char *,
int X509_NAME_add_entry_by_NID(X509_NAME *, int, int, const unsigned char *,
int, int, int);

/* These became const ASN1_OBJECT * in 1.1.0 */
X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_OBJ(X509_NAME_ENTRY **,
ASN1_OBJECT *, int,
const ASN1_OBJECT *, int,
const unsigned char *, int);

Cryptography_STACK_OF_X509_NAME *sk_X509_NAME_new_null(void);
Expand Down
4 changes: 2 additions & 2 deletions src/_cffi_src/openssl/x509v3.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@
int GENERAL_NAME_print(BIO *, GENERAL_NAME *);
void GENERAL_NAMES_free(GENERAL_NAMES *);
void *X509V3_EXT_d2i(X509_EXTENSION *);
/* The last two char * args became const char * in 1.1.0 */
X509_EXTENSION *X509V3_EXT_nconf(CONF *, X509V3_CTX *, char *, char *);
X509_EXTENSION *X509V3_EXT_nconf(CONF *, X509V3_CTX *, const char *,
const char *);

void *X509V3_set_ctx_nodb(X509V3_CTX *);

Expand Down