Merge commit 'origin/silc.1.1.branch'
[silc.git] / doc / draft-riikonen-silc-flags-payloads-04.nroff
1 .pl 10.0i
2 .po 0
3 .ll 7.2i
4 .lt 7.2i
5 .nr LL 7.2i
6 .nr LT 7.2i
7 .ds LF Riikonen
8 .ds RF FORMFEED[Page %]
9 .ds CF
10 .ds LH Internet Draft
11 .ds RH 2 December 2003
12 .ds CH
13 .na
14 .hy 0
15 .in 0
16 .nf
17 Network Working Group                                        P. Riikonen
18 Internet-Draft
19 draft-riikonen-flags-payloads-04.txt                     2 December 2003
20 Expires: 2 June 2004
21
22 .in 3
23
24 .ce 2
25 SILC Message Flag Payloads
26 <draft-riikonen-flags-payloads-04.txt>
27
28 .ti 0
29 Status of this Draft
30
31 By submitting this Internet-Draft, each author represents that any
32 applicable patent or other IPR claims of which he or she is aware
33 have been or will be disclosed, and any of which he or she becomes
34 aware will be disclosed, in accordance with Section 6 of BCP 79.
35
36 Internet-Drafts are working documents of the Internet Engineering
37 Task Force (IETF), its areas, and its working groups. Note that
38 other groups may also distribute working documents as Internet-
39 Drafts. Internet-Drafts are draft documents valid for a maximum of
40 six months and may be updated, replaced, or obsoleted by other
41 documents at any time. It is inappropriate to use Internet-Drafts as
42 reference material or to cite them other than as "work in progress".
43
44 The list of current Internet-Drafts can be accessed at
45 http://www.ietf.org/1id-abstracts.html
46 The list of Internet-Draft Shadow Directories can be accessed at
47 http://www.ietf.org/shadow.html.
48
49
50 .ti 0
51 Abstract
52
53 This memo describes the data payloads associated with the SILC Message
54 Flags, as defined in the SILC Packet Protocol specification [SILC2].  The
55 purpose of the Message Flags is to augment the function of the Message
56 Payload used to send both private and channel messages, by allowing the
57 sender to tell the receiver what type of data the payload includes, and
58 how the data should be processed.  Some of the Message Flags may define
59 additional payloads to be associated with the flag, and this memo
60 describes these payloads.
61
62
63
64
65
66
67
68
69 .ti 0
70 Table of Contents
71
72 .nf
73 1 Introduction ..................................................  2
74   1.1 Requirements Terminology ..................................  2
75 2 SILC Message Flags ............................................  3
76 3 SILC Message Flag Payloads ....................................  3
77   3.1 SILC_MESSAGE_FLAG_REQUEST .................................  3
78   3.2 SILC_MESSAGE_FLAG_REPLY ...................................  4
79   3.3 SILC_MESSAGE_FLAG_SIGNED ..................................  4
80   3.4 SILC_MESSAGE_FLAG_DATA ....................................  7
81   3.5 SILC_MESSAGE_FLAG_ACK .....................................  8
82 4 Security Considerations .......................................  9
83 5 References ....................................................  9
84 6 Author's Address .............................................. 10
85 7 Full Copyright Statement ...................................... 10
86
87
88 .ti 0
89 1. Introduction
90
91 The Secure Internet Live Conferencing [SILC1] supports sending binary
92 messages between users in the network.  To make the data sending, and
93 processing at the receiver's end as simple as possible the SILC defines
94 Message Flags to the Message Payload [SILC2] that is used to send private
95 and channel messages, which can help the receiver to decide how the data
96 is encoded, and how it should be interpreted.  Some of the Message Flags
97 may define additional payloads to be associated with the flag, but the
98 [SILC2] does not define them.  This memo defines the payloads for those
99 Message Flags that was marked to include additional payloads in [SILC2].
100
101 By defining the payloads for the Message Flags the Message Payload
102 can be augmented to support any kind of data, which can be easily
103 interpreted at the receiver end.  For example, it would be possible to
104 send audio stream, video stream, image files and HTML pages as messages,
105 and the receiver can either choose to ignore the message or to process
106 it, or to perhaps pass the message to some application for processing.
107 Without specific payloads for Message Flags it is almost impossible for
108 the receiver to interpret binary data from the payload.
109
110
111 .ti 0
112 1.1 Requirements Terminology
113
114 The keywords MUST, MUST NOT, REQUIRED, SHOULD, SHOULD NOT, RECOMMENDED,
115 MAY, and OPTIONAL, when they appear in this document, are to be
116 interpreted as described in [RFC2119].
117
118
119
120
121 .ti 0
122 2 SILC Message Flags
123
124 The Message Flags was added to the SILC protocol for the reason that SILC
125 provides sending binary data as messages between users, and entities in
126 the network, and interpreting pure binary data is almost impossible.
127 With the Message Flags the purpose, the reason, and the method for how
128 the message must be interpreted can be told to the recipient.  Other
129 conferencing protocols which are usually ASCII based protocols do not have
130 such problems since they do not generally support sending of binary data
131 at all, or require specific encoding of the data before it can be sent
132 over the network.
133
134 The Message Payload in SILC can have flags that can augment the function
135 of the payload.  The flags can tell for example that the message is a
136 request, or a reply to an earlier received request.  They can tell that
137 the message is some action that the sender is performing, or they can tell
138 that the message is an auto reply, or that it is explicitly digitally
139 signed by the sender.
140
141 The problem of Message Flags is that the space for flags mask is only 16
142 bits, so there is a limited number of flags available.  For this reason
143 having a flag that defines a generic way of sending any kind of data as
144 a message, and can be easily interpreted at the receiver's end is important.
145 For this reason the flag SILC_MESSAGE_FLAG_DATA was added to the protocol
146 which can represent any data.  This memo describe how this flag is used
147 and how the associated payload is constructed and processed.  This memo
148 also describes payloads for all the other flags that can have associated
149 payloads.
150
151
152 .ti 0
153 3 SILC Message Flag Payloads
154
155 The [SILC2] defines the flags which may have associated payloads.  This
156 section will list these flags and define the payloads.
157
158
159 .ti 0
160 3.1 SILC_MESSAGE_FLAG_REQUEST
161
162 Currently this flag can be used in the context of application specific,
163 service specific or vendor specific requests, and the data payload type is
164 dependent of this context.  Therefore, payload is not defined for this
165 flag in this memo.  This flag may also be masked with some other flag in
166 the message payload, including with some other flag that defines
167 additional payload.
168
169
170
171
172 .ti 0
173 3.2 SILC_MESSAGE_FLAG_REPLY
174
175 Currently this flag can be used in the context of application specific,
176 service specific or vendor specific replies, and the data payload type is
177 dependent of this context.  Therefore, payload is not defined for this
178 flag in this memo.  This flag may also be masked with some other flag in
179 the message payload, including with some other flag that defines
180 additional payload.
181
182
183 .ti 0
184 3.3 SILC_MESSAGE_FLAG_SIGNED
185
186 This flag is used to tell the recipient that the sent message is
187 digitally signed by the sender, and that the recipient should verify
188 the signature to verify the true authenticity of the received message.
189 All message payloads in SILC provides message authentication code (MAC)
190 which can be used to verify that the sender produced and sent the message.
191 Even so, signing messages digitally can be used to verify the authenticity
192 of the message when recipient trusts the sender and to provide
193 non-repudiation.
194
195 This flag defines a payload which is used to deliver the actual message,
196 sender's public key and the digital signature.  The payload for
197 SILC_MESSAGE_FLAG_SIGNED is as follows:
198
199 (*) indicates that the field is not encrypted.
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222 .in 5
223 .nf
224                      1                   2                   3
225  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
226 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
227 |                                                               |
228 ~                   Start of Message Payload                    ~
229 |                                                               |
230 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
231 |                                                               |
232 ~                      Public Key Payload *                     ~
233 |                                                               |
234 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
235 |     Signature Data Length *   |                               |
236 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+                               +
237 |                                                               |
238 ~                        Signature Data *                       ~
239 |                                                               |
240 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
241 |                                                               |
242 ~                       Initial Vector *                        ~
243 |                                                               |
244 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
245 |                                                               |
246 ~                              MAC *                            ~
247 |                                                               |
248 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
249 .in 3
250
251 .ce
252 Figure 1:  SILC_MESSAGE_FLAG_SIGNED Payload
253
254
255 .in 6
256 o Start of Message Payload (variable length) - This is the
257   start of the Message Payload without the IV and MAC fields,
258   since those fields are appended at the end of this payload.
259
260 o Public Key Payload (variable length) - This includes the
261   Public Key Payload [SILC2] which can be used to deliver the
262   sender's public key (or certificate).  It also indicates the
263   type of the public key (or certificate) which the recipient
264   use to identify how the signature must be verified.  This
265   payload must always be present but it is not required to
266   include the public key data.  The Public Key Type field in
267   the Public Key Payload MUST be set to the correct type of
268   the key, even if the actual public key data is not included.
269   This field is not encrypted but is authenticated.
270
271 o Signature Data Length (2 bytes) - Indicates the length of
272   the Signature Data field not including any other field.
273   This field is not encrypted but is authenticated.
274
275 o Signature Data (variable length) - Includes the actual
276   signature data.  The signature computation and encoding
277   is key type specific.  See [SILC3] for all key types, and
278   their respective references for how to compute and encode
279   the signature.  This field is not encrypted but is
280   authenticated.
281
282 o Initial Vector (variable length) - the IV of the Message
283   Payload as defined in [SILC2].  This field is not encrypted
284   but is authenticated.
285
286 o MAC (variable length) - the MAC of the Message Payload as
287   defined in [SILC2].  The MAC is computed after encryption
288   and after signature computation.  All data in the Message
289   Payload and this payload, including the IV field are
290   included in the MAC computation.  This field is not
291   encrypted.
292 .in 3
293
294 How the data is processed before it is signed is key type specific.
295 The actual data that to be signed MUST be the plaintext message
296 payload before encryption.  The data to be signed is concatenation
297 of the Start of Message Payload field and the Public Key Payload,
298 in that order.  Any other fields are not included for signature data.
299 Before signing, the data is always processed, usually hashed.  The
300 hash function to be used is defined in the key type specific
301 definitions.  See the key type specific references in [SILC3].
302
303 If the public key of the sender is included in the payload the
304 recipient SHOULD verify it before accepting the public key.  Recipient
305 SHOULD verify the signature before accepting and caching the public key.
306 With certificates the certificate verification may be done before
307 verifying the signature.  If the signature verification fails the
308 message should still be displayed.  The end user should also be
309 notified about the result of the signature verification.
310
311 To make the packet size smaller implementations may not want to
312 include the actual public key in all signed messages.  Sending the
313 public key in the first message is usually sufficient.  Subsequent
314 messages may include empty Public Key Payload with an indication of
315 the public key type.
316
317 Implementations that do not support this flag can still process the
318 message payload in normal manner.  These implementations merely parse
319 the decrypted payload in normal manner and ignore the extra data in
320 the payload.  They can do this by extracting the MAC and the IV from
321 the end of the data buffer and thus ignoring the data between start of
322 the Message Payload and the Initial Vector field.
323
324 This flag MAY be masked with any other Message Flag including those that
325 define additional payloads.  As long as the defined payload resides in
326 the data area of the message payload this flag may be masked with the
327 other flags.
328
329
330 .ti 0
331 3.4 SILC_MESSAGE_FLAG_DATA
332
333 This flag is used to represent any data as a message in the way that it
334 can be easily interpreted by the recipient.  This flag is used to send
335 MIME objects as messages from the sender to the receiver.  The MIME as
336 defined in [RFC2045], [RFC2046], [RFC2047], [RFC2048] and [RFC2049] is
337 well established protocol for sending different kind of data with many
338 applications and protocols.  It support dozens of different media types
339 and encodings, and for this reason is ideal for sending data in SILC
340 message payloads as well.
341
342 When the receiver has checked that the message payload includes the
343 SILC_MESSAGE_FLAG_DATA flag, it may then start parsing the MIME header.
344 It would also be possible to pass the message to some application which
345 can already interpret MIME objects.  If the receiver does not support the
346 media type received in the MIME header, it SHOULD be treated as
347 "application/octet-stream".  The receiver MAY also ignore and discard
348 messages that it does not support.
349
350 The MIME header MUST be at the start of the data area of the Message
351 Payload.  The MIME header received in the data area of the payload SHOULD
352 have the MIME-Version field at first and then Content-Type field.  The
353 MIME-Version field is not required to be present in each body part of
354 multipart entity.  Additionally the header MAY also include any other
355 MIME compliant headers.  The character encoding for the MIME Header
356 strings inside the message payload is US-ASCII, as defined in [RFC2045].
357 The actual MIME object may define additional character sets or encodings
358 for the data it delivers.
359
360 Hence, the MIME Header in the message payload may be as follows:
361
362 .in 8
363 .nf
364 MIME-Version: 1.0\\r\\n
365 Content-Type: discrete/composite\\r\\n
366 Content-Transfer-Encoding: binary\\r\\n
367 \\r\\n
368 .in 3
369
370 The Content-Transfer-Encoding field behaves as defined in [RFC2045] and
371 defines the encoding of the data in the MIME object.  The preferred data
372 encoding with SILC is "binary".  However, many MIME media types defines
373 their preferred encoding and they may be used if binary encoding is not
374 suitable.
375
376 When sending large amounts of traffic or large files as MIME objects the
377 limits of the SILC Packet needs to be taken into consideration.  The
378 maximum length of SILC Packet is 2^16 bytes, and larger messages would
379 need to be fragmented.  MIME provides way of fragmenting and reassembling
380 messages, and it is to be done with SILC as defined in [RFC2046].  The
381 MIME fragmentation is defined for gateway usage, but in case of SILC the
382 sender (for example, a client) may also start sending fragmented MIME
383 objects.
384
385 This flag SHOULD NOT be masked with some other Message Flag that defines
386 payloads for message data.  Generally this sort of setting would be
387 impossible for the receiver to interpret.  However, flags that does not
388 define any specific payloads MAY be masked with this flag as well.  For
389 example, this flag could be masked also with SILC_MESSAGE_FLAG_REQUEST flag.
390 It also can be masked with SILC_MESSAGE_FLAG_SIGNED flag since it does not
391 define data specific payload.
392
393
394 .ti 0
395 3.5 SILC_MESSAGE_FLAG_ACK
396
397 This flag is used to send acknowledgement messages.  When sender of a
398 message requires the recipient to acknowledge the received message, the
399 sender MUST set the SILC_MESSAGE_FLAG_ACK and MUST NOT set the
400 SILC_MESSAGE_FLAG_NOREPLY.  When a message with this flag set is received
401 an acknowledgement message MUST be sent back.  In the acknowledgement
402 message the sender MUST set the SILC_MESSAGE_FLAG_ACK,
403 SILC_MESSAGE_FLAG_AUTOREPLY and SILC_MESSAGE_FLAG_NOREPLY flags.  The
404 receiver MUST NOT acknowledge the acknowledgement message.  This flag
405 MUST NOT be used with channel messages, and MUST be ignored if received
406 in a channel message.
407
408 The construction of the acknowledgement reply message is normal Message
409 Payload where the Message Data field includes a computed MAC of the
410 original received Message Payload MAC.  Hence, the MAC is computed as
411 follows:
412
413 .in 8
414 ack_mac = mac(key, MAC);
415 .in 3
416
417 Where the 'key' is the MAC key used to compute MACs for the Message
418 Payload, and the 'MAC' is the MAC taken from the received Message Payload.
419 The 'ack_mac' is placed in the Message Data field in a new Message
420 Payload, and the payload is encrypted in normal manner.  After this the
421 message is sent back to the original sender of the message.
422
423 The receiver of the acknowledgement reply message SHOULD verify the MAC
424 from the Message Data field to assure that acknowledgement was received to
425 an earlier sent message.  Implementation needs to keep the old message
426 MACs stored until acknowledgement is received.  It is left for
427 implementation to decide any possible retransmission strategy if
428 acknowledgement messages are not received.
429
430
431 .ti 0
432 4 Security Considerations
433
434 In case of SILC_MESSAGE_FLAG_DATA the implementors should pay special
435 attention to the security implications of any media type that can cause
436 the remote execution of any actions in the receiver's environment.  The
437 [RFC2046] and [RFC2048] discusses more MIME specific security
438 considerations.  Even though SILC provides secured messages, in case of
439 MIME which can be used to transfer files and documents which are stored in
440 the receiver's local environment, securing separately the MIME object may
441 be desired.  For example, augmenting the MIME support in SILC messages to
442 support S/MIME may be desired in some implementations.
443
444
445 .ti 0
446 5 References
447
448 [SILC1]      Riikonen, P., "Secure Internet Live Conferencing (SILC),
449              Protocol Specification", Internet Draft, June 2003.
450
451 [SILC2]      Riikonen, P., "SILC Packet Protocol", Internet Draft,
452              June 2003.
453
454 [SILC3]      Riikonen, P., "SILC Key Exchange and Authentication
455              Protocols", Internet Draft, June 2003.
456
457 [RFC2045]    Freed, N., et al., "Multipurpose Internet Mail Extensions
458              (MIME) Part One: Format of Internet Message Bodies",
459              Standards Track, RFC 2045, November 1996.
460
461 [RFC2046]    Freed, N., et al., "Multipurpose Internet Mail Extensions
462              (MIME) Part Two: Media Types", Standards Track, RFC 2045,
463              November 1996.
464
465 [RFC2047]    Moore K., "MIME (Multipurpose Internet Mail Extensions)
466              Part Three: Message Header Extensions for Non-ASCII Text"
467              Standards Track, RFC 2047, November 1996.
468
469 [RFC2048]    Freed, N., et al., "Multipurpose Internet Mail Extensions
470              (MIME) Part Four: Registration Procedures", Standards
471              Track, RFC 2048, November 1996.
472
473 [RFC2049]    Freed, N., et al., "Multipurpose Internet Mail Extensions
474              (MIME) Part Five: Conformance Criteria and Examples",
475              Standards Track, RFC 2049, November 1996.
476
477 [RFC2119]    Bradner, S., "Key Words for use in RFCs to Indicate
478              Requirement Levels", BCP 14, RFC 2119, March 1997.
479
480
481
482 .ti 0
483 6 Author's Address
484
485 Pekka Riikonen
486 Snellmaninkatu 34 A 15
487 70100 Kuopio
488 Finland
489
490 EMail: priikone@iki.fi
491
492
493
494 .ti 0
495 7 Full Copyright Statement
496
497 Copyright (C) The Internet Society (2007).
498
499 This document is subject to the rights, licenses and restrictions
500 contained in BCP 78, and except as set forth therein, the authors
501 retain all their rights.
502
503 This document and the information contained herein are provided on an
504 "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS
505 OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY AND THE INTERNET
506 ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED,
507 INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE
508 INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED
509 WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.