Skip to content

Commit 0cc4b9d

Browse files
author
“michaealzhang
committed
access-control_add_device-id_to_interest-name
1 parent 6739d9c commit 0cc4b9d

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

app-support/access-control.c

+8-1
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,9 @@ _express_ekey_interest(uint8_t service)
393393
if (ret != 0) return ret;
394394
ret = ndn_name_append_bytes_component(&interest.name, &service, 1);
395395
if (ret != 0) return ret;
396+
// append device-id to ekey_interest_name
397+
ret = ndn_name_append_component(&interest.name, &storage->self_identity[0].components[storage->self_identity[0].components_size - 1]);
398+
if (ret != 0) return ret;
396399

397400
// signature signing
398401
ndn_name_t* self_identity = ndn_key_storage_get_self_identity(service);
@@ -446,6 +449,10 @@ _express_dkey_interest(uint8_t service)
446449
if (ret != 0) return ret;
447450
ret = ndn_name_append_bytes_component(&interest.name, &service, 1);
448451
if (ret != 0) return ret;
452+
// append device-id to dkey_interest_name
453+
ret = ndn_name_append_component(&interest.name, &storage->self_identity[0].components[storage->self_identity[0].components_size - 1]);
454+
if (ret != 0) return ret;
455+
449456

450457
// TODO: figure out a better way to sign instead of using the first cert
451458
ndn_signed_interest_ecdsa_sign(&interest, &storage->self_identity[0], &storage->self_identity_key[0]);
@@ -603,4 +610,4 @@ ndn_ac_trigger_expiration(uint8_t service, uint32_t received_keyid)
603610
}
604611

605612
return NDN_SUCCESS;
606-
}
613+
}

0 commit comments

Comments
 (0)