Skip to content

Commit

Permalink
Squashed 'features/nanostack/coap-service/' changes from e5e0c13..5aa…
Browse files Browse the repository at this point in the history
…54b8

5aa54b8 Merge pull request ARMmbed#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
  • Loading branch information
Arto Kinnunen committed Apr 16, 2020
1 parent 190eb9a commit 199407f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,8 @@ static int coap_security_handler_init(coap_security_t *sec)
#elif defined(MBEDTLS_HMAC_DRBG_C)
if ((mbedtls_hmac_drbg_seed(&sec->_drbg, mbedtls_md_info_from_type(MBEDTLS_MD_SHA256),
mbedtls_entropy_func, &sec->_entropy,
(const unsigned char *) pers,
strlen(pers))) != 0) {
(const unsigned char *) pers,
strlen(pers))) != 0) {
return -1;
}
#else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,33 +249,33 @@ int mbedtls_ctr_drbg_random(void *p_rng,
}

// from hmac_drbg.h
void mbedtls_hmac_drbg_init( mbedtls_hmac_drbg_context *ctx )
void mbedtls_hmac_drbg_init(mbedtls_hmac_drbg_context *ctx)
{

}

void mbedtls_hmac_drbg_free( mbedtls_hmac_drbg_context *ctx )
void mbedtls_hmac_drbg_free(mbedtls_hmac_drbg_context *ctx)
{

}

int mbedtls_hmac_drbg_seed( mbedtls_hmac_drbg_context *ctx,
const mbedtls_md_info_t * md_info,
int (*f_entropy)(void *, unsigned char *, size_t),
void *p_entropy,
const unsigned char *custom,
size_t len )
int mbedtls_hmac_drbg_seed(mbedtls_hmac_drbg_context *ctx,
const mbedtls_md_info_t *md_info,
int (*f_entropy)(void *, unsigned char *, size_t),
void *p_entropy,
const unsigned char *custom,
size_t len)
{
return mbedtls_stub.crt_expected_int;
}

int mbedtls_hmac_drbg_random( void *p_rng, unsigned char *output, size_t out_len )
int mbedtls_hmac_drbg_random(void *p_rng, unsigned char *output, size_t out_len)
{
return mbedtls_stub.crt_expected_int;
}

// from md.h
const mbedtls_md_info_t *mbedtls_md_info_from_type( mbedtls_md_type_t md_type )
const mbedtls_md_info_t *mbedtls_md_info_from_type(mbedtls_md_type_t md_type)
{
return 0;
}
Expand Down

0 comments on commit 199407f

Please sign in to comment.