// COMPLETE THREAD

Re: Signing ascii text

2 expanded posts ยท every known parent and child

NODE 953eb36aRe: Signing ascii text
At 11:31 PM 12/22/92 -0400, Yanek Martinson wrote:
>> (e.g., email messages, etc). Is there a convention for the end of line
>> sequence that is to be used for the copy of the file that is run through
>> the hash function? If there isn't, then the file hash will depend on the
>
>Canonical Text has a CR and LF at the end of each line.  This is 
>documented in some RFC.  All (most?) protocols used on internet such
>as smtp, finger, etc, use this format.  The possible justification
>is that an extra linefeed or a carriage return is not as bad as a missing
>one.  

Which RFC are you referring to?  While it is true that 821, 822 (and other
RFC's which are concerned with email messages) define the end of line as a
CRLF, I'm not aware of an RFC which defines canonical text.  The style of
late has been to define a line "as described in rfc822" or some such.  But
I don't recall any rfc which defines canonical text spanning session-layer
(or higher) protocols.  Is there one?

john noerenberg
jwn2@qualcomm.com
noerenberg.j (Applelink)
===========================================================
Do not uselessly lament your luck that is giving way, your work that has
failed, your life's plans that have all ended in despair.  Like a man long
prepared, like a man of courage, bid her farewell, the Alexandria that
leaves you.
-- "The God Abandons Anthony", Constantine Peter Cavafy [1911]
===========================================================
NODE 281d2966Re: Signing ascii text
> >Canonical Text has a CR and LF at the end of each line.
> Which RFC are you referring to?  

I am not aware of any single RFC that defines this, but every RFC
that I have read, if it mentions end-of-line at all, it is defined
as, or assumed to be, a carriage return followed by a newline.

Even in cases where the native representation is different, it
is converted to this format before transmission through the net,
and then converted back.  This is in some RFC-s referred to 
as "internet tradition", or "NetAscii".

This is similar to the Network Byte Order.  No matter what order
your machine stores bytes (little/big endian), it gets converted
to one standard format.

It is also referred to as "NVT Standard".

The only mention of a different end of line convention is in
relation to EBCDIC, which has an explicit newline <NL> character.

Here are excerpts from various RFCs that deal with, or mention, 
use of CRLF at the end of lines:


Request For Comments: 1078                                       SRI-NIC
                 TCP Port Service Multiplexer (TCPMUX)

   A TCP client connects to a foreign host on TCP port 1.  It sends the
   service name followed by a carriage-return line-feed <CRLF>.  

   acknowledgment, immediately followed by an optional message of
   explanation, terminated with a <CRLF>.  If the reply was positive,

Request for Comments: 1123                             R. Braden, Editor

       Requirements for Internet Hosts -- Application and Support

              To allow interoperability between arbitrary Telnet clients
              and servers, the Telnet protocol defined a standard
              representation for a line terminator.  Since the ASCII
              character set includes no explicit end-of-line character,
              systems have chosen various representations, e.g., CR, LF,
              and the sequence CR LF.  The Telnet protocol chose the CR
              LF sequence as the standard for network transmission.

Request for Comments: 1184                             D. Borman, Editor

                         Telnet Linemode Option

   line should be transmitted with "CR LF" as the line terminator.  When
 
   responsible for doing all output processing.  Specificly, it should
   send "CR LF" when it wants the "newline" function

Request for Comments: 1204                                        D. Lee

                     Message Posting Protocol (MPP)

      USER <SP> <username> <CRLF>
      PASS <SP> <password> <CRLF>
      DATA <CRLF>
      NOOP <CRLF>
      QUIT <CRLF>

      354 Enter mail, end with <CRLF>.<CRLF>

Request for Comments: 1288           Center for Discrete Mathematics and

                  The Finger User Information Protocol

   Any data transferred MUST be in ASCII format, with no parity, and
   with lines ending in CRLF (ASCII 13 followed by ASCII 10).  

Request for Comments: 1312                               Crynwr Software

                        Message Send Protocol 2

		  New lines should be represented using the usual
		  Netascii CR + LF.  (Following the Internet tradition,
		  a server should probably be prepared to accept a
		  message in which some other end-of-line convention is
		  followed, but a conforming client must use CR + LF.)

     NWG/RFC# 561                   AKB KP RST JEW 5-SEP-73 11:19  18516
     Standardizing Network Mail Headers           RFC 561 / NIC 18516

        Formal Syntax:                                               

           <mailtext>    ::= <header> <CRLF> <message>               
           <headeritem>  ::= <item> <CRLF>                           

           <message>     ::= <line> <CRLF> ! <line> <CRLF> <message>
                                                                    
           <line>        ::= a string containing any of the 128 ASCII
                             characters except CR and LF            
           <word>        ::= a string containing any of the 128 ASCII
                             characters except CR, LF, and SP       
           <CRLF>        ::= CR LF                                  
           <SP>          ::= space                                  

   RFC 821
                                    
                     SIMPLE MAIL TRANSFER PROTOCOL

            MAIL <SP> FROM:<reverse-path> <CRLF>

            RCPT <SP> TO:<forward-path> <CRLF>

            DATA <CRLF>

         SEND <SP> FROM:<reverse-path> <CRLF>
         SOML <SP> FROM:<reverse-path> <CRLF>
         SAML <SP> FROM:<reverse-path> <CRLF>
         HELO <SP> <domain> <CRLF>
         QUIT <CRLF>

         The SMTP commands define the mail transfer or the mail system
         function requested by the user.  SMTP commands are character
         strings terminated by <CRLF>.  The command codes themselves are
         alphabetic characters terminated by <SP> if parameters follow
         and <CRLF> otherwise.

     RFC #  822


                        STANDARD FOR THE FORMAT OF
                        ARPA INTERNET TEXT MESSAGES


          A message consists of header fields and, optionally, a body.
     The  body  is simply a sequence of lines containing ASCII charac-
     ters.  It is separated from the headers by a null line  (i.e.,  a
     line with nothing preceding the CRLF).


     field       =  field-name ":" [ field-body ] CRLF

     field-body  =  field-body-contents
                    [CRLF LWSP-char field-body]


        Each header field may be represented on exactly one line  con-
        sisting  of the name of the field and its body, and terminated
        by a CRLF;

Request for Comments: 959                                    J. Reynolds

                      FILE TRANSFER PROTOCOL (FTP)

            In accordance with the NVT standard, the <CRLF> sequence
            should be used where necessary to denote the end of a line
            of text.  (See the discussion of file structure at the end

               process will interpret appropriately.  <CRLF>, in exactly
               this sequence, also denotes end-of-line.

         the FTP implementation should use the end-of-line sequence,
         <CRLF> for ASCII, or <NL> for EBCDIC text files, as the

      For the purpose of standardized transfer, the sending host will
      translate its internal end of line or end of record denotation
      into the representation prescribed by the transfer mode and file
      structure, and the receiving host will perform the inverse
      translation to its internal denotation.  

      End-of-line in an ASCII or EBCDIC file with no
      record structure should be indicated by <CRLF> or <NL>,
      respectively.  

            information.  The data will be transferred in ASCII or
            EBCDIC type over the data connection as valid pathname
            strings separated by <CRLF> or <NL>.  (Again the user must

Request for Comments: 977                   Phil Lapsley (U.C. Berkeley)

                     Network News Transfer Protocol
                                    

   Each command line must be terminated by a CR-LF (Carriage Return -
   Line Feed) pair.

   that indicates that text will follow.  Text is sent as a series of
   successive lines of textual matter, each terminated with CR-LF pair.



--
Yanek Martinson    mthvax.cs.miami.edu!safe0!yanek     uunet!medexam!yanek
this address preferred -->> yanek@novavax.nova.edu <<-- this address preferred
Phone (305) 765-6300 daytime   FAX: (305) 765-6708  1321 N 65 Way/Hollywood
      (305) 963-1931 evenings       (305) 981-9812  Florida, 33024-5819