[ndnSIM] Using signature in interest packets

Anantha krishnan saji ananthakrishnan190 at gmail.com
Wed Feb 19 23:23:14 PST 2020


Hello sir,

Are you sure that the Interest you receive carries a signature in the first
> place?
>

In order to understand the problem, I cloned a fresh copy of ndnSIM and
then tried to parse the signature send along with the data packet.
On the producer side,

> Signature signature;
> SignatureInfo signatureInfo(static_cast<
> ::ndn::tlv::SignatureTypeValue>(255));
>
> if (m_keyLocator.size() > 0) {
> signatureInfo.setKeyLocator(m_keyLocator);
> }
>
> signature.setInfo(signatureInfo);
> signature.setValue(::ndn::makeNonNegativeIntegerBlock(::ndn::tlv::SignatureValue,
> 1894));
> // I should be able to parse this block on consumer side and retrieve 1894.
>
> data->setSignature(signature);
>

On the consumer side,

Block signatureValueBlock = data->getSignature().getValue();
> signatureValueBlock.parse(); // Getting error at this line.
> auto parsedSignatureBlock = signatureValueBlock.elements().begin();
> uint64_t parsedSignatureValue =
> readNonNegativeInteger((*parsedSignatureBlock));


As to my knowledge, the SignatureValue block is getting appended and is
carried in the packet. *I can see the field in Wireshark dissection*. So I
think the problem is not in transmitting the block. Is there anything else
that I should know about parsing signature value? Does the method of
parsing change with different signing methods?

Regards,
Ananthakrishnan S
NITK Surathkal

On Tue, Jan 28, 2020 at 7:45 PM Spyridon Mastorakis <smastorakis at unomaha.edu>
wrote:

> Hi,
>
> Are you sure that the Interest you receive carries a signature in the
> first place?
>
> Thanks,
>
> Spyridon (Spyros) Mastorakis
> Assistant Professor
> Computer Science Department
> University of Nebraska, Omaha
> Peter Kiewit Institute Room 175A
> https://sites.google.com/site/spyridonmastorakis
>
> On Jan 15, 2020, at 3:45 AM, Anantha krishnan saji via ndnSIM <
> ndnsim at lists.cs.ucla.edu> wrote:
>
> Hi all,
>
> I want to use Signature in interest packets. Since I could not find
> InterestSignature class in ndnSim (
> http://named-data.net/doc/NDN-packet-spec/current/signature.html#interest-signature
> <https://urldefense.proofpoint.com/v2/url?u=http-3A__named-2Ddata.net_doc_NDN-2Dpacket-2Dspec_current_signature.html-23interest-2Dsignature&d=DwMFaQ&c=Cu5g146wZdoqVuKpTNsYHeFX_rg6kWhlkLF8Eft-wwo&r=eI5Bh74ovG-uIXQ5ksQETSPgRFzmJXjIZXneCqw580E&m=aNexH4sM2MOP3WZq3KHw4FakjxdFte_otC2AV9FLzK4&s=HBLrQsPQMcXUXUG86_9LXf5FQ4iH9wS7TifZmRKi4fM&e=>),
> I used DataSignature (ndn-cxx/signature.cpp). I made the necessary changes
> in encoding and decoding of interest packet. I am using
>
>
> *Block block =
> ::ndn::makeNonNegativeIntegerBlock(::ndn::tlv::SignatureValue,
> m_signature); *
> *signature.setValue(block);*
> to create a signaturevalue block and
>
>
> *Block signatureValueBlock = interest->getSignature().getValue(); *
> *signatureValueBlock.parse();*
> to parse the block on producer side. I am able to parse signatureInfo
> similarly. But the problem is signatureValue is not getting parsed. I am
> getting the following error:
>
> *TLV-LENGTH of sub-element of type 252 exceeds TLV-VALUE boundary of
> parent block*
>
> When the default signatureValue of 0 is used, the error becomes
>
> *Empty buffer during TLV parsing*
>
> I would like to know whether there are any additional steps involved in
> parsing signature other than
>
>    1. retrieve the signatureValue block.
>    2. parse the retrieved block.
>    3. Access the tlv using Block::elements();
>
> I have used the same steps in multiple places in my code to create and
> parse blocks and all that is working fine. Is parsing Signature any
> different?
>
> Thanks and regards,
> Ananthakrishnan S
> NITK Surathkal
> _______________________________________________
> ndnSIM mailing list
> ndnSIM at lists.cs.ucla.edu
>
> https://urldefense.proofpoint.com/v2/url?u=http-3A__www.lists.cs.ucla.edu_mailman_listinfo_ndnsim&d=DwICAg&c=Cu5g146wZdoqVuKpTNsYHeFX_rg6kWhlkLF8Eft-wwo&r=eI5Bh74ovG-uIXQ5ksQETSPgRFzmJXjIZXneCqw580E&m=aNexH4sM2MOP3WZq3KHw4FakjxdFte_otC2AV9FLzK4&s=jIZm1rO4wtEz4cMr4shGKLQprymKM0XveBPrAzIP_5M&e=
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20200220/f4c4fd4b/attachment.html>


More information about the ndnSIM mailing list