Skip to content

Commit

Permalink
Merge pull request #1 from Yurik72/master
Browse files Browse the repository at this point in the history
Upstream
  • Loading branch information
judepereira authored Feb 28, 2021
2 parents de69b88 + abee258 commit 9f123a0
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 6 deletions.
Binary file modified .vs/ESPHap/v15/.suo
Binary file not shown.
Binary file modified .vs/slnx.sqlite
Binary file not shown.
1 change: 1 addition & 0 deletions arduino_homekit_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2073,6 +2073,7 @@ void homekit_server_on_pair_verify(client_context_t *context, const byte *data,
tlv_free(decrypted_message);
pair_verify_context_free(context->verify_context);
context->verify_context = NULL;

send_tlv_error_response(context, 4, TLVError_Authentication);
break;
}
Expand Down
2 changes: 1 addition & 1 deletion examples/EspHap_GarageDoor/EspHap_GarageDoor.ino
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ extern "C"{
#ifdef ESP8266
#include "homekitintegrationcpp.h"
#endif
#include <hapfilestorage\hapfilestorage.hpp>
#include <hapfilestorage/hapfilestorage.hpp>



Expand Down
2 changes: 1 addition & 1 deletion examples/EspHap_WindowCovering/EspHap_WindowCovering.ino
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ extern "C"{
#ifdef ESP8266
#include "homekitintegrationcpp.h"
#endif
#include <hapfilestorage\hapfilestorage.hpp>
#include <hapfilestorage/hapfilestorage.hpp>



Expand Down
2 changes: 1 addition & 1 deletion homeintegration.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#include "storage.h"
#include "storage_ex.h"

#define MAX_SERVICES 20
//#define MAX_SERVICES 20


static callback_storagechanged callbackstorage_integration=NULL;
Expand Down
7 changes: 4 additions & 3 deletions server.c
Original file line number Diff line number Diff line change
Expand Up @@ -1966,6 +1966,7 @@ void homekit_server_on_pair_verify(client_context_t *context, const byte *data,
CLIENT_ERROR(context, "Failed to verify device signature (code %d)", r);

pair_verify_context_free(context->verify_context);
homekit_storage_pairing_free(pairing);
context->verify_context = NULL;

send_tlv_error_response(context, 4, TLVError_Authentication);
Expand All @@ -1991,7 +1992,7 @@ void homekit_server_on_pair_verify(client_context_t *context, const byte *data,

pair_verify_context_free(context->verify_context);
context->verify_context = NULL;

homekit_storage_pairing_free(pairing);
send_tlv_error_response(context, 4, TLVError_Unknown);
break;
}
Expand All @@ -2012,7 +2013,7 @@ void homekit_server_on_pair_verify(client_context_t *context, const byte *data,
if (r) {
CLIENT_ERROR(context, "Failed to derive write encryption key (code %d)", r);


homekit_storage_pairing_free(pairing);
send_tlv_error_response(context, 4, TLVError_Unknown);
break;
}
Expand All @@ -2025,7 +2026,7 @@ void homekit_server_on_pair_verify(client_context_t *context, const byte *data,
context->pairing_id = pairing_id;
context->permissions = permissions;
context->encrypted = true;

homekit_storage_pairing_free(pairing);
HOMEKIT_NOTIFY_EVENT(context->server, HOMEKIT_EVENT_CLIENT_VERIFIED);

CLIENT_INFO(context, "Verification successful, secure session established");
Expand Down

0 comments on commit 9f123a0

Please sign in to comment.