Adding Content Lifetime
diff --git a/nlsr_km.c b/nlsr_km.c
index f745d91..2e90e79 100644
--- a/nlsr_km.c
+++ b/nlsr_km.c
@@ -28,7 +28,8 @@
char *keystore_passphrase,
char *key_repo_name,
char *site_name,
- char *router_name){
+ char *router_name,
+ long int freshness){
if ( nlsr->debugging )
printf("sign_content_with_user_defined_keystore called\n");
@@ -116,11 +117,15 @@
ccn_charbuf_append(sp.template_ccnb, keyname->buf, keyname->length);
ccn_charbuf_append_closer(sp.template_ccnb); // KeyName closer
ccn_charbuf_append_closer(sp.template_ccnb); // KeyLocator closer
+
+ ccnb_tagged_putf(sp.template_ccnb, CCN_DTAG_FreshnessSeconds, "%ld", freshness);
+ sp.sp_flags |= CCN_SP_TEMPL_FRESHNESS;
+
ccn_charbuf_append_closer(sp.template_ccnb); // SignedInfo closer
sp.sp_flags |= CCN_SP_TEMPL_KEY_LOCATOR;
sp.sp_flags |= CCN_SP_FINAL_BLOCK;
- sp.freshness = 60;
+ //sp.freshness = 60;
if (pubid_out->length != sizeof(sp.pubid)){
diff --git a/nlsr_km.h b/nlsr_km.h
index 65c2dca..cfaa0d5 100644
--- a/nlsr_km.h
+++ b/nlsr_km.h
@@ -25,7 +25,8 @@
char *keystore_passphrase,
char *key_repo_name,
char *site_name,
- char *router_name);
+ char *router_name,
+ long int freshness);
int contain_key_name(const unsigned char *ccnb,
struct ccn_parsed_ContentObject *pco);
diff --git a/nlsr_ndn.c b/nlsr_ndn.c
index 2fdf091..1cdca25 100644
--- a/nlsr_ndn.c
+++ b/nlsr_ndn.c
@@ -309,7 +309,8 @@
nlsr->keystore_passphrase,
nlsr->root_key_prefix,
nlsr->site_name,
- nlsr->router_name);
+ nlsr->router_name,
+ 10);
//res= ccn_sign_content(nlsr->ccn, data, name, &sp, "info",strlen("info"));
diff --git a/nlsr_sync.c b/nlsr_sync.c
index b893022..c68e3bc 100644
--- a/nlsr_sync.c
+++ b/nlsr_sync.c
@@ -794,7 +794,8 @@
nlsr->keystore_passphrase,
nlsr->root_key_prefix,
nlsr->site_name,
- nlsr->router_name);
+ nlsr->router_name,
+ 60);
blockread=resultbuf->length;