Skip to content

Commit 994ae2e

Browse files
Mohammad Azim Khan0xc0170
authored andcommitted
Fix compilation for disabled flags
1 parent 062f29b commit 994ae2e

File tree

2 files changed

+4
-17
lines changed

2 files changed

+4
-17
lines changed

TESTS/mbedtls/ecp/main.cpp

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* mbed Microcontroller Library
2-
* Copyright (c) 2016 ARM Limited
2+
* Copyright (c) 2017 ARM Limited
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -37,11 +37,6 @@ using namespace utest::v1;
3737
#else
3838
#include <stdio.h>
3939
#include <stdlib.h>
40-
#define mbedtls_printf printf
41-
#define mbedtls_snprintf snprintf
42-
#define mbedtls_exit exit
43-
#define MBEDTLS_EXIT_SUCCESS EXIT_SUCCESS
44-
#define MBEDTLS_EXIT_FAILURE EXIT_FAILURE
4540
#endif
4641

4742
#ifndef PUT_UINT32_BE
@@ -86,20 +81,13 @@ typedef struct
8681
*/
8782
static int rnd_std_rand( void *rng_state, unsigned char *output, size_t len )
8883
{
89-
#if !defined(__OpenBSD__)
9084
size_t i;
9185

9286
if( rng_state != NULL )
9387
rng_state = NULL;
9488

9589
for( i = 0; i < len; ++i )
9690
output[i] = rand();
97-
#else
98-
if( rng_state != NULL )
99-
rng_state = NULL;
100-
101-
arc4random_buf( output, len );
102-
#endif /* !OpenBSD */
10391

10492
return( 0 );
10593
}
@@ -144,7 +132,7 @@ static int rnd_pseudo_rand( void *rng_state, unsigned char *output, size_t len )
144132

145133
return( 0 );
146134
}
147-
/* BEGIN_CASE */
135+
148136
void ecp_test_vect( mbedtls_ecp_group_id id, const char *dA_str, const char *xA_str, const char *yA_str,
149137
const char *dB_str, const char *xB_str, const char *yB_str, const char *xZ_str,
150138
const char *yZ_str )
@@ -202,7 +190,6 @@ void ecp_test_vect( mbedtls_ecp_group_id id, const char *dA_str, const char *xA_
202190
TEST_ASSERT(_assert == -1);
203191
}
204192

205-
/* END_CASE */
206193
#define UTEST_FOR_ECP_TEST_VECTOR(id, dA_str, xA_str, yA_str, dB_str, xB_str, yB_str, xZ_str, yZ_str) \
207194
void utest_ ## id () { \
208195
ecp_test_vect(id, dA_str, xA_str, yA_str, dB_str, xB_str, yB_str, xZ_str, yZ_str); \
@@ -211,8 +198,7 @@ Case case_ ## id (#id, utest_ ## id) \
211198

212199

213200
#if defined MBEDTLS_ECP_DP_SECP192R1_ENABLED
214-
UTEST_FOR_ECP_TEST_VECTOR(ecp_test_vect,
215-
MBEDTLS_ECP_DP_SECP192R1,
201+
UTEST_FOR_ECP_TEST_VECTOR( MBEDTLS_ECP_DP_SECP192R1,
216202
"323FA3169D8E9C6593F59476BC142000AB5BE0E249C43426",
217203
"CD46489ECFD6C105E7B3D32566E2B122E249ABAADD870612",
218204
"68887B4877DF51DD4DC3D6FD11F0A26F8FD3844317916E9A",

TESTS/mbedtls/selftest/main.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ using namespace utest::v1;
2828
#include MBEDTLS_CONFIG_FILE
2929
#endif
3030

31+
#include "mbedtls/sha1.h"
3132
#include "mbedtls/sha256.h"
3233
#include "mbedtls/sha512.h"
3334
#include "mbedtls/entropy.h"

0 commit comments

Comments
 (0)