Subject: Re: [MMUSIC] ABNF errors in draft-ietf-mmusic-file-transfer-mech-01.txt

From: Miguel Garcia <[email-masked]>
Date: Tue, 22 May 2007 09:36:59 +0300

Hi Sudhakar:

Thanks for the reply. I missed the innocent "x" there.

So, I was looking at how the syntax should look like. I have another 
proposal instead.

Alternative 1:
==============
My proposal is to remove the "x", which does not add any value (IMHO). 
According to this, the syntax would be become:

     hash-selector        = "hash:" hash-algorithm ":" hash-value
     hash-algorithm       = token     ;see IANA Hash Function
                                      ;Textual Names registry
     hash-value           = 1*HEXDIG  ;HEXDIG defined in RFC 4234

and an example would be:

     a=file-selector:name:"My cool picture.jpg" type:image/jpeg
          size:32349 hash:sha-1:72245FE8653DDAF371362F86D471913EE4A2CE2E

Alternative 2:
==============
RFC 4572 (Comedia) has a different way of encoding hashes in SDP, in the 
'fingerprint' attribute. The difference is the presence of dots in 
between each byte. Do people want to use this way of encoding hashes? 
The syntax would be:

     hash-selector        = "hash:" hash-algorithm ":" hash-value
     hash-algorithm       = token     ;see IANA Hash Function
                                      ;Textual Names registry
     hash-value           = 2UHEX *(":" 2UHEX)
                              ; Each byte in upper-case hex, separated
                              ; by colons.

and an example would be:

     a=file-selector:name:"My cool picture.jpg" type:image/jpeg
   size:32349
   hash:sha-1:72:24:5F:E8:65:3D:DA:F3:71:36:2F:86:D4:71:91:3E:E4:A2:CE:2E

I don't like much alternative 2, but I reckon it will ease 
implementations that have already implemented RFC 4572 and have a 
function to calculate the hash and return it as a string.

So I propose that we change the draft to use to Alternative 2, so it is 
aligned with Comedia. Any comments?

/Miguel

sudhakar an wrote:
> Hi Miguel,
> 
> Thanks for the response. My reasoning/response below.
> 
>   
>     hash-selector        = "hash:" hash-algorithm ":" hash-value
>     hash-algorithm       = token     ;see IANA Hash Function
>                                       ;Textual Names registry
>     hash-value           = hex-val   ;hex-val defined in RFC 4234
>   
>  From rfc4234
>   
>          hex-val        =  "x" 1*HEXDIG
>                             [ 1*("." 1*HEXDIG) / ("-" 1*HEXDIG) ]
> 
> If we go by this syntax the hash value will look like.
> 
> hash:sha-1:x72245FE8653DDAF371362F86D471913EE4A2CE2E
> 
> Note the "x" after "sha-1:". and "x" is not optional.
> 
> Examples in draft-ietf-mmusic-file-transfer-mech-01.txt seem to show the hash selector like this
>   
>      a=file-selector:name:"My cool picture.jpg" type:image/jpeg
>            size:32349 hash:sha-1:72245FE8653DDAF371362F86D471913EE4A2CE2E
> 
> These do not have  "x" as the first charachter. Hence, I believe the examples are not conforming to the above mentioned ABNF.
> 
> Thanks
> Sudhakar
> 
> ----- Original Message ----
> From: Miguel Garcia <[email-masked]>
> To: sudhakar an <[email-masked]>
> Cc: [email-masked]
> Sent: Monday, May 21, 2007 7:38:56 PM
> Subject: Re: [MMUSIC] ABNF errors in draft-ietf-mmusic-file-transfer-mech-01.txt
> 
> 
> Hi Sudhakar:
> 
> Thanks for your comments. See inline discussion:
> 
> 
> sudhakar an wrote:
>> 1)
>>     filename-selector    = "name:"  DQUOTE filename-string DQUOTE
>>                                         ; DQUOTE defined in RFC 4234
>>     filename-string      = byte-string ;byte-string defined in RFC 4566
>>  
>> From rfc4566
>>    byte-string =         1*(%x01-09/%x0B-0C/%x0E-FF)
>>                          ;any byte except NUL, CR, or LF
>>  
>> As it can be seen, the regular expression for byte-string would eat up the second DQUOTE and all subsequent character until CRLF. Possibly the draft needs to be modified to mention that any DQUOTE appearing within byte—string should be escaped properly.
> 
> I agree with you, we ought to say that if quotes are used they should be 
> escaped along other characters that we already mention.
> 
> So, I have modified the filename-string ABNF, which is now defined as:
> 
>     filename-string      = 1*(%x01-09/%x0B-0C/%x0E-21/%x23-FF)
>                           ;any byte except NUL, CR, LF, or double quotes
> 
> And I have added the following sentence later in the description:
> 
>     If a file name contains double quotes, they MUST be percent-encoded.
> 
> 
>>  
>> 2)
>>  
>>    hash-selector        = "hash:" hash-algorithm ":" hash-value
>>     hash-algorithm       = token     ;see IANA Hash Function
>>                                      ;Textual Names registry
>>     hash-value           = hex-val   ;hex-val defined in RFC 4234
>>  
>> From rfc4234
>>  
>>         hex-val        =  "x" 1*HEXDIG
>>                            [ 1*("." 1*HEXDIG) / ("-" 1*HEXDIG) ]
>>  
>> All examples in draft-ietf-mmusic-file-transfer-mech-01.txt seem to show the hash selector like this
>>  
>>     a=file-selector:name:"My cool picture.jpg" type:image/jpeg
>>           size:32349 hash:sha-1:72245FE8653DDAF371362F86D471913EE4A2CE2E
>>  
>> Please remove the ambiguity in specifying hash selector
> 
> I am not sure if I understood where the problem is. I was comparing the 
> ABNF and the example and to my knowledge, the example fits the ABNF. Can 
> you please elaborate?
> 
> 
>>  
>> Thanks 
>> Sudhakar
>>
>>
> 
> Thanks for you review.
> 
> /Miguel
>>  
>> ____________________________________________________________________________________
>> Be a PS3 game guru.
>> Get your game face on with the latest PS3 news and previews at Yahoo! Games.
>> http://videogames.yahoo.com/platform?platform=120121
>>
>> _______________________________________________
>> mmusic mailing list
>> [email-masked]
>> https://www1.ietf.org/mailman/listinfo/mmusic
>>
> 

-- 
Please note my new e-mail address: miguel.garcia at nsn.com
Miguel A. Garcia           tel:+358-50-4804586
Nokia Siemens Networks     Helsinki, Finland

_______________________________________________
mmusic mailing list
[email-masked]
https://www1.ietf.org/mailman/listinfo/mmusic