From 744ecaa5b6c024c4dfb9036e5efb65f7fec4f784 Mon Sep 17 00:00:00 2001
From: "Dr. Stephen Henson" <steve@openssl.org>
Date: Fri, 4 Jan 2008 00:37:23 +0000
Subject: [PATCH] Avoid WIN32 signed/unsigned warnings.

---
 engines/ccgost/gost89.c     | 4 ++--
 engines/ccgost/gost_crypt.c | 8 ++++----
 engines/ccgost/gost_lcl.h   | 1 -
 engines/ccgost/gosthash.c   | 2 +-
 4 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/engines/ccgost/gost89.c b/engines/ccgost/gost89.c
index c44143dca7..91a858a7bc 100644
--- a/engines/ccgost/gost89.c
+++ b/engines/ccgost/gost89.c
@@ -354,7 +354,7 @@ int gost_mac(gost_ctx *ctx,int mac_len,const unsigned char *data,
 	{
 	byte buffer[8]={0,0,0,0,0,0,0,0};
 	byte buf2[8];
-	int i;
+	unsigned int i;
 	for (i=0;i+8<=data_len;i+=8) 
 		mac_block(ctx,buffer,data+i);
 	if (i<data_len)
@@ -373,7 +373,7 @@ int gost_mac_iv(gost_ctx *ctx,int mac_len,const unsigned char *iv,const unsigned
 	{
 	byte buffer[8];
 	byte buf2[8];
-	int i;
+	unsigned int i;
 	memcpy (buffer,iv,8);
 	for (i=0;i+8<=data_len;i+=8) 
 		mac_block(ctx,buffer,data+i);
diff --git a/engines/ccgost/gost_crypt.c b/engines/ccgost/gost_crypt.c
index a6736836c4..277921f02d 100644
--- a/engines/ccgost/gost_crypt.c
+++ b/engines/ccgost/gost_crypt.c
@@ -251,8 +251,8 @@ int	gost_cipher_do_cfb(EVP_CIPHER_CTX *ctx, unsigned char *out,
 	{
 	const unsigned char *in_ptr=in;
 	unsigned char *out_ptr=out;
-	int i=0;
-	int j=0;
+	unsigned int i=0;
+	unsigned int j=0;
 /* process partial block if any */
 	if (ctx->num) 
 		{
@@ -313,8 +313,8 @@ static int gost_cipher_do_cnt(EVP_CIPHER_CTX *ctx, unsigned char *out,
 	{
 	const unsigned char *in_ptr=in;
 	unsigned char *out_ptr=out;
-	int i=0;
-	int j;
+	unsigned int i=0;
+	unsigned int j;
 /* process partial block if any */
 	if (ctx->num) 
 		{
diff --git a/engines/ccgost/gost_lcl.h b/engines/ccgost/gost_lcl.h
index 6a67f05123..7996db569b 100644
--- a/engines/ccgost/gost_lcl.h
+++ b/engines/ccgost/gost_lcl.h
@@ -16,7 +16,6 @@
 #include <openssl/x509.h>
 #include <openssl/engine.h>
 #include <openssl/ec.h>
-#include <unistd.h>
 #include "gost89.h"
 #include "gosthash.h"
 /* Control commands */
diff --git a/engines/ccgost/gosthash.c b/engines/ccgost/gosthash.c
index 1acd16317b..de55e0c3aa 100644
--- a/engines/ccgost/gosthash.c
+++ b/engines/ccgost/gosthash.c
@@ -185,7 +185,7 @@ int hash_block(gost_hash_ctx *ctx,const byte *block, size_t length)
 	if (ctx->left)
 		{
 		/*There are some bytes from previous step*/
-		int add_bytes = 32-ctx->left;
+		unsigned int add_bytes = 32-ctx->left;
 		if (add_bytes>length)
 			{
 			add_bytes = length;
-- 
2.25.1