SignedInterest » History » Version 1
Yingdi Yu, 07/09/2014 02:10 PM
1 | 1 | Yingdi Yu | Signed Interest |
---|---|---|---|
2 | =============== |
||
3 | |||
4 | **Signed Interest** is a mechanism to issue an authenticated interest. |
||
5 | |||
6 | The signature of a signed Interest packet is embedded into the last component of the Interest name. |
||
7 | The signature covers a continuous block starting from the first name component TLV to the penultimate name component TLV: |
||
8 | |||
9 | +-------------+----------+-----------------------------------------------------------------------------------+ |
||
10 | | Interest | Interest | +------+--------+--------------------------------------------------+ +----------+ | |
||
11 | | Type (0x01) | length | | Name | Name | +---------+-- --+---------+---------+---------+| | Other | | |
||
12 | | | | | Type | Length | |Component| ... |Component|Component|Component|| | TLVs ... | | |
||
13 | | | | | | | | TLV 1 | | TLV n-2 | TLV n-1 | TLV n || | in | | |
||
14 | | | | | | | +---------+-- --+---------+---------+---------+| | Interest | | |
||
15 | | | | +------+--------+--------------------------------------------------+ +----------+ | |
||
16 | +-------------+----------+-----------------------------------------------------------------------------------+ |
||
17 | |||
18 | \ /\ / |
||
19 | ---------------- ------------------ --- --- |
||
20 | \/ \/ |
||
21 | Signed portion of Interest Signature |
||
22 | |||
23 | |||
24 | More specifically, the SignedInterest is defined to have four additional components: |
||
25 | |||
26 | * ``<timestamp>`` |
||
27 | * ``<nonce>`` |
||
28 | * ``<SignatureInfo>`` |
||
29 | * ``<SignatureValue>`` |
||
30 | |||
31 | For example, for ``/signed/interest/name`` name, CommandInterest will be defined as: |
||
32 | |||
33 | /signed/interest/name/<timestamp>/<random-value>/<SignatureInfo>/<SignatureValue> |
||
34 | |||
35 | \ / |
||
36 | ----------------------------- -------------------------- |
||
37 | \/ |
||
38 | Additional components of Signed Interest |
||
39 | |||
40 | ## Signed Interest specific Name components |
||
41 | |||
42 | ### Timestamp component (n-3 *th*) |
||
43 | |||
44 | The value of the n-3 *th* component is the interest's timestamp (in terms of millisecond offset from UTC 1970-01-01 00:00:00) encoded as [nonNegativeInteger](http://named-data.net/doc/ndn-tlv/tlv.html#non-negative-integer-encoding). |
||
45 | The timestamp may be used to protect against replay attack. |
||
46 | |||
47 | ### Nonce component (n-2 *th*) |
||
48 | |||
49 | The value of the n-2 *th* component is random value (encoded as [nonNegativeInteger](http://named-data.net/doc/ndn-tlv/tlv.html#non-negative-integer-encoding)) that adds additional assurances that the interest will be unique. |
||
50 | |||
51 | ### SignatureInfo component (n-1 *th*) |
||
52 | |||
53 | The value of the n-1 *th* component is actually a [SignatureInfo](http://named-data.net/doc/ndn-tlv/signature.html) TLV. |
||
54 | |||
55 | +---------+---------+-------------------+ |
||
56 | |Component|Component| +---------------+ | |
||
57 | | Type | Length | | SignatureInfo | | |
||
58 | | | | | TLV | | |
||
59 | | | | +---------------+ | |
||
60 | +---------+---------+-------------------+ |
||
61 | |||
62 | | | |
||
63 | |<---------The n-1 th Component-------->| |
||
64 | |||
65 | ### SignatureValue component (n *th*) |
||
66 | |||
67 | The value of the n *th* component is actually a [SignatureValue](http://named-data.net/doc/ndn-tlv/signature.html) TLV. |
||
68 | |||
69 | +---------+---------+--------------------+ |
||
70 | |Component|Component| +----------------+ | |
||
71 | | Type | Length | | SignatureValue | | |
||
72 | | | | | TLV | | |
||
73 | | | | +----------------+ | |
||
74 | +---------+---------+--------------------+ |
||
75 | |||
76 | | | |
||
77 | |<----------The n th Component---------->| |
||
78 | |||
79 | ## Signed Interest processing |
||
80 | |||
81 | On receiving an Interest, the producer, according to the Interest name prefix, should be able to tell whether the Interest is required to be signed. |
||
82 | If the received Interest is supposed to be signed, it will be treated as invalid in the following three cases: |
||
83 | |||
84 | - one of the four components above (Timestamp, Nonce, SignatureValue, and SignatureInfo) is missing or cannot be parsed correctly; |
||
85 | - the key is not trusted for signing the Interest; |
||
86 | - the signature cannot be verified with the public key pointed by the [KeyLocator](http://named-data.net/doc/ndn-tlv/signature.html#keylocator) in SignatureInfo. |
||
87 | |||
88 | Recipients of a signed interest may further check the timestamp and the uniqueness of the signed interest (e.g., when the signed interest carries a command). |
||
89 | In this case, a signed interest may be treated as invalid if : |
||
90 | |||
91 | - a valid signed Interest whose timestamp is **equal or later** than the timestamp of the received one has been received before. |
||
92 | |||
93 | Note that in order to detect this situation, the recipient needs to maintain a *latest timestamp* state for each trusted public key |
||
94 | (**Since public key cryptography is used, sharing private keys is not recommended. If private key sharing is inevitable, it is the key owner's responsibility to keep clock synchronized**). |
||
95 | For each trusted public key, the state is initialized as the timestamp of the first valid Interest signed by the key. |
||
96 | Since then, the state will be updated every time when the recipient receives a valid signed Interest. |
||
97 | |||
98 | Note that for the first Interest, the state is not available. |
||
99 | To handle this special situation, the recipient should check the Interest's timestamp against a grace interval (e.g., 120 seconds) [current\_timestamp - interval/2, current\_timestamp + interval/2]. |
||
100 | The first interest is invalid if its timestamp is outside of the interval. |