Reduce duplication in request handler tables
[tinc] / src / nolegacy / crypto.c
index 73c4916..6965218 100644 (file)
@@ -21,7 +21,7 @@
 
 #include "../crypto.h"
 
-#ifndef HAVE_MINGW
+#ifndef HAVE_WINDOWS
 
 static int random_fd = -1;
 
@@ -43,7 +43,7 @@ static void random_exit(void) {
 }
 
 void randomize(void *vout, size_t outlen) {
-       char *out = vout;
+       uint8_t *out = vout;
 
        while(outlen) {
                ssize_t len = read(random_fd, out, outlen);
@@ -67,14 +67,14 @@ void randomize(void *vout, size_t outlen) {
 #include <wincrypt.h>
 HCRYPTPROV prov;
 
-void random_init(void) {
+static void random_init(void) {
        if(!CryptAcquireContext(&prov, NULL, NULL, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT)) {
                fprintf(stderr, "CryptAcquireContext() failed!\n");
                abort();
        }
 }
 
-void random_exit(void) {
+static void random_exit(void) {
        CryptReleaseContext(prov, 0);
 }