From 75e223a024c96d8c8cf78cde4d213abfb32b69a3 Mon Sep 17 00:00:00 2001 From: hathach Date: Thu, 25 Jan 2018 18:14:19 +0700 Subject: [PATCH] more clean up --- libraries/BLEHomekit/src/crypto/srp/srp.c | 8 -------- libraries/BLEHomekit/src/service/HAPPairing.cpp | 6 +++--- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/libraries/BLEHomekit/src/crypto/srp/srp.c b/libraries/BLEHomekit/src/crypto/srp/srp.c index 1df1762f..7db81213 100644 --- a/libraries/BLEHomekit/src/crypto/srp/srp.c +++ b/libraries/BLEHomekit/src/crypto/srp/srp.c @@ -91,9 +91,6 @@ void srp_init(void) // The MPI library uses a ridiculous amount of memory. We use the stack allocator // so we don't tie this memory up except when we absolutely need to. // uint8_t memory[11 * 1024]; -// uint8_t* memory = (uint8_t*) rtos_malloc(11*1024); -// VERIFY(memory, ); -// // memory_buffer_alloc_init(memory, sizeof(memory)); // Generate salt @@ -170,7 +167,6 @@ void srp_init(void) mpi_free(&x); // memory_buffer_alloc_free(); -// rtos_free(memory); } void srp_start(void) @@ -186,9 +182,6 @@ uint8_t srp_setA(uint8_t* abuf, uint16_t length, moretime_t moretime) // The MPI library uses a ridiculous amount of memory. We use the stack allocator // so we don't tie this memory up except when we absolutely need to. // uint8_t memory[11 * 1024]; -// uint8_t* memory = (uint8_t*) rtos_malloc(11*1024); -// VERIFY(memory, NRF_ERROR_NO_MEM); -// // memory_buffer_alloc_init(memory, sizeof(memory)); // getK @@ -265,7 +258,6 @@ uint8_t srp_setA(uint8_t* abuf, uint16_t length, moretime_t moretime) } // memory_buffer_alloc_free(); -// rtos_free(memory); // getM1 - username s abuf srp.B K { diff --git a/libraries/BLEHomekit/src/service/HAPPairing.cpp b/libraries/BLEHomekit/src/service/HAPPairing.cpp index 820822c0..41cdf11f 100644 --- a/libraries/BLEHomekit/src/service/HAPPairing.cpp +++ b/libraries/BLEHomekit/src/service/HAPPairing.cpp @@ -221,14 +221,14 @@ HAPResponse_t* HAPPairing::pair_setup_m1(HAPRequest_t const* hap_req) TLV8_t tlv_para[] = { { .type = PAIRING_TYPE_STATE , .len = 1 , .value = &mstate }, - { .type = PAIRING_TYPE_SALT , .len = 16 , .value = srp_getSalt() }, { .type = PAIRING_TYPE_PUBLIC_KEY , .len = 384, .value = srp_getB() }, + { .type = PAIRING_TYPE_SALT , .len = 16 , .value = srp_getSalt() }, }; #if DEBUG_HAP_PAIRING LOG_LV2_BUFFER("SRP State" , tlv_para[0].value, tlv_para[0].len); - LOG_LV2_BUFFER("SRP Salt" , tlv_para[1].value, tlv_para[1].len); - LOG_LV2_BUFFER("SRP Pub Key", tlv_para[2].value, tlv_para[2].len); + LOG_LV2_BUFFER("SRP Pub Key", tlv_para[1].value, tlv_para[1].len); + LOG_LV2_BUFFER("SRP Salt" , tlv_para[2].value, tlv_para[2].len); #endif return createSrpResponse(hap_req->header.tid, HAP_STATUS_SUCCESS, tlv_para, arrcount(tlv_para));