diff --git a/src/ssl.c b/src/ssl.c index 239aa50c5f..c95e4b4225 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -20603,8 +20603,7 @@ int wolfSSL_RAND_egd(const char* nm) if (ret == SSL_SUCCESS) { buf[idx] = WOLFSSL_EGD_NBLOCK; buf[idx + 1] = 255 - bytes; /* request 255 bytes from server */ - printf("requesting %d %d\n", *(buf + idx), *(buf + idx + 1)); - ret = write(fd, buf + idx, 2); + ret = (int)write(fd, buf + idx, 2); if (ret <= 0 || ret != 2) { if (errno == EAGAIN) { ret = SSL_SUCCESS; @@ -20618,8 +20617,7 @@ int wolfSSL_RAND_egd(const char* nm) /* attempting to read */ buf[idx] = 0; - ret = read(fd, buf + idx, 256 - bytes); - printf("after read ret = %d , buf = %d\n", ret, *(buf+idx)); + ret = (int)read(fd, buf + idx, 256 - bytes); if (ret == 0) { WOLFSSL_MSG("error reading entropy from egd server"); ret = SSL_FATAL_ERROR; diff --git a/tests/api.c b/tests/api.c index 32509e2ada..4277cc4aac 100644 --- a/tests/api.c +++ b/tests/api.c @@ -214,6 +214,7 @@ #endif #ifdef OPENSSL_EXTRA + #include #include #include #include diff --git a/wolfssl/openssl/evp.h b/wolfssl/openssl/evp.h index 3360c69233..0db570aabc 100644 --- a/wolfssl/openssl/evp.h +++ b/wolfssl/openssl/evp.h @@ -58,9 +58,9 @@ #endif typedef char WOLFSSL_EVP_CIPHER; -#ifndef WOLFSSL_EVP_TYPE_DEFINED -typedef struct WOLFSSL_EVP_PKEY WOLFSSL_EVP_PKEY; +#ifndef WOLFSSL_EVP_TYPE_DEFINED /* guard on redeclaration */ typedef char WOLFSSL_EVP_MD; +typedef struct WOLFSSL_EVP_PKEY WOLFSSL_EVP_PKEY; #define WOLFSSL_EVP_TYPE_DEFINED #endif @@ -203,7 +203,6 @@ typedef struct WOLFSSL_EVP_CIPHER_CTX { int lastUsed; } WOLFSSL_EVP_CIPHER_CTX; - typedef struct WOLFSSL_EVP_PKEY_CTX { WOLFSSL_EVP_PKEY *pkey; int op; /* operation */ diff --git a/wolfssl/ssl.h b/wolfssl/ssl.h index 99f16ca703..606f39249b 100644 --- a/wolfssl/ssl.h +++ b/wolfssl/ssl.h @@ -193,12 +193,6 @@ struct WOLFSSL_ASN1_TIME { /* ASN_TIME | LENGTH | date bytes */ }; -#ifndef WOLFSSL_EVP_TYPE_DEFINED -typedef struct WOLFSSL_EVP_PKEY WOLFSSL_EVP_PKEY; -typedef char WOLFSSL_EVP_MD; -#define WOLFSSL_EVP_TYPE_DEFINED -#endif - struct WOLFSSL_EVP_PKEY { void* heap; int type; /* openssh dereference */ @@ -224,6 +218,12 @@ struct WOLFSSL_EVP_PKEY { }; typedef struct WOLFSSL_EVP_PKEY WOLFSSL_PKCS8_PRIV_KEY_INFO; +#ifndef WOLFSSL_EVP_TYPE_DEFINED /* guard on redeclaration */ +typedef struct WOLFSSL_EVP_PKEY WOLFSSL_EVP_PKEY; +typedef char WOLFSSL_EVP_MD; +#define WOLFSSL_EVP_TYPE_DEFINED +#endif + #define WOLFSSL_EVP_PKEY_DEFAULT EVP_PKEY_RSA /* default key type */ typedef struct WOLFSSL_MD4_CTX {