Signing Content with Keys
diff --git a/macbook.conf b/macbook.conf
index 52e84f7..6923325 100644
--- a/macbook.conf
+++ b/macbook.conf
@@ -20,6 +20,6 @@
tunnel-type udp
topo-prefix /ndn/routing/nlsr/
-slice-prefix /ndn/routing/nlsr/LSA
+slice-prefix /ndn/routing/nlsr/test
logdir /Users/akmhoque/NLSR2.0
diff --git a/nlsr_ndn.c b/nlsr_ndn.c
index 88cb511..c0e5db8 100644
--- a/nlsr_ndn.c
+++ b/nlsr_ndn.c
@@ -308,8 +308,10 @@
struct ccn_charbuf *pubid = ccn_charbuf_create();
struct ccn_charbuf *pubkey = ccn_charbuf_create();
- int res1;
- res1 = ccn_get_public_key(nlsr->ccn, NULL, pubid, pubkey);
+ //pubid is the digest_result pubkey is result
+ ccn_get_public_key(nlsr->ccn, NULL, pubid, pubkey);
+
+
struct ccn_signing_params sp=CCN_SIGNING_PARAMS_INIT;
sp.template_ccnb=ccn_charbuf_create();
@@ -507,8 +509,16 @@
if ( contain_key_name(info->content_ccnb, info->pco) == 1)
{
struct ccn_charbuf *key_name=get_key_name(info->content_ccnb, info->pco);
+ struct ccn_charbuf *key_uri = ccn_charbuf_create();
+ ccn_uri_append(key_uri, key_name->buf, key_name->length, 1);
+
if(nlsr->debugging)
- printf("Key Name: %s\n",ccn_charbuf_as_string(key_name));
+ printf("Key Name: %s\n",ccn_charbuf_as_string(key_uri));
+
+ ccn_charbuf_destroy(&key_uri);
+ ccn_charbuf_destroy(&key_name);
+
+
}
update_adjacent_timed_out_zero_to_adl(nbr);
diff --git a/nlsr_sync.c b/nlsr_sync.c
index 7ae108a..fb7e892 100644
--- a/nlsr_sync.c
+++ b/nlsr_sync.c
@@ -487,13 +487,13 @@
struct name_prefix *orig_router=(struct name_prefix *)malloc(sizeof(struct name_prefix));
- struct ccn_indexbuf cid={0};
- struct ccn_indexbuf *temp_components=&cid;
- struct ccn_charbuf *name=ccn_charbuf_create();
- ccn_name_from_uri(name,nlsr->slice_prefix);
- ccn_name_split (name, temp_components);
+ //struct ccn_indexbuf cid={0};
+ //struct ccn_indexbuf *temp_components=&cid;
+ //struct ccn_charbuf *name=ccn_charbuf_create();
+ //ccn_name_from_uri(name,nlsr->slice_prefix);
+ //ccn_name_split (name, temp_components);
//lsa_position=temp_components->n-2;
- ccn_charbuf_destroy(&name);
+ //ccn_charbuf_destroy(&name);
//res=ccn_name_comp_get(content_name->buf, components,lsa_position+1,&lst, &comp_size);
@@ -562,7 +562,7 @@
printf("Orig Router: %s Ls Type: %d Orig Time: %s\n",orig_router->name,ls_type,origtime);
int lsa_life_time=get_time_diff(time_stamp,(char *)origtime);
- if ( (strcmp((char *)orig_router,nlsr->router_name) == 0 && lsa_life_time < nlsr->lsa_refresh_time) || (strcmp((char *)orig_router,nlsr->router_name) != 0 && lsa_life_time < nlsr->router_dead_interval) )
+ if ( (strcmp((char *)orig_router->name,nlsr->router_name) == 0 && lsa_life_time < nlsr->lsa_refresh_time) || (strcmp((char *)orig_router,nlsr->router_name) != 0 && lsa_life_time < nlsr->router_dead_interval) )
{
int is_new_adj_lsa=check_is_new_adj_lsa(orig_router->name,(char *)lst,(char *)origtime);
if ( is_new_adj_lsa == 1 )