Skip to content

Commit 03edf99

Browse files
author
Juhani Puurula
committed
Squashed 'features/nanostack/coap-service/' changes from 36d36ce..1cb994e
1cb994e Move security _pkey into X.509 condition (#99) git-subtree-dir: features/nanostack/coap-service git-subtree-split: 1cb994e
1 parent 4cb7e03 commit 03edf99

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

source/coap_security_handler.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ struct coap_security_s {
5151
#if defined(MBEDTLS_X509_CRT_PARSE_C)
5252
mbedtls_x509_crt _cacert;
5353
mbedtls_x509_crt _owncert;
54-
#endif
5554
mbedtls_pk_context _pkey;
55+
#endif
5656

5757
uint8_t _pw[64];
5858
uint8_t _pw_len;
@@ -109,8 +109,8 @@ static int coap_security_handler_init(coap_security_t *sec){
109109
#if defined(MBEDTLS_X509_CRT_PARSE_C)
110110
mbedtls_x509_crt_init( &sec->_cacert );
111111
mbedtls_x509_crt_init( &sec->_owncert );
112-
#endif
113112
mbedtls_pk_init( &sec->_pkey );
113+
#endif
114114

115115
memset(&sec->_cookie, 0, sizeof(simple_cookie_t));
116116
memset(&sec->_keyblk, 0, sizeof(key_block_t));
@@ -145,9 +145,8 @@ static void coap_security_handler_reset(coap_security_t *sec){
145145
#if defined(MBEDTLS_X509_CRT_PARSE_C)
146146
mbedtls_x509_crt_free(&sec->_cacert);
147147
mbedtls_x509_crt_free(&sec->_owncert);
148-
#endif
149-
150148
mbedtls_pk_free(&sec->_pkey);
149+
#endif
151150

152151
mbedtls_entropy_free( &sec->_entropy );
153152
mbedtls_ctr_drbg_free( &sec->_ctr_drbg );

0 commit comments

Comments
 (0)