]> www.wagner.pp.ru Git - openssl-gost/engine.git/blobdiff - gost12sum.c
Make it possible to re-define OPENSSL_ENGINES_INSTALL_DIR
[openssl-gost/engine.git] / gost12sum.c
index d6a50ed2676bcd5198d8e6b8c78a532fd822f4e3..15e2941f613c9c4ac869eae9a4fe2ea304303814 100644 (file)
  **********************************************************************/
 #include <stdio.h>
 #include <stdlib.h>
+#ifdef _MSC_VER
+#include "getopt.h"
+# ifndef PATH_MAX
+#  define PATH_MAX _MAX_PATH
+# endif
+#include <BaseTsd.h>
+typedef SSIZE_T ssize_t;
+#else
 #include <unistd.h>
+#endif
 #include <limits.h>
 #include <fcntl.h>
 #ifdef _WIN32
@@ -214,12 +223,12 @@ int hash_file(gost_hash_ctx * ctx, char *filename, char *sum, int mode)
 int hash_stream(gost_hash_ctx * ctx, int fd, char *sum)
 {
     unsigned char buffer[BUF_SIZE];
-    unsigned char reverted_buffer[BUF_SIZE];
     ssize_t bytes;
-    int i, j, k;
+               size_t i;
+
     start_hash12(ctx);
     while ((bytes = read(fd, buffer, BUF_SIZE)) > 0) {
-        hash12_block(ctx, reverted_buffer, bytes);
+        hash12_block(ctx, buffer, bytes);
     }
     if (bytes < 0) {
         return 0;