From b92965be740f3eb28f37b249a0332711eb65c497 Mon Sep 17 00:00:00 2001 From: Rich Evans Date: Fri, 30 Jan 2015 11:11:57 +0000 Subject: [PATCH 1/2] modify programs/*.c to use polarssl_snprintf --- programs/pkey/pk_sign.c | 1 + programs/pkey/pk_verify.c | 1 + programs/pkey/rsa_sign_pss.c | 1 + programs/pkey/rsa_verify_pss.c | 1 + programs/ssl/ssl_client2.c | 1 + programs/test/benchmark.c | 4 ++-- programs/test/ssl_cert_test.c | 1 + 7 files changed, 8 insertions(+), 2 deletions(-) diff --git a/programs/pkey/pk_sign.c b/programs/pkey/pk_sign.c index 88561b189..e85350d9f 100644 --- a/programs/pkey/pk_sign.c +++ b/programs/pkey/pk_sign.c @@ -32,6 +32,7 @@ #include #define polarssl_snprintf snprintf #define polarssl_printf printf +#define polarssl_snprintf snprintf #endif #if defined(POLARSSL_BIGNUM_C) && defined(POLARSSL_ENTROPY_C) && \ diff --git a/programs/pkey/pk_verify.c b/programs/pkey/pk_verify.c index d8cd9a144..923afc15e 100644 --- a/programs/pkey/pk_verify.c +++ b/programs/pkey/pk_verify.c @@ -32,6 +32,7 @@ #include #define polarssl_snprintf snprintf #define polarssl_printf printf +#define polarssl_snprintf snprintf #endif #if defined(POLARSSL_BIGNUM_C) && \ diff --git a/programs/pkey/rsa_sign_pss.c b/programs/pkey/rsa_sign_pss.c index 243309621..ad4d0b5f3 100644 --- a/programs/pkey/rsa_sign_pss.c +++ b/programs/pkey/rsa_sign_pss.c @@ -32,6 +32,7 @@ #include #define polarssl_snprintf snprintf #define polarssl_printf printf +#define polarssl_snprintf snprintf #endif #if defined(POLARSSL_BIGNUM_C) && defined(POLARSSL_ENTROPY_C) && \ diff --git a/programs/pkey/rsa_verify_pss.c b/programs/pkey/rsa_verify_pss.c index 65fcfbe87..2b1570a9b 100644 --- a/programs/pkey/rsa_verify_pss.c +++ b/programs/pkey/rsa_verify_pss.c @@ -32,6 +32,7 @@ #include #define polarssl_snprintf snprintf #define polarssl_printf printf +#define polarssl_snprintf snprintf #endif #if defined(POLARSSL_BIGNUM_C) && defined(POLARSSL_RSA_C) && \ diff --git a/programs/ssl/ssl_client2.c b/programs/ssl/ssl_client2.c index e2dac4312..ee2ea130e 100644 --- a/programs/ssl/ssl_client2.c +++ b/programs/ssl/ssl_client2.c @@ -30,6 +30,7 @@ #include "polarssl/platform.h" #else #include +#define polarssl_printf printf #define polarssl_fprintf fprintf #define polarssl_printf printf #define polarssl_snprintf snprintf diff --git a/programs/test/benchmark.c b/programs/test/benchmark.c index edb7c0766..0f2993ce6 100644 --- a/programs/test/benchmark.c +++ b/programs/test/benchmark.c @@ -30,9 +30,9 @@ #include "polarssl/platform.h" #else #include -#define polarssl_snprintf snprintf -#define polarssl_printf printf #define polarssl_exit exit +#define polarssl_printf printf +#define polarssl_snprintf snprintf #endif #if defined(POLARSSL_TIMING_C) diff --git a/programs/test/ssl_cert_test.c b/programs/test/ssl_cert_test.c index 782d6f38a..497860314 100644 --- a/programs/test/ssl_cert_test.c +++ b/programs/test/ssl_cert_test.c @@ -32,6 +32,7 @@ #include #define polarssl_snprintf snprintf #define polarssl_printf printf +#define polarssl_snprintf snprintf #endif #if defined(POLARSSL_RSA_C) && defined(POLARSSL_X509_CRT_PARSE_C) && \ From 012acfc20f663d31ef0718f52bf8ce2bef2d82f2 Mon Sep 17 00:00:00 2001 From: Rich Evans Date: Fri, 30 Jan 2015 12:12:11 +0000 Subject: [PATCH 2/2] modify library/memory_buffer_alloc.c, benchmark.c and the tests main code to use polarssl_exit --- programs/test/benchmark.c | 1 + tests/suites/main_test.function | 1 + 2 files changed, 2 insertions(+) diff --git a/programs/test/benchmark.c b/programs/test/benchmark.c index 0f2993ce6..675547b3b 100644 --- a/programs/test/benchmark.c +++ b/programs/test/benchmark.c @@ -33,6 +33,7 @@ #define polarssl_exit exit #define polarssl_printf printf #define polarssl_snprintf snprintf +#define polarssl_exit exit #endif #if defined(POLARSSL_TIMING_C) diff --git a/tests/suites/main_test.function b/tests/suites/main_test.function index bb1083acf..d67d875ca 100644 --- a/tests/suites/main_test.function +++ b/tests/suites/main_test.function @@ -3,6 +3,7 @@ #if defined(POLARSSL_PLATFORM_C) #include "polarssl/platform.h" #else +#include #define polarssl_exit exit #define polarssl_free free #define polarssl_malloc malloc