Skip to content

Instantly share code, notes, and snippets.

@neheb
Created February 22, 2019 00:25
Show Gist options
  • Save neheb/4e8266ab730a91ea303c3467b8bbf02a to your computer and use it in GitHub Desktop.
Save neheb/4e8266ab730a91ea303c3467b8bbf02a to your computer and use it in GitHub Desktop.
diff --git a/src/_cffi_src/openssl/asn1.py b/src/_cffi_src/openssl/asn1.py
index 82bf797..fa64c2e 100644
--- a/src/_cffi_src/openssl/asn1.py
+++ b/src/_cffi_src/openssl/asn1.py
@@ -41,7 +41,7 @@ FUNCTIONS = """
void ASN1_OBJECT_free(ASN1_OBJECT *);
/* ASN1 STRING */
-unsigned char *ASN1_STRING_data(ASN1_STRING *);
+const unsigned char * ASN1_STRING_get0_data(const ASN1_STRING *x);
int ASN1_STRING_set(ASN1_STRING *, const void *, int);
/* ASN1 OCTET STRING */
diff --git a/src/_cffi_src/openssl/conf.py b/src/_cffi_src/openssl/conf.py
index 9db0162..c61456b 100644
--- a/src/_cffi_src/openssl/conf.py
+++ b/src/_cffi_src/openssl/conf.py
@@ -12,9 +12,6 @@ TYPES = """
"""
FUNCTIONS = """
-void OPENSSL_config(const char *);
-/* This is a macro in 1.1.0 */
-void OPENSSL_no_config(void);
"""
CUSTOMIZATIONS = """
diff --git a/src/_cffi_src/openssl/src/osrandom_engine.c b/src/_cffi_src/openssl/src/osrandom_engine.c
index 697381c..7f3a5f4 100644
--- a/src/_cffi_src/openssl/src/osrandom_engine.c
+++ b/src/_cffi_src/openssl/src/osrandom_engine.c
@@ -490,6 +490,7 @@ static RAND_METHOD osrandom_rand = {
osrandom_rand_status,
};
+#ifndef OPENSSL_NO_ENGINE
static const ENGINE_CMD_DEFN osrandom_cmd_defns[] = {
{CRYPTOGRAPHY_OSRANDOM_GET_IMPLEMENTATION,
"get_implementation",
@@ -523,6 +524,7 @@ static int osrandom_ctrl(ENGINE *e, int cmd, long i, void *p, void (*f) (void))
return 0;
}
}
+#endif
/* error reporting */
#define ERR_FUNC(func) ERR_PACK(0, func, 0)
@@ -596,6 +598,7 @@ static void ERR_Cryptography_OSRandom_error(int function, int reason,
/* Returns 1 if successfully added, 2 if engine has previously been added,
and 0 for error. */
int Cryptography_add_osrandom_engine(void) {
+#ifndef OPENSSL_NO_ENGINE
ENGINE *e;
ERR_load_Cryptography_OSRandom_strings();
@@ -631,4 +634,7 @@ int Cryptography_add_osrandom_engine(void) {
}
return 1;
+#else
+ return 0;
+#endif
}
diff --git a/src/_cffi_src/openssl/src/osrandom_engine.h b/src/_cffi_src/openssl/src/osrandom_engine.h
index 53f957f..89b5e06 100644
--- a/src/_cffi_src/openssl/src/osrandom_engine.h
+++ b/src/_cffi_src/openssl/src/osrandom_engine.h
@@ -70,8 +70,10 @@ enum {
CRYPTOGRAPHY_OSRANDOM_GETENTROPY_WORKS
};
+#ifndef OPENSSL_NO_ENGINE
/* engine ctrl */
#define CRYPTOGRAPHY_OSRANDOM_GET_IMPLEMENTATION ENGINE_CMD_BASE
+#endif
/* error reporting */
static void ERR_load_Cryptography_OSRandom_strings(void);
diff --git a/src/_cffi_src/openssl/ssl.py b/src/_cffi_src/openssl/ssl.py
index 2218095..7a73606 100644
--- a/src/_cffi_src/openssl/ssl.py
+++ b/src/_cffi_src/openssl/ssl.py
@@ -369,30 +369,6 @@ unsigned long SSL_CTX_add_extra_chain_cert(SSL_CTX *, X509 *);
/* methods */
-/*
- * TLSv1_1 and TLSv1_2 are recent additions. Only sufficiently new versions of
- * OpenSSL support them.
- */
-const SSL_METHOD *TLSv1_1_method(void);
-const SSL_METHOD *TLSv1_1_server_method(void);
-const SSL_METHOD *TLSv1_1_client_method(void);
-
-const SSL_METHOD *TLSv1_2_method(void);
-const SSL_METHOD *TLSv1_2_server_method(void);
-const SSL_METHOD *TLSv1_2_client_method(void);
-
-const SSL_METHOD *SSLv3_method(void);
-const SSL_METHOD *SSLv3_server_method(void);
-const SSL_METHOD *SSLv3_client_method(void);
-
-const SSL_METHOD *TLSv1_method(void);
-const SSL_METHOD *TLSv1_server_method(void);
-const SSL_METHOD *TLSv1_client_method(void);
-
-const SSL_METHOD *DTLSv1_method(void);
-const SSL_METHOD *DTLSv1_server_method(void);
-const SSL_METHOD *DTLSv1_client_method(void);
-
/* Added in 1.0.2 */
const SSL_METHOD *DTLS_method(void);
const SSL_METHOD *DTLS_server_method(void);
@@ -432,25 +408,9 @@ SRTP_PROTECTION_PROFILE *SSL_get_selected_srtp_profile(SSL *);
long SSL_session_reused(SSL *);
-void SSL_CTX_set_next_protos_advertised_cb(SSL_CTX *,
- int (*)(SSL *,
- const unsigned char **,
- unsigned int *,
- void *),
- void *);
-void SSL_CTX_set_next_proto_select_cb(SSL_CTX *,
- int (*)(SSL *,
- unsigned char **,
- unsigned char *,
- const unsigned char *,
- unsigned int,
- void *),
- void *);
int SSL_select_next_proto(unsigned char **, unsigned char *,
const unsigned char *, unsigned int,
const unsigned char *, unsigned int);
-void SSL_get0_next_proto_negotiated(const SSL *,
- const unsigned char **, unsigned *);
int sk_SSL_CIPHER_num(Cryptography_STACK_OF_SSL_CIPHER *);
const SSL_CIPHER *sk_SSL_CIPHER_value(Cryptography_STACK_OF_SSL_CIPHER *, int);
diff --git a/src/_cffi_src/openssl/x509.py b/src/_cffi_src/openssl/x509.py
index 748c6c8..3a55f78 100644
--- a/src/_cffi_src/openssl/x509.py
+++ b/src/_cffi_src/openssl/x509.py
@@ -301,9 +301,6 @@ int i2d_DSAPublicKey(DSA *, unsigned char **);
int i2d_DSAPrivateKey(DSA *, unsigned char **);
long X509_CRL_get_version(X509_CRL *);
-ASN1_TIME *X509_CRL_get_lastUpdate(X509_CRL *);
-ASN1_TIME *X509_CRL_get_nextUpdate(X509_CRL *);
-X509_NAME *X509_CRL_get_issuer(X509_CRL *);
Cryptography_STACK_OF_X509_REVOKED *X509_CRL_get_REVOKED(X509_CRL *);
/* These aren't macros these arguments are all const X on openssl > 1.0.x */
diff --git a/src/cryptography.egg-info/SOURCES.txt b/src/cryptography.egg-info/SOURCES.txt
index 67aaf2f..aa0d426 100644
--- a/src/cryptography.egg-info/SOURCES.txt
+++ b/src/cryptography.egg-info/SOURCES.txt
@@ -110,7 +110,6 @@ src/_cffi_src/openssl/dsa.py
src/_cffi_src/openssl/ec.py
src/_cffi_src/openssl/ecdh.py
src/_cffi_src/openssl/ecdsa.py
-src/_cffi_src/openssl/engine.py
src/_cffi_src/openssl/err.py
src/_cffi_src/openssl/evp.py
src/_cffi_src/openssl/fips.py
@@ -294,4 +293,4 @@ tests/x509/test_ocsp.py
tests/x509/test_x509.py
tests/x509/test_x509_crlbuilder.py
tests/x509/test_x509_ext.py
-tests/x509/test_x509_revokedcertbuilder.py
\ No newline at end of file
+tests/x509/test_x509_revokedcertbuilder.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment