idnits 2.17.1 draft-ietf-lwig-tls-minimal-00.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- ** There are 13 instances of lines with control characters in the document. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year == Line 323 has weird spacing: '...ensions and t...' == The document doesn't use any RFC 2119 keywords, yet has text resembling RFC 2119 boilerplate text. -- The document date (September 4, 2013) is 3885 days in the past. Is this intentional? Checking references for intended status: Informational ---------------------------------------------------------------------------- == Missing Reference: 'Dunkels-contiki' is mentioned on line 314, but not defined == Unused Reference: 'SHA' is defined on line 596, but no explicit reference was found in the text == Unused Reference: 'I-D.gilger-smart-object-security-workshop' is defined on line 640, but no explicit reference was found in the text == Unused Reference: 'Dunkels-Contiki' is defined on line 645, but no explicit reference was found in the text ** Obsolete normative reference: RFC 2246 (Obsoleted by RFC 4346) ** Obsolete normative reference: RFC 4346 (Obsoleted by RFC 5246) ** Obsolete normative reference: RFC 5246 (Obsoleted by RFC 8446) ** Obsolete normative reference: RFC 4347 (Obsoleted by RFC 6347) -- Obsolete informational reference (is this intentional?): RFC 3268 (Obsoleted by RFC 5246) == Outdated reference: A later version (-11) exists of draft-ietf-tls-oob-pubkey-07 == Outdated reference: A later version (-02) exists of draft-keoh-lwig-dtls-iot-01 == Outdated reference: A later version (-03) exists of draft-gilger-smart-object-security-workshop-01 Summary: 5 errors (**), 0 flaws (~~), 10 warnings (==), 2 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 LWIG Working Group S.S. Kumar 3 Internet-Draft Philips Research 4 Intended status: Informational S. Keoh 5 Expires: March 8, 2014 University of Glasgow 6 H. Tschofenig 7 Nokia Siemens Networks 8 September 4, 2013 10 A Hitchhiker's Guide to the (Datagram) Transport Layer Security Protocol 11 for Smart Objects and Constrained Node Networks 12 draft-ietf-lwig-tls-minimal-00 14 Abstract 16 Transport Layer Security (TLS) is a widely used security protocol 17 that offers communication security services at the transport layer. 18 The initial design of TLS was focused on the protection of 19 applications running on top of the Transmission Control Protocol 20 (TCP), and was a good match for securing the Hypertext Transfer 21 Protocol (HTTP). Subsequent standardization efforts lead to the 22 publication of the Datagram Transport Layer Security (DTLS) protocol, 23 which allows the re-use of the TLS security functionality and the 24 payloads to be exchanged on top of the User Datagram Protocol (UDP). 26 With the work on the Constrained Application Protocol (CoAP), as a 27 specialized web transfer protocol for use with constrained nodes and 28 constrained networks, DTLS is a preferred communication security 29 protocol. 31 Smart objects are constrained in various ways (e.g., CPU, memory, 32 power consumption) and these limitations may impose restrictions on 33 the protocol stack such a device runs. This document only looks at 34 the security part of that protocol stacks and the ability to 35 customize TLS/DTLS. To offer input for implementers and system 36 architects this document illustrates the costs and benefits of 37 various TLS/DTLS features for use with smart objects and constraint 38 node networks. 40 Requirements Language 42 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 43 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 44 document are to be interpreted as described in RFC 2119 [RFC2119] 46 Status of this Memo 47 This Internet-Draft is submitted in full conformance with the 48 provisions of BCP 78 and BCP 79. 50 Internet-Drafts are working documents of the Internet Engineering 51 Task Force (IETF). Note that other groups may also distribute 52 working documents as Internet-Drafts. The list of current Internet- 53 Drafts is at http://datatracker.ietf.org/drafts/current/. 55 Internet-Drafts are draft documents valid for a maximum of six months 56 and may be updated, replaced, or obsoleted by other documents at any 57 time. It is inappropriate to use Internet-Drafts as reference 58 material or to cite them other than as "work in progress." 60 This Internet-Draft will expire on August 29, 2013. 62 Copyright Notice 64 Copyright (c) 2013 IETF Trust and the persons identified as the 65 document authors. All rights reserved. 67 This document is subject to BCP 78 and the IETF Trust's Legal 68 Provisions Relating to IETF Documents 69 (http://trustee.ietf.org/license-info) in effect on the date of 70 publication of this document. Please review these documents 71 carefully, as they describe your rights and restrictions with respect 72 to this document. Code Components extracted from this document must 73 include Simplified BSD License text as described in Section 4.e of 74 the Trust Legal Provisions and are provided without warranty as 75 described in the Simplified BSD License. 77 Table of Contents 79 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3 80 2. Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 81 3. Design Decisions . . . . . . . . . . . . . . . . . . . . . . . 6 82 4. Performance Numbers . . . . . . . . . . . . . . . . . . . . . 7 83 4.1. Pre-Shared Key (PSK) based DTLS implementation . . . . . . 7 84 4.1.1. Prototype Environment . . . . . . . . . . . . . . . . . 7 85 4.1.2. Code size and Memory Consumption . . . . . . . . . . . 8 86 4.1.3. Communication Overhead . . . . . . . . . . . . . . . . 8 87 4.1.4. Message Delay, Success Rate and Bandwidth . . . . . . . 10 88 4.2. Certificate based and Raw-public key based TLS 89 implementation . . . . . . . . . . . . . . . . . . . . . . 11 90 4.2.1. Prototype Environment . . . . . . . . . . . . . . . . . 11 91 4.2.2. Code size . . . . . . . . . . . . . . . . . . . . . . . 11 92 4.2.3. Raw Public Key Implementation . . . . . . . . . . . . . 12 93 5. Summary and Conclusions . . . . . . . . . . . . . . . . . . . 13 94 6. Security Considerations . . . . . . . . . . . . . . . . . . . 13 95 7. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 14 96 8. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 14 97 9. References . . . . . . . . . . . . . . . . . . . . . . . . . . 14 98 9.1. Normative References . . . . . . . . . . . . . . . . . . . 14 99 9.2. Informative References . . . . . . . . . . . . . . . . . . 14 100 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 16 102 1. Introduction 104 The IETF published three versions of Transport Layer Security: TLS 105 Version 1.0 [RFC2246], TLS Version 1.1 [RFC4346], and TLS Version 1.2 106 [RFC5246]. Section 1.1 of [RFC4346] explains the differences between 107 Version 1.0 and Version 1.1; those are small security improvements, 108 including the usage of an explicit initialization vector to protect 109 against cipher-block-chaining attacks, which all have little to no 110 impact on smart object implementations. Section 1.2 of [RFC5246] 111 describes the differences between Version 1.1 and Version 1.2. TLS 112 1.2 introduces a couple of major changes with impact to size of an 113 implementation. In particular, prior TLS versions hard-coded the 114 MD5/SHA-1 combination in the pseudo-random function (PRF). As a 115 consequence, any TLS Version 1.0 and Version 1.1 implementation had 116 to have MD5 and SHA-1 code even if the remaining cryptographic 117 primitives used other algorithms. With TLS Version 1.2 the two had 118 been replaced with cipher-suite-specified PRFs. In addition, the TLS 119 extensions definition [RFC6066] and various AES ciphersuites 120 [RFC3268] got merged into the TLS Version 1.2 specification. 122 All three TLS specifications list a mandatory-to-implement 123 ciphersuite: for TLS Version 1.0 this was 124 TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA, for TLS Version 1.1 it was 125 TLS_RSA_WITH_3DES_EDE_CBC_SHA, and for TLS Version 1.2 it is 126 TLS_RSA_WITH_AES_128_CBC_SHA. There is, however, an important 127 qualification to these compliance statements, namely that they are 128 only valid in the absence of an application profile standard 129 specifying otherwise. The smart object environment may, for example, 130 represent a situation for such an application profile which defines a 131 cryptosuite that reduces memory and computation requirements without 132 sacrificing security. 134 All TLS versions offer a separation between authentication and key 135 exchange, and bulk data protection. The former is more costly 136 performance- and message-wise. The details of the authentication and 137 key exchange, using the TLS Handshake, vary with the chosen 138 ciphersuite. With new ciphersuites the TLS feature-set can easily be 139 enhanced, in case the already large collection of ciphersuites, see 141 [TLS-IANA], does not match the requirements. 143 Once the TLS Handshake has been successfully completed the necessary 144 keying material and parameters are setup for usage with the TLS 145 Record Layer, which is responsible for bulk data protection. The 146 provided security of the TLS Record Layer depends also, but not only, 147 on the chosen ciphersuite algorithms; NULL encryption ciphersuites, 148 like those specified in RFC 4785 [RFC4785], offer only integrity- 149 without confidentiality-protection. Example ciphersuites for the TLS 150 Record Layer are RC4 with SHA-1, AES-128 with SHA-1, AES-256 with 151 SHA-1, RC4 with SHA-1, RC4 with MD5 It is worth mentioning that TLS 152 may also be used without the TLS Record Layer. This has, for example, 153 been exercised with the work on the framework for establishing a 154 Secure Real-time Transport Protocol (SRTP) security context using the 155 Datagram Transport Layer Security (DTLS [RFC4347]) protocol (DTLS- 156 SRTP [RFC5763]). 158 It is fair to say that TLS and consequently DTLS offers a fair degree 159 of flexibility. What specific security features of TLS are required 160 for a specific smart object application scenario depends on various 161 factors, including the communication architecture and the threats 162 that shall be mitigated. 164 The goal of this document is to provide guidance on how to use 165 existing DTLS/TLS extensions for smart objects and to explain their 166 costs in terms of code size, computational effort, communication 167 overhead, and (maybe) energy consumption. The document does not try 168 to be exhaustive, as the list of TLS/DTLS extensions is enhanced on a 169 frequent basis. Instead we focus on extensions that those working in 170 the smart object community often found valuable in their practical 171 experience. A non-goal is to propose new extensions to DTLS/TLS to 172 provide even better performance characteristics in specific 173 environments. 175 2. Overview 177 A security solution to be deployed is strongly influenced by the 178 communication relationships [RFC4101] between the entities. Having a 179 good understanding of these relationships will be essential to define 180 the threats and decide on how to customize the security solution. 181 Some of these considerations are described in [I-D.gilger-smart- 182 object-security-workshop]. 184 Consider the following scenario where a smart-meter transmits its 185 energy readings to other parties. The public utility has to ensure 186 that the meter readings it obtained can be attributed to a specific 187 meter in a household. It is simply not acceptable for public utility 188 to have any meter readings tampered in transit or by a rogue endpoint 189 (particularly if the attack leads to a disadvantage, for example 190 financial loss, for the utility). Users in a household may want to 191 ensure that only certain authorized parties are able to read their 192 meter; privacy concerns come to mind. 194 In this example, a smart-meter may only ever need to talk to servers 195 of a specific utility or even only to a single pre-configured server. 196 Clearly, some information has to be pre-provisioned into the device 197 to ensure the desired behavior to talk only to selected servers. The 198 meter may come pre-configured with the domain name and certificate 199 belonging to the utility. The device may, however, also be 200 configured to accept one or multiple server certificates. It may 201 even be pre-provisioned with the server's raw public key, or a shared 202 secret instead of relying on certificates. 204 Lowering the flexibility decreases the implementation overhead. If 205 shared secrets are used with TLS-PSK [RFC4279] or raw public keys are 206 used with TLS [I-D.ietf-tls-oob-pubkey], fewer lines of code are 207 needed than employing X.509 certificate, as will be explained later 208 in this document. A decision for constraining the client-side TLS 209 implementation, for example by offering only a single ciphersuite, 210 has to be made in awareness of what functionality will be available 211 on the TLS server-side. In certain communication environments it may 212 be easy to influence both communication partners while in other cases 213 the existing deployment needs to be taken into consideration. 215 To illustrate another example, consider an Internet radio, which 216 allows a user to connect to available radio stations. A device like 217 this will be more demanding than an IP-enabled weighing scale that 218 only connects to the single web server offered by the device 219 manufacturer. A threat assessment may even lead to the conclusion 220 that TLS support is not necessary at all in this particular case. 222 Consider the following extension to our earlier scenario where the 223 smart-meter is attached to a home WLAN network and the inter-working 224 with WLAN security mechanisms need to be taken care of. On top of 225 the link layer authentication, a transport layer or application layer 226 security mechanism needs to be implemented. Quite likely the 227 security mechanisms will be different due to the different credential 228 requirements. While there is a possibility for re-use of 229 cryptographic libraries (such as the SHA-1, MD5, or HMAC) the overall 230 code footprint will very likely be larger. 232 Furthermore, security technology that will be deployed by end-user 233 consumer market products and large enterprise customer products will 234 need to be customized completely different. While the security 235 building blocks may be reused, there is certainly a big difference 236 between in terms of the architecture, the threats and effort that 237 will be spent securing the system. 239 3. Design Decisions 241 To evaluate the required TLS functionality a couple of high level 242 design decisions have to be made: 244 o What type of protection for the data traffic is required? Is 245 confidentiality protection in addition to integrity protection 246 required? Many TLS ciphersuites also provide a variant for NULL 247 encryption [RFC4279]. If confidentiality protection is required, 248 a carefully chosen set of algorithms may have a positive impact on 249 the code size. Re-use of crypto-libraries (within TLS but also 250 among the entire protocol stack) will also help to reduce the 251 overall code size. 253 o What functionality is available in hardware? For example, certain 254 hardware platforms offer support for a random number generator as 255 well as cryptographic algorithms (e.g., AES). These functions can 256 be re-used and allow to reduce the amount of required code. Using 257 hardware support not only reduces the computation time but can 258 also save energy due to the optimized implementation. 260 o What credentials for client and server authentication are 261 required: passwords, pre-shared secrets, certificates, raw public 262 keys (or a mixture of them)? Is mutual authentication required? Is 263 X509 certificate handling necessary? If not, then the ASN.1 264 library as well as the certificate parsing and processing can be 265 omitted. If pre-shared secrets are used then the big integer 266 implementation can be omitted. 268 o What TLS version and what TLS features, such as session 269 resumption, can or have to be used? In the case of DTLS, generic 270 fragmentation and reordering requires large buffers to reassemble 271 the messages, which might be too heavy for some devices. 273 o Is it possible to design only the client-side TLS stack, or 274 necessary to provide the server-side implementation as well? 275 Handshake messages sent are different sizes for the client and 276 server which creates energy consumption differences (due to the 277 fact that more power is spent during transmission than while 278 receiving data in wireless devices). 280 o Which side will be more powerful? Resource-constrained sensor 281 nodes running CoAPS might be server only, while nodes running 282 HTTPS are most like clients only that post their information to a 283 normal Web server. The constrained side will most likely only 284 implement a single ciphersuite. Flexibility is given to a more 285 powerful counterpart that supports many different ciphersuite for 286 various connected devices. 288 o Is it possible to hardwire credentials into the code rather than 289 loading them from storage? If so, then no file handling or 290 parsing of the credentials is needed and the credentials are 291 already available in a form that they can be used within the TLS 292 implementation. 294 4. Performance Numbers 296 In this section we summarize performance measurements available from 297 certain implementation experiences. This section is not supposed to 298 be exhaustive as we do not have all measurements available. The 299 performances are grouped according to extensions (TLS-PSK, raw-public 300 key and certificate based) and further grouped by performance 301 measures (memory, code size, communication overhead, etc.). Where 302 possible we extract the different building blocks found in TLS and 303 present their performance measures individually. 305 4.1. Pre-Shared Key (PSK) based DTLS implementation 307 This section provides performance numbers for a prototype 308 implementation of DTLS-PSK described in [I-D.keoh-lwig-dtls-iot] and 309 evaluates the memory and communication overheads. 311 4.1.1. Prototype Environment 313 The prototype is written in C and runs as an application on Contiki 314 OS 2.5 [Dunkels-contiki], an event-driven open source operating 315 system for constrained devices. They were tested in the Cooja 316 simulator and then ported to run on Redbee Econotag hardware, which 317 features a 32-bit CPU, 128 KB of ROM, 96 KB of RAM, and an IEEE 318 802.15.4 enabled radio with an AES hardware coprocessor. The 319 prototype comprises all necessary functionality to adapt to the roles 320 as a domain manager or a joining device. 322 The prototype is based on the "TinyDTLS" [Bergmann-Tinydtls] library 323 and includes most of the extensions and the adaptation as follows: 325 (1) The cookie mechanism was disabled in order to fit messages to the 326 available packet sizes and hence reducing the total number of 327 messages when performing the DTLS handshake. 329 (2) Separate delivery was used instead of flight grouping of messages 330 and redesigned the retransmission mechanism accordingly. 332 (3) The "TinyDTLS" AES-CCM module was modified to use the AES 333 hardware coprocessor. 335 The following subsections further analyze the memory and 336 communication overhead of the solution. 338 4.1.2. Code size and Memory Consumption 340 Table 1 presents the codesize and memory consumption of the prototype 341 differentiating (i) the state machine for the handshake, (ii) the 342 cryptographic primitives, and (iii) the DTLS record layer mechanism. 344 The use of DTLS appears to incur large memory footprint both in ROM 345 and RAM for two reasons. First, DTLS handshake defines many message 346 types and this adds more complexity to its corresponding state 347 machine. The logic for message re-ordering and retransmission also 348 contributes to the complexity of the DTLS state machine. Second, DTLS 349 uses SHA2-based crypto suites which is not available from the 350 hardware crypto co-processor. 352 +----------------------+-----------------+ 353 | | DTLS | 354 | +--------+--------+ 355 | | ROM | RAM | 356 +----------------------+--------+--------+ 357 | State Machine | 8.15 | 1.9 | 358 | Cryptography | 3.3 | 1.5 | 359 | DTLS Record Layer | 3.7 | 0.5 | 360 +----------------------+--------+--------+ 361 | TOTAL | 15.15 | 3.9 | 362 +----------------------+--------+--------+ 363 Table 1: Memory Requirements in KB 365 4.1.3. Communication Overhead 367 The communication overhead is evaluated in this section. In 368 particular, the message overhead and the number of exchanged bytes 369 under ideal condition without any packet loss is examined. 371 Table 2 summarizes the required number of round trips, number of 372 messages and the total exchanged bytes for the DTLS-based handshake 373 carried out in ideal conditions, i.e., in a network without packet 374 losses. DTLS handshake is considered complex as it involves the 375 exchange of 12 messages to complete the handshake. Further, DTLS runs 376 on top the transport layer, i.e., UDP, and hence this directly 377 increases the overhead due to lower layer per-packet protocol 378 headers. 380 +-------------------------------+--------+ 381 | | DTLS | 382 +-------------------------------+--------+ 383 | No. of Message | 8 | 384 | No. of round trips | 2 | 385 +-------------------------------+--------+ 386 | 802.15.4 headers | 112B | 387 | 6LowPAN headers | 320B | 388 | UDP headers | 64B | 389 +-------------------------------+--------+ 390 | TOTAL | 496B | 391 +-------------------------------+--------+ 392 Table 2: Communication overhead for Network 393 Access and Multicast Key Management 395 4.1.4. Message Delay, Success Rate and Bandwidth 397 Section 5.3 provided an evaluation of the protocol in an ideal 398 condition, thus establishing the the baseline protocol overhead. The 399 prototype was further examined and simulated the protocol behavior by 400 tuning the packet loss ratio. In particular, the impact of packet 401 loss on message delay, success rate and number of messages exchanged 402 in the handshake were examined. 404 Figure 4 shows the percentage of successful handshakes as a function 405 of timeouts and packet loss ratios. As expected, a higher packet loss 406 ratio and smaller timeout (15s timeout) result in a failure 407 probability of completing the DTLS handshake. When the packet loss 408 ratio reaches 0.5, practically no DTLS handshake would be 409 successful. 411 100 |+ 412 P | + 413 E 80 | ++ 414 R | ++ 415 C 60 | + 416 E | + 417 N 40 | + 418 T | ++ 419 A 20 | + 420 G | +++++ 421 E 0 +------------------++++++++--> 422 0 0.1 0.2 0.3 0.4 0.5 424 packet loss ratio (15s timeout) 426 Figure 1: Average % of successful handshakes 428 Delays in network access and communication are intolerable since they 429 lead to higher resource consumption. As the solution relies on PSK, 430 the handshake protocol only incurs a short delay of a few 431 milliseconds when there is no packet loss. However, as the packet 432 loss ratio increases, the delay in completing the handshake becomes 433 significant because loss packets must be retransmitted. Our 434 implementation shows that with a packet loss ratio of 0.5, the the 435 times to perform network access and multicast key management could 436 take up to 24s. 438 Finally, another important criterion is the number of messages 439 exchanged in the presence of packet loss. A successful handshake 440 could incur up to 35 or more messages to be transmitted when the 441 packet loss ratio reaches 0.5. This is mainly because the DTLS 442 retransmission is complex and often requires re-sending multiple 443 messages even when only a single message has been lost. 445 4.2. Certificate based and Raw-public key based TLS implementation 447 4.2.1. Prototype Environment 449 The following code was compiled under Ubuntu Linux using the -Os 450 compiler flag setting for a 64-bit AMD machine using a modified 451 version of the axTLS embedded SSL implementation. 453 4.2.2. Code size 455 For the cryptographic support functions these are the binary sizes: 457 +----------------------------+---------------+ 458 | Cryptographic functions | Code size | 459 +----------------------------+---------------+ 460 | MD5 | 4,856 bytes | 461 | SHA1 | 2,432 bytes | 462 | HMAC | 2,928 bytes | 463 | RSA | 3,984 bytes | 464 | Big Integer Implementation | 8,328 bytes | 465 | AES | 7,096 bytes | 466 | RC4 | 1,496 bytes | 467 | Random Number Generator | 4,840 bytes | 468 +----------------------------+---------------+ 469 Table 3: Code-size for cryptographic functions 471 The TLS library with certificate support consists of the following 472 parts: 474 x509 related code: 2,776 bytes 475 The x509 related code provides functions to parse certificates, to 476 copy them into the program internal data structures and to perform 477 certificate related processing functions, like certificate 478 verification. 480 ASN1 Parser: 5,512 bytes 481 The ASN1 library contains the necessary code to parse ASN1 data. 483 Generic TLS Library: 15,928 bytes 484 This library is separated from the TLS client specific code to offer 485 those functions that are common with the client and the server-side 486 implementation. This includes code for the master secret generation, 487 certificate validation and identity verification, computing the 488 finished message, ciphersuite related functions, encrypting and 489 decrypting data, sending and receiving TLS messages (e.g., finish 490 message, alert messages, certificate message, session resumption). 492 TLS Client Library: 4,584 bytes 493 The TLS client-specific code includes functions that are only 494 executed by the client based on the supported ciphersuites, such as 495 establishing the connection with the TLS server, sending the 496 ClientHello handshake message, parsing the ServerHello handshake 497 message, processing the ServerHelloDone message, sending the 498 ClientKeyExchange message, processing the CertificateRequest message. 500 OS Wrapper Functions: 2,776 bytes 501 These functions aim to make development easier (e.g., for failure 502 handling with memory allocation and various header definitions) but 503 are not absolutely necessary. 505 OpenSSL Wrapper Functions: 931 bytes 506 The OpenSSL API calls are familiar to many programmers and therefore 507 these wrapper functions are provided to simplify application 508 development. This library is also not absolutely necessary. 510 Certificate Processing Functions: 4,456 bytes 511 These functions provide the ability to load certificates from files 512 (or to use a default key as a static data structure embedded during 513 compile time), to parse them, and populate corresponding data 514 structures. 516 4.2.3. Raw Public Key Implementation 518 Of course, the use of raw public keys does not only impact the code 519 size but also the size of the exchanged messages. When using raw 520 public keys (instead of certificates) the "certificate" size was 521 reduced from 475 bytes to 163 bytes (using an RSA-based public key). 522 Note that the SubjectPublicKeyInfo block does not only contain the 523 raw keys, namely the public exponent and the modulus, but also a 524 small ASN.1 header preamble. 526 For the raw public key implementation the following components where 527 needed (in addition to a subset of the cryptographic support 528 functions): 530 Minimal ASN1 Parser: 3,232 bytes 531 The necessary support from the ASN1 library now only contains 532 functions for parsing of the ASN1 components of the 533 SubjectPublicKeyInfo block. 535 Generic TLS Library: 16,288 bytes 536 This size of this library was slightly enlarged since additional 537 functionality for loading keys into the bigint data structure was 538 added. On the other hand, code was removed that relates to 539 certificate processing and functions to retrieve certificate related 540 data (e.g., to fetch the X509 distinguished name or the subject 541 alternative name). 543 TLS Client Library: 4,528 bytes 544 The TLS client-specific code now contains additional code for the raw 545 public key support, for example in the ClientHello message. Most 546 functions were left unmodified. 548 5. Summary and Conclusions 550 TLS/DTLS can be tailored to fit the needs of a specific deployment 551 environment. This customization property allows it to be tailored to 552 many use cases including smart objects. The communication model and 553 the security goals will, however, ultimately decide the resulting 554 code size; this is not only true for TLS but for every security 555 solution.More flexibility and more features will ultimately translate 556 to a bigger footprint. 558 There are, however, cases where the security goals ask for a security 559 solution other than TLS. With the wide range of embedded 560 applications it is impractical to design for a single security 561 architecture or even a single communication architecture. 563 6. Security Considerations 565 This document discusses various design aspects for reducing the 566 footprint of (D)TLS implementations. As such, it is entirely about 567 security. 569 7. IANA Considerations 571 This document does not contain actions for IANA. 573 8. Acknowledgements 575 The authors would like to thank the participants of the Smart Object 576 Security workshop, March 2012. The authors greatly acknowledge the 577 prototyping and implementation efforts by Pedro Moreno-Sanchez and 578 Francisco Vidal-Meca who worked as interns at Philips Research. 580 9. References 582 9.1. Normative References 584 [RFC2246] Dierks, T. and C. Allen, "The TLS Protocol Version 1.0", 585 RFC 2246, January 1999. 587 [RFC4346] Dierks, T. and E. Rescorla, "The Transport Layer Security 588 (TLS) Protocol Version 1.1", RFC 4346, April 2006. 590 [RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security 591 (TLS) Protocol Version 1.2", RFC 5246, August 2008. 593 [RFC4347] Rescorla, E. and N. Modadugu, "Datagram Transport Layer 594 Security", RFC 4347, April 2006. 596 [SHA] National Institute of Standards and Technology, , "Secure Hash 597 Standard", FIPS 180-2, Aug 2002. 599 9.2. Informative References 601 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 602 Requirement Levels", BCP 14, RFC 2119, March 1997. 604 [RFC5763] Fischl, J., Tschofenig, H., and E. Rescorla, "Framework 605 for Establishing a Secure Real-time Transport Protocol (SRTP) 606 Security Context Using Datagram Transport Layer Security (DTLS)", 607 RFC 5763, May 2010. 609 [RFC4785] Blumenthal, U. and P. Goel, "Pre-Shared Key (PSK) 610 Ciphersuites with NULL Encryption for Transport Layer Security 611 (TLS)", RFC 4785, January 2007. 613 [RFC6066] Eastlake 3rd, D., "Transport Layer Security (TLS) 614 Extensions: Extension Definitions", RFC 6066, January 2011. 616 [RFC3268] Chown, P., "Advanced Encryption Standard (AES) 617 Ciphersuites for Transport Layer Security (TLS)", RFC 3268, June 618 2002. 620 [RFC4101] Rescorla, E. and IAB, "Writing Protocol Models", RFC 4101, 621 June 2005. 623 [RFC4279] Eronen, P., Ed., and H. Tschofenig, Ed., "Pre-Shared Key 624 Ciphersuites for Transport Layer Security (TLS)", RFC 4279, December 625 2005. 627 [TLS-IANA] IANA, "Transport Layer Security (TLS) Parameters: 628 http://www.iana.org/assignments/tls-parameters/tls-parameters.xml", 629 Oct 2012. 631 [I-D.ietf-tls-oob-pubkey] Wouters, P., Tschofenig, H., Gilmore, J., 632 Weiler, S., and T. Kivinen, "Out-of-Band Public Key Validation for 633 Transport Layer Security (TLS)", draft-ietf-tls-oob-pubkey-07 (work 634 in progress) February 2013. 636 [I-D.keoh-lwig-dtls-iot] Keoh, S., Kumar, S., and Garcia-Morchon, O., 637 "Securing the IP-based Internet of Things with DTLS", draft-keoh- 638 lwig-dtls-iot-01, February 2013. 640 [I-D.gilger-smart-object-security-workshop] Gilger, J., and 641 Tschofenig, H., "Report from the 'Smart Object Security Workshop', 642 March 23, 2012, Paris, France", draft-gilger-smart-object-security- 643 workshop-01.txt, February 2013. 645 [Dunkels-Contiki] Dunkels, A., Gronvall, B., and Voigt, T. "Contiki - 646 A Lightweight and Flexible Operating System for Tiny Networked 647 Sensors", In Proceedings of the 29th Annual IEEE International 648 Conference on Local Computer Networks, IEEE, 2004. 650 [Bergmann-Tinydtls] Bergmann, O. "TinyDTLS - A Basic DTLS Server 651 Template", http://tinydtls.sourceforge.net, 2012. 653 Authors' Addresses 655 Sandeep S. Kumar 656 Philips Research 657 High Tech Campus 34 658 Eindhoven 5656 AE 659 NL 661 Email: sandeep.kumar@philips.com 663 Sye Loong Keoh 664 University of Glasgow Singapore 665 Republic PolyTechnic, 9 Woodlands Ave 9 666 Singapore 838964 667 SG 669 Email: SyeLoong.Keoh@glasgow.ac.uk 671 Hannes Tschofenig 672 Nokia Siemens Networks 673 Linnoitustie 6 674 Espoo, 02600 675 Finland 677 Phone: +358 (50) 4871445 678 Email: Hannes.Tschofenig@gmx.net 679 URI: http://www.tschofenig.priv.at