resolves redefinition warnings with clang builds

This commit is contained in:
Jacob Barthelmeh
2017-03-24 16:26:43 -06:00
parent 60b21ffa62
commit 52a89349dd
4 changed files with 11 additions and 13 deletions

View File

@@ -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;

View File

@@ -214,6 +214,7 @@
#endif
#ifdef OPENSSL_EXTRA
#include <wolfssl/openssl/asn1.h>
#include <wolfssl/openssl/ssl.h>
#include <wolfssl/openssl/crypto.h>
#include <wolfssl/openssl/pkcs12.h>

View File

@@ -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 */

View File

@@ -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 {