Standards Track J. Strombergson
Internet-Draft InformAsic AB
Expires: December 28, 2004 L. Walleij
Ledasa Rangers
P. Faltstrom
Cisco Systems Inc
June 29, 2004
The Standard Hex Format
draft-strombergson-shf-01.txt
Status of this Memo
By submitting this Internet-Draft, I certify that any applicable
patent or other IPR claims of which I am aware have been disclosed,
and any of which I become aware will be disclosed, in accordance with
RFC 3668.
Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF), its areas, and its working groups. Note that other
groups may also distribute working documents as Internet-Drafts.
Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress."
The list of current Internet-Drafts can be accessed at http://
www.ietf.org/ietf/1id-abstracts.txt.
The list of Internet-Draft Shadow Directories can be accessed at
http://www.ietf.org/shadow.html.
This Internet-Draft will expire on December 28, 2004.
Copyright Notice
Copyright (C) The Internet Society (2004). All Rights Reserved.
Abstract
This document specifies the Standard Hex Format (SHF), a new,
XML-based open format for describing hexadecimal data. SHF provides
the ability to describe both small and large, simple and complex
hexadecimal data dumps in an open, modern, transport and vendor
neutral format.
Strombergson, et al. Expires December 28, 2004 [Page 1]
Internet-Draft The Standard Hex Format June 2004
1. Introduction
In the computing, network and embedded systems communities several
different types of data formats for hexadecimal data are being used.
Typical uses include executable object code for embedded systems
(i.e. "firmware"), on-chip flash memories and filesystems, FPGA
configuration bitstreams, graphics and other application resources,
routing tables, etc. Unfortunately, none of the formats used are
truly open, vendor neutral and/or well defined.
Even more problematic is the fact that none of these formats are able
to represent data sizes that are getting more and more common. Data
dumps comprising of multiple sub-blocks with different word sizes,
data sizes spanning anywhere from a few bytes of data to data sizes
much larger than 2^32 bits are not handled. Also, the checksum
included in these formats are too simplistic and for larger data
sizes provides insufficient ability to accurately detect errors.
Alternatively, the overhead needed for proper error detection is very
large.
The Standard Hex format therefore is an effort to provide a modern,
XML based format that is not too complex for simple tools and
computing environments to implement, generate, parse and use. Yet the
format is able to handle large data sizes, complex data structures
and provide high quality error detection by leveraging standardized
cryptographic hash functions.
At present, the usage of the SHF format may be mainly for Internet
transport and file storage on development machinery. A parser for the
XML format is presently not easily deployed in hardware devices, but
the parsing and checksumming of the SHF data may be done by a
workstation computer which in turn convert the SHF tokens to an
ordinary bitstream before the last step of e.g. a firmware upgrade
commence.
Strombergson, et al. Expires December 28, 2004 [Page 2]
Internet-Draft The Standard Hex Format June 2004
2. Terminology
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
document are to be interpreted as described in RFC 2119 [1].
The key word Byte is to be interpreted as a group of 8 bits. The key
word Octet is another name for Byte.
The key word Word is to be interpreted as a group containing an
integral number of Bytes.
The expressiom 2^n is to be interpreted as the value two (2) raised
to the n:th power. For example 2^8 equals the value 256.
Strombergson, et al. Expires December 28, 2004 [Page 3]
Internet-Draft The Standard Hex Format June 2004
3. Features and functionality
The SHF-format has the following features:
o Support for arbitrarily wide data words
o Support for very large data blocks
o Support for an arbitrary number of independent data blocks
o Data integrity detection against errors provided by the RFC3174
specified (see [2]) SHA-1 cryptographic signature
o An XML-based format
In the embedded systems domain, 8- and 16-bit system are still used
in large numbers and will continue to do so for any forseeable
future. Simultaneously, more and more systems are using 64-bit and
even larger word sizes.
SHF supports all of these systems by allowing the word size to be
specified. The word size MUST be an integer number of Bytes and at
least one (1) Byte.
SHF is able to represent both large and small data blocks. The data
block MUST contain at least one (1) Word. Additionally, the data
block MUST NOT be larger than (2^64)-1 bits.
The SHF dump MUST contain at least one (1) data block. The maximum
number of blocks supported is 2^64. Each data block in the dump MAY
have different word sizes and start at different addresses.
The checksum (or message digest) used to verify the correctness or
data integrity of each block is 20 Bytes (160 bits) long. The digest
MUST be calculated on the data actually represented by the SHF data
block, NOT the representation, i.e. NOT the ASCII-code. SHA-1 is only
able to calculate a digest for a data block no larger than (2^64)-1
bits and this limits the size of each data block to in SHF to
(2^64)-1 bits.
Strombergson, et al. Expires December 28, 2004 [Page 4]
Internet-Draft The Standard Hex Format June 2004
4. SHF XML specification
The SHF format consists of an XML data structure representing a dump.
The dump consists of a dump header section and one (1) or more block
sections containing data. Each block of data is independent of any
other block.
A short, symbolic example of a SHF dump is illustrated by the
following structure:
(Data)
4.1 Header section
The header section comprises of the the dump tag which includes the
following attributes:
o name: A string of arbitrary length used by any interested party to
identify the specific SHF dump.
o blocks: A 64 bit hexadecimal value representing the number of
blocks in the specific SHF dump.
After the preceding dump tag one or more subsections of blocks must
follow. Finally, the complete SHF dump end with a closing dump tag.
4.2 Block subsection
The block subsection contains a block tag and a data subsection. The
block tag includes the following attributes:
o name: A string of arbitrary length used by any interested party to
identify the specific block.
o start_address: A 64 bit hexadecimal value representing the start
address in Bytes for the data in the block.
o word_size: A 64 bit hexadecimal value representing the number of
Bytes (the width) of one Word of the data.
o length: A hexadecimal representation of an unsigned 64-bit integer
indicating the number of words in the "data" element.
Strombergson, et al. Expires December 28, 2004 [Page 5]
Internet-Draft The Standard Hex Format June 2004
o checksum: A hexadecimal representation of the 20 Byte SHA-1 digest
of the data in the block.
The total size of the data in the block (in bits) is given by the
expression (8 * word_size * length). The expression MUST NOT be
larger than (2^64)-1.
After the preceding block tag one subsection of data MUST follow.
Finally, the block section ends with a closing block tag.
4.3 data subsection
The data subsection of the block section compises of the opening and
closing data tags and the hexadecimal representation of the actual
data in the block.
Strombergson, et al. Expires December 28, 2004 [Page 6]
Internet-Draft The Standard Hex Format June 2004
5. SHF rules and limits
There are several rules and permissions in SHF:
o The data and attribute values representing an actual value MUST be
in Big Endian-format. It is the responsibility of the
SHF-generator to ensure that these attributes are Big Endian.
Similarly, if needed, it is the responsibility of any SHF consumer
to swap the attribute values to the appropriate Endianness as
needed by the SHF consumer.
o All attribute values representing an actual value and the data
MUST be in hexadecimal notation. The attributes excluded from this
rule is the name attribute in the dump and block tags.
o All attribute values with the exception for the checksum MAY be
leading zero truncated. Conversely, the checksum MUST NOT be
leading zero truncated.
o The data represented in a block MUST NOT be larger than (2^64)-1
bits.
o The size of a word MUST NOT be larger than (2^64)-1 bits. This
implies that a block with a word defined to the maximum width can
not contain more than one Word.
Strombergson, et al. Expires December 28, 2004 [Page 7]
Internet-Draft The Standard Hex Format June 2004
6. SHF DTD
The elements named "data" and the attributes "blocks", "address",
"word_size" and "checksum" should only contain the characters which
are valid hexbyte sequences. These are:
whitespace ::= (#x20 | #x9 | #xD | #xA)+
hexdigit ::= [0-9A-Fa-f]
hexbytes ::= whitespace* hexdigit (hexdigit|whitespace)*
A parser reading in an SHF file should silently ignore any other
characters that would by mistake appear in any of these elements or
attributes. These alien characters should be treated as if they did
not exist. Also note that "whitespace" has no semantic meaning, it is
only valid for the reason of improving human readability of the dump.
Whitepace may be altogether removed and the hexbyte sequences
concatenated if desired.
Strombergson, et al. Expires December 28, 2004 [Page 8]
Internet-Draft The Standard Hex Format June 2004
7. SHF examples
This section contains three different SHF examples, illustrating the
usage of SHF and the attributes in SHF.
The first example is a simple SHF dump with a single block of data:
41 6c 6c 20 79 6f 75 72 20 62 61 73 65 20 61 72
65 20 62 65 6c 6f 6e 67 20 74 6f 20 75 73 0a
The second example is a program in 6502 machine code residing at
memory address 0x1000, which calculates the 13 first fibonacci
numbers and stores them at 0x1101-0x110d:
a9 01 85 20 85 21 20 1e 10 20 1e 10 18 a5 21 aa
65 20 86 20 85 21 20 1e 10 c9 c8 90 ef 60 ae 00
11 a5 21 9d 00 11 ee 00 11 60
01 00 00 00 00 00 00 00 00 00 00 00 00 00
The final example contains a block of 40-bit wide data:
00100 00200 00000 00090 00000 00036 00300 00400
00852 00250 00230 00858 00500 00600 014DC 00058
002A8 000B8 00700 00800 000B0 00192 00100 00000
Strombergson, et al. Expires December 28, 2004 [Page 9]
Internet-Draft The Standard Hex Format June 2004
00900 00A00 00000 0000A 40000 00000 00B00 00C00
00000 00000 00000 00001 00D00 00E00 00000 00100
0CCCC CCCCD 00F00 01000 00000 00010 80000 00000
00100 00790 00000 00234
Strombergson, et al. Expires December 28, 2004 [Page 10]
Internet-Draft The Standard Hex Format June 2004
8. SHF security considerations
The SHF format is a format for representing hexadecimal data that one
wants to transfer, manage or transform. The format itself does not
guarantee that the represented data is falsely represented, malicious
or otherwise dangerous.
The data integrity of the SHF file as a whole is to be provided, if
needed, by external mean (as to the SHF file) such as the generic
signing mechanism described by RFC 3275 [3].
Strombergson, et al. Expires December 28, 2004 [Page 11]
Internet-Draft The Standard Hex Format June 2004
9. MIME Registration Information
This section contains the registration information for the MIME type
to SHF.
o Registration: application/shf+xml
o MIME media type name: application
o MIME subtype name: shf+xml
o Required parameters: charset
9.1 Required parameters
This parameter must exist and must be set to "UTF-8". No other
character sets are allowed for transporting SHF data. The character
set designator MUST NOT be quoted and MUST be uppercase, yielding
this exact appearance: charset=UTF-8
9.2 Encoding considerations
This media type may contain binary content; accordingly, when used
over a transport that does not permit binary transfer, an appropriate
encoding must be applied.
9.3 Security considerations
A hex dump in itself has no other security considerations than what
applies for any other XML file. However the included binary data may
in decoded form contain any executable code for a target platform. If
additional security is desired, additional transport security
solutions may be applied. For target code contained in a hex dump,
developers may want to include certificates, checksums and the like
in hexdump form for the target platform. Such uses is outside the
scope of this document and a matter of implementation.
9.4 Interoperability considerations
n/a
9.5 Published specification
This media type is a proper subset of the the XML 1.0 specification
[WWWXML]. Two restrictions are made. First, no entity references
other than the five predefined general entities references ("&", "<",
">", "'", and """) and numeric entity references may be present.
Second, neither the "XML" declaration (e.g., ) nor the "DOCTYPE"
declaration (e.g., ) may be present. All other XML 1.0 instructions
(e.g., CDATA blocks, processing instructions, and so on) are allowed.
Strombergson, et al. Expires December 28, 2004 [Page 12]
Internet-Draft The Standard Hex Format June 2004
Applications which use this media type: any program or individual
wishing to make use of this XML 1.0 subset for hexdump exchange.
Additional Information:
o Magic number: There is no single initial byte sequence that is
always present for SHF files
o File extension: shf
o Macintosh File Type code: none
Strombergson, et al. Expires December 28, 2004 [Page 13]
Internet-Draft The Standard Hex Format June 2004
10. Extensions
The namespace of the SHF XML format may be extended when need arise.
For example, certain applications will want to represent executable
code as a SHF dump and may then need a start address to be associated
with certain dump blocks, so that the address can be configured as a
starting point for the code in the block. This can be done by
exending the namespace for a block tag with a "start_address"
attribute.
As long as such new attributes are added, with no attributes being
removed or redefined, the resulting dump shall be considered a valid
SHF dump, transported using the application/xml+shf transport type,
and parsers unaware of the modified namespace shall silently ignore
any such extended attributes, or simply duplicate them from input to
output when processing an SHF file as a filter.
The management of such extended attributes is a matter of convention
between different classes of users and not a matter of the IETF.
Strombergson, et al. Expires December 28, 2004 [Page 14]
Internet-Draft The Standard Hex Format June 2004
11. Additional information
Contact for further information: c.f., the "Author's Address" section
of this memo.
Intended usage: COMMON.
Author/Change controller: the authors of this document.
Acknowledgment: The SMIL memory dump was kindly provided by Sten
Henriksson at Lund University. Proofreading and good feedback on the
SHF draft was generously provided by Peter Lindgren.
12 References
[1] Bradner, S., "Key words for use in RFCs to Indicate Requirement
Levels", BCP 14, RFC 2119, March 1997.
[2] Eastlake, 3rd, D. and P. Jones, "US Secure Hash Algorithm 1
(SHA1)", BCP 14, RFC 3174, September 2001.
[3] Eastlake, 3rd, D., Joseph, J. and D. David, "(Extensible Markup
Language) XML-Signature Syntax and Processing", BCP 14, RFC
3275, March 2002.
[4] Makoto, M., Simon, S. and D. Dan, "(Extensible Markup Language)
XML Media Types", BCP 14, RFC 3023, January 2001.
Authors' Addresses
Joachim Strombergson
InformAsic AB
Hugo Grauers gata 5a
Gothenburg 411 33
SE
Phone: +46 31 68 54 90
EMail: Joachim.Strombergson@InformAsic.com
URI: http://www.InformAsic.com/
Strombergson, et al. Expires December 28, 2004 [Page 15]
Internet-Draft The Standard Hex Format June 2004
Linus Walleij
Ledasa Rangers
Master Olofs Vag 24
Lund 224 66
SE
Phone: +46 703 193678
EMail: triad@df.lth.se
Patrik Faltstrom
Cisco Systems Inc
Ledasa
273 71 Lovestad
Sweden
EMail: paf@cisco.com
URI: http://www.cisco.com
Strombergson, et al. Expires December 28, 2004 [Page 16]
Internet-Draft The Standard Hex Format June 2004
Intellectual Property Statement
The IETF takes no position regarding the validity or scope of any
Intellectual Property Rights or other rights that might be claimed to
pertain to the implementation or use of the technology described in
this document or the extent to which any license under such rights
might or might not be available; nor does it represent that it has
made any independent effort to identify any such rights. Information
on the IETF's procedures with respect to rights in IETF Documents can
be found in BCP 78 and BCP 79.
Copies of IPR disclosures made to the IETF Secretariat and any
assurances of licenses to be made available, or the result of an
attempt made to obtain a general license or permission for the use of
such proprietary rights by implementers or users of this
specification can be obtained from the IETF on-line IPR repository at
http://www.ietf.org/ipr.
The IETF invites any interested party to bring to its attention any
copyrights, patents or patent applications, or other proprietary
rights that may cover technology that may be required to implement
this standard. Please address the information to the IETF at
ietf-ipr@ietf.org.
Disclaimer of Validity
This document and the information contained herein are provided on an
"AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS
OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY AND THE INTERNET
ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE
INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED
WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
Copyright Statement
Copyright (C) The Internet Society (2004). This document is subject
to the rights, licenses and restrictions contained in BCP 78, and
except as set forth therein, the authors retain all their rights.
Acknowledgment
Funding for the RFC Editor function is currently provided by the
Internet Society.
Strombergson, et al. Expires December 28, 2004 [Page 17]