Skip to content

Commit 71640e5

Browse files
author
Mika Tervonen
committed
Merge pull request #8 from ARMmbed/thread-interop_fix
Coap service security fixes
2 parents 379442e + 55fcb85 commit 71640e5

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

source/coap_security_handler.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ static int simple_cookie_check(void *ctx,
205205
/**** Key export function ****/
206206

207207
static int export_key_block(void *ctx,
208-
const unsigned char *kb, const unsigned char *mk,
208+
const unsigned char *mk, const unsigned char *kb,
209209
size_t maclen, size_t keylen, size_t ivlen)
210210
{
211211
key_block_t *p_key_block = (key_block_t *)ctx;
@@ -413,6 +413,9 @@ int coap_security_handler_connect_non_blocking(coap_security_t *sec, bool is_ser
413413
simple_cookie_check,
414414
&sec->_cookie);
415415

416+
mbedtls_ssl_conf_min_version(&sec->_conf, MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MAJOR_VERSION_3);
417+
mbedtls_ssl_conf_max_version(&sec->_conf, MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MAJOR_VERSION_3);
418+
416419
sec->_is_started = true;
417420

418421
int ret = mbedtls_ssl_handshake_step( &sec->_ssl );

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,13 @@ int mbedtls_ssl_close_notify( mbedtls_ssl_context *a )
2828

2929
void mbedtls_ssl_init( mbedtls_ssl_context *a ){
3030

31+
}
32+
void mbedtls_ssl_conf_min_version( mbedtls_ssl_config *conf, int major, int minor ){
33+
34+
}
35+
36+
void mbedtls_ssl_conf_max_version( mbedtls_ssl_config *conf, int major, int minor ){
37+
3138
}
3239

3340
void mbedtls_ssl_config_init( mbedtls_ssl_config *a ){

0 commit comments

Comments
 (0)