Deprecate the recursive includes of bn.h from various API headers (asn1.h,
[openssl.git] / crypto / ecdh / ech_ossl.c
index 076eb2ea1f6bc3012d6904925c491347107ba8b3..d61e54f184c057c994e95f1a1dffcf7f6e3ce34a 100644 (file)
@@ -68,6 +68,7 @@
  */
 
 
+#include <string.h>
 #include <limits.h>
 
 #include "cryptlib.h"
@@ -76,6 +77,7 @@
 #include <openssl/err.h>
 #include <openssl/sha.h>
 #include <openssl/obj_mac.h>
+#include <openssl/bn.h>
 
 static int ecdh_compute_key(void *out, size_t len, const EC_POINT *pub_key, EC_KEY *ecdh,
                             void *(*KDF)(void *in, size_t inlen, void *out, size_t outlen));
@@ -108,7 +110,8 @@ static int ecdh_compute_key(void *out, size_t outlen, const EC_POINT *pub_key, E
        BN_CTX *ctx;
        EC_POINT *tmp=NULL;
        BIGNUM *x=NULL, *y=NULL;
-       int ret= -1, buflen, len;
+       int ret= -1;
+       size_t buflen, len;
        unsigned char *buf=NULL;
 
        if (outlen > INT_MAX)
@@ -171,7 +174,7 @@ static int ecdh_compute_key(void *out, size_t outlen, const EC_POINT *pub_key, E
                }
        
        memset(buf, 0, buflen - len);
-       if (len != BN_bn2bin(x, buf + buflen - len))
+       if (len != (size_t)BN_bn2bin(x, buf + buflen - len))
                {
                ECDHerr(ECDH_F_ECDH_COMPUTE_KEY,ERR_R_BN_LIB);
                goto err;