[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master-chacha20 patch so it builds under windows


This is a patch against this branch:
   https://git.libssh.org/users/asn/libssh.git/log/?h=master-chacha20

This patch + the patch I sent earlier against master: "knownhosts: Fix
windows build failure"
makes this branch compile under Windows.
From 664c13c137be5aaaaa4011575a0072e0a3b3b902 Mon Sep 17 00:00:00 2001
From: Alberto Aguirre <albaguirre@xxxxxxxxx>
Date: Fri, 22 Jun 2018 00:41:49 -0500
Subject: [PATCH] chacha: Avoid unistd.h so it compiles under windows

Signed-off-by: Alberto Aguirre <albaguirre@xxxxxxxxx>
---
 src/external/chacha.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/external/chacha.c b/src/external/chacha.c
index 062aafb8..e47a6328 100644
--- a/src/external/chacha.c
+++ b/src/external/chacha.c
@@ -5,7 +5,7 @@ Public domain.
  */
 
 #include <stdint.h>
-#include <unistd.h>
+#include <stddef.h>
 #include <sys/types.h>
 
 #include "libssh/chacha.h"
@@ -92,7 +92,7 @@ chacha_encrypt_bytes(chacha_ctx *x,const uint8_t *m,uint8_t *c,uint32_t bytes)
     uint32_t j0, j1, j2, j3, j4, j5, j6, j7, j8, j9, j10, j11, j12, j13, j14, j15;
     uint8_t *ctarget = NULL;
     uint8_t tmp[64];
-    u_int i;
+    uint32_t i;
 
     if (!bytes) return;
 
-- 
2.17.1


Archive administrator: postmaster@lists.cynapses.org