Skip to content

Commit 199407f

Browse files
author
Arto Kinnunen
committed
Squashed 'features/nanostack/coap-service/' changes from e5e0c13..5aa54b8
5aa54b8 Merge pull request #127 from ARMmbed/sync_with_mbedos 6fe7841 Follow Mbed OS coding style 2b708be trace group defiined for shared_rng d4c2cac more error handling added for ctr and hmac cace1e9 Added missing optimizations based on mbedtls/baremetal.h config 2cc7442 Added new global rng, needed for MbedTLS optimisations f861157 Prepare for upcoming MbedTLS changes git-subtree-dir: features/nanostack/coap-service git-subtree-split: 5aa54b8
1 parent 190eb9a commit 199407f

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

features/nanostack/coap-service/source/coap_security_handler.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,8 @@ static int coap_security_handler_init(coap_security_t *sec)
155155
#elif defined(MBEDTLS_HMAC_DRBG_C)
156156
if ((mbedtls_hmac_drbg_seed(&sec->_drbg, mbedtls_md_info_from_type(MBEDTLS_MD_SHA256),
157157
mbedtls_entropy_func, &sec->_entropy,
158-
(const unsigned char *) pers,
159-
strlen(pers))) != 0) {
158+
(const unsigned char *) pers,
159+
strlen(pers))) != 0) {
160160
return -1;
161161
}
162162
#else

features/nanostack/coap-service/test/coap-service/unittest/stub/mbedtls_stub.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -249,33 +249,33 @@ int mbedtls_ctr_drbg_random(void *p_rng,
249249
}
250250

251251
// from hmac_drbg.h
252-
void mbedtls_hmac_drbg_init( mbedtls_hmac_drbg_context *ctx )
252+
void mbedtls_hmac_drbg_init(mbedtls_hmac_drbg_context *ctx)
253253
{
254254

255255
}
256256

257-
void mbedtls_hmac_drbg_free( mbedtls_hmac_drbg_context *ctx )
257+
void mbedtls_hmac_drbg_free(mbedtls_hmac_drbg_context *ctx)
258258
{
259259

260260
}
261261

262-
int mbedtls_hmac_drbg_seed( mbedtls_hmac_drbg_context *ctx,
263-
const mbedtls_md_info_t * md_info,
264-
int (*f_entropy)(void *, unsigned char *, size_t),
265-
void *p_entropy,
266-
const unsigned char *custom,
267-
size_t len )
262+
int mbedtls_hmac_drbg_seed(mbedtls_hmac_drbg_context *ctx,
263+
const mbedtls_md_info_t *md_info,
264+
int (*f_entropy)(void *, unsigned char *, size_t),
265+
void *p_entropy,
266+
const unsigned char *custom,
267+
size_t len)
268268
{
269269
return mbedtls_stub.crt_expected_int;
270270
}
271271

272-
int mbedtls_hmac_drbg_random( void *p_rng, unsigned char *output, size_t out_len )
272+
int mbedtls_hmac_drbg_random(void *p_rng, unsigned char *output, size_t out_len)
273273
{
274274
return mbedtls_stub.crt_expected_int;
275275
}
276276

277277
// from md.h
278-
const mbedtls_md_info_t *mbedtls_md_info_from_type( mbedtls_md_type_t md_type )
278+
const mbedtls_md_info_t *mbedtls_md_info_from_type(mbedtls_md_type_t md_type)
279279
{
280280
return 0;
281281
}

0 commit comments

Comments
 (0)