From d12263d64098235735d35eff6b093cc65b8b42c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cmichaealzhang?= Date: Sat, 18 Sep 2021 14:52:56 +0800 Subject: [PATCH] controller_adjust_to_add_device-id --- ndniot/controller.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ndniot/controller.py b/ndniot/controller.py index 5ef22fd..6a9d425 100644 --- a/ndniot/controller.py +++ b/ndniot/controller.py @@ -280,7 +280,8 @@ def on_sd_ctl_interest(name: FormalName, param: InterestParam, app_param: Option validator=self.verify_device_ecdsa_signature, need_sig_ptrs=True) def on_access_control_ekey_request(name: FormalName, param: InterestParam, app_param: Optional[BinaryStr], sig_ptrs: SignaturePtrs): logging.debug(F'******EKEY Timestamp*****: {int(round(time.time() * 1000))}') - target_service = name[-2] + #target_service = name[-2] #original + target_service = name[-3] # use [-3] because name was added with /device-id/ logging.debug(bytes(target_service)) target_service = bytes(target_service)[-1] logging.debug('target service id: %s', str(target_service)) @@ -317,7 +318,8 @@ def on_access_control_ekey_request(name: FormalName, param: InterestParam, app_p @self.app.route([self.system_prefix, bytearray(b'\x08\x01\x03'), bytearray(b'\x08\x01\x01')], validator=self.verify_device_ecdsa_signature, need_sig_ptrs=True) def on_access_control_dkey_request(name: FormalName, param: InterestParam, app_param: Optional[BinaryStr], sig_ptrs): - target_service = name[-2] + #target_service = name[-2] #original + target_service = name[-3] # use [-3] because name was added with /device-id/ logging.debug(bytes(target_service)) target_service = bytes(target_service)[-1] logging.debug('target service id: %s', str(target_service))