aboutsummaryrefslogtreecommitdiffstats
path: root/src/_cffi_src/openssl/src
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2018-09-05 21:44:29 -0500
committerAlex Gaynor <alex.gaynor@gmail.com>2018-09-05 22:44:29 -0400
commitf88aea5d8b9452677bd23a9bba917b900cd634c0 (patch)
treebeb2b819e25f6f8cc365d6870915960c6547ea76 /src/_cffi_src/openssl/src
parent18d49d0c6cd117e82934f65e641c1d830edd20df (diff)
downloadcryptography-f88aea5d8b9452677bd23a9bba917b900cd634c0.tar.gz
cryptography-f88aea5d8b9452677bd23a9bba917b900cd634c0.tar.bz2
cryptography-f88aea5d8b9452677bd23a9bba917b900cd634c0.zip
Add flags to error on compile with incompatible pointer type (#4455)
* try something a bit different. * newer compiler plz * permute * fix some warnings * fix getters on OpenSSL < 1.1.0 * this is getting involved * given our compiler flags we can't have SSL_CTX_set_cookie_verify_cb
Diffstat (limited to 'src/_cffi_src/openssl/src')
-rw-r--r--src/_cffi_src/openssl/src/osrandom_engine.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/_cffi_src/openssl/src/osrandom_engine.c b/src/_cffi_src/openssl/src/osrandom_engine.c
index 4fcd34fb..947c79aa 100644
--- a/src/_cffi_src/openssl/src/osrandom_engine.c
+++ b/src/_cffi_src/openssl/src/osrandom_engine.c
@@ -149,7 +149,7 @@ static int dev_urandom_fd(void) {
static int dev_urandom_read(unsigned char *buffer, int size) {
int fd;
- ssize_t n;
+ int n;
fd = dev_urandom_fd();
if (fd < 0) {
@@ -158,7 +158,7 @@ static int dev_urandom_read(unsigned char *buffer, int size) {
while (size > 0) {
do {
- n = read(fd, buffer, (size_t)size);
+ n = (int)read(fd, buffer, (size_t)size);
} while (n < 0 && errno == EINTR);
if (n <= 0) {
@@ -219,7 +219,7 @@ static int osrandom_init(ENGINE *e) {
}
static int osrandom_rand_bytes(unsigned char *buffer, int size) {
- size_t len;
+ int len;
int res;
switch(getentropy_works) {
@@ -230,8 +230,8 @@ static int osrandom_rand_bytes(unsigned char *buffer, int size) {
case CRYPTOGRAPHY_OSRANDOM_GETENTROPY_WORKS:
while (size > 0) {
/* OpenBSD and macOS restrict maximum buffer size to 256. */
- len = size > 256 ? 256 : (size_t)size;
- res = getentropy(buffer, len);
+ len = size > 256 ? 256 : size;
+ res = getentropy(buffer, (size_t)len);
if (res < 0) {
ERR_Cryptography_OSRandom_error(
CRYPTOGRAPHY_OSRANDOM_F_RAND_BYTES,
@@ -362,7 +362,7 @@ static int osrandom_rand_bytes(unsigned char *buffer, int size) {
return 0;
}
buffer += n;
- size -= n;
+ size -= (int)n;
}
return 1;
}