Skip to content

Commit 088f168

Browse files
committed
Fixes for building C signing tools on Windows (Cygwin/MinGW).
1 parent c840851 commit 088f168

2 files changed

Lines changed: 21 additions & 19 deletions

File tree

tools/keytools/keygen.c

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,15 @@
2626
/* Must also define DEBUG_WOLFSSL in user_settings.h */
2727
//#define DEBUG_SIGNTOOL
2828

29+
#include <stdio.h>
30+
#include <stdarg.h>
31+
#include <stdlib.h>
32+
#include <string.h>
33+
#include <limits.h>
34+
#include <sys/stat.h>
35+
#include <sys/types.h>
36+
#include <errno.h>
37+
2938
#include <wolfssl/wolfcrypt/settings.h>
3039
#ifndef NO_RSA
3140
#include <wolfssl/wolfcrypt/rsa.h>
@@ -45,15 +54,7 @@
4554
#include <wolfssl/wolfcrypt/logging.h>
4655
#endif
4756

48-
#include <stdio.h>
49-
#include <stdlib.h>
50-
#include <string.h>
51-
#include <limits.h>
52-
#include <sys/stat.h>
53-
#include <sys/types.h>
54-
#include <errno.h>
55-
56-
#ifdef _WIN32
57+
#if defined(_WIN32) && !defined(PATH_MAX)
5758
#define PATH_MAX 256
5859
#endif
5960

@@ -252,8 +253,8 @@ int main(int argc, char** argv)
252253
{
253254
int i;
254255
int force = 0;
255-
int keytype;
256-
const char *kfilename;
256+
int keytype = 0;
257+
const char *kfilename = NULL;
257258
char *output_pubkey_file;
258259
WC_RNG rng;
259260
FILE *f;

tools/keytools/sign.c

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,14 @@
2626
/* Must also define DEBUG_WOLFSSL in user_settings.h */
2727
//#define DEBUG_SIGNTOOL
2828

29+
#include <stdio.h>
30+
#include <stdarg.h>
31+
#include <stdlib.h>
32+
#include <string.h>
33+
#include <limits.h>
34+
#include <sys/stat.h>
35+
#include <sys/types.h>
36+
2937
#include <wolfssl/wolfcrypt/settings.h>
3038
#ifndef NO_RSA
3139
#include <wolfssl/wolfcrypt/rsa.h>
@@ -48,14 +56,7 @@
4856
#include <wolfssl/wolfcrypt/logging.h>
4957
#endif
5058

51-
#include <stdio.h>
52-
#include <stdlib.h>
53-
#include <string.h>
54-
#include <limits.h>
55-
#include <sys/stat.h>
56-
#include <sys/types.h>
57-
58-
#ifdef _WIN32
59+
#if defined(_WIN32) && !defined(PATH_MAX)
5960
#define PATH_MAX 256
6061
#endif
6162

0 commit comments

Comments
 (0)