Use buffer for freshContent
diff --git a/ndn-cpp/key-chain.cpp b/ndn-cpp/key-chain.cpp
index f70f77b..fbfc647 100644
--- a/ndn-cpp/key-chain.cpp
+++ b/ndn-cpp/key-chain.cpp
@@ -85,6 +85,9 @@
data.getSignature().getSignature().clear();
unsigned char dataFieldsDigest[SHA256_DIGEST_LENGTH];
digestDataFieldsSha256(data, dataFieldsDigest);
+#if 1
+ data.getSignature().setSignature(dataFieldsDigest, sizeof(dataFieldsDigest));
+#endif
// TODO: use RSA_size to get the proper size of the signature buffer.
unsigned char signature[1000];
unsigned int signatureLength;
diff --git a/tests/test-encode-decode-data.cpp b/tests/test-encode-decode-data.cpp
index 559aa60..2a7ebd8 100644
--- a/tests/test-encode-decode-data.cpp
+++ b/tests/test-encode-decode-data.cpp
@@ -145,8 +145,8 @@
dumpData(reDecodedData);
Data freshData(Name("/ndn/abc"));
- const char *freshContent = "SUCCESS!";
- freshData.setContent((const unsigned char *)freshContent, strlen(freshContent));
+ const unsigned char freshContent[] = "SUCCESS!";
+ freshData.setContent(freshContent, sizeof(freshContent) - 1);
KeyChain::defaultSign(freshData);
cout << endl << "Freshly signed data:" << endl;