Subject: [ietf-dkim] Section 3.7 s/content-hash/body-hash/?

From: Alessandro Vesely <[email-masked]>
Date: Tue, 17 May 2011 18:52:39 +0200

Version -10 says

    More formally, pseudo-code for the signature algorithm is:
 body-hash =  hash-alg (canon-body, l-param)
 data-hash    =  hash-alg (h-headers, D-SIG, content-hash)
 signature    =  sig-alg (d-domain, selector, data-hash)

    where:

    body-hash:   is the output from hashing the body, using hash-alg.

Shouldn't it say

    More formally, pseudo-code for the signature algorithm is:
 body-hash =  hash-alg (canon-body limited by l-param)
 data-hash    =  hash-alg (h-headers, D-SIG with body-hash)
 signature    =  sig-alg (d-domain, selector, data-hash)

    where:

    body-hash:   is the output from hashing the body, using hash-alg.
       It is set as the value of the bh= tag in D-SIG for computing
       the data-hash.
?
_______________________________________________
NOTE WELL: This list operates according to 
http://mipassoc.org/dkim/ietf-list-rules.html

---

From: Hector Santos <[email-masked]>
Date: Tue, 17 May 2011 13:23:07 -0400

>        It is set as the value of the bh= tag in D-SIG for computing

Sounds technically correct.  +1

-- 
Hector Santos, CTO
http://www.santronics.com
http://santronics.blogspot.com

---

From: "Murray S. Kucherawy" <[email-masked]>
Date: Tue, 17 May 2011 10:54:41 -0700

> -----Original Message-----
> From: [email-masked] [mailto:[email-masked]] On Behalf Of Alessandro Vesely
> Sent: Tuesday, May 17, 2011 9:53 AM
> To: <[email-masked]>
> Subject: [ietf-dkim] Section 3.7 s/content-hash/body-hash/?
> 
> Version -10 says
> 

I think this should be limited only to change "content-hash" to "body-hash" in the "data-hash" line, which is correct.

The remaining changes are inconsistent with the rest of the section or don't clarify anything.  For example, the "hash-alg" function on the body-hash line takes the canonicalized body and the l-param as inputs, and produce the body-hash.  Thus, that expression is correct as-is.

---

From: "John R. Levine" <[email-masked]>
Date: 17 May 2011 14:04:27 -0400

> I think this should be limited only to change "content-hash" to "body-hash" in the "data-hash" line, which is correct.

+1

Regards,
John Levine, [email-masked], Primary Perpetrator of "The Internet for Dummies",
Please consider the environment before reading this e-mail. http://jl.ly
_______________________________________________
NOTE WELL: This list operates according to 
http://mipassoc.org/dkim/ietf-list-rules.html

---

From: Dave CROCKER <[email-masked]>
Date: Tue, 17 May 2011 14:17:46 -0400

On 5/17/2011 1:54 PM, Murray S. Kucherawy wrote:
>> Shouldn't it say
>>
>> More formally, pseudo-code for the signature algorithm is: body-hash =
>> hash-alg (canon-body limited by l-param) data-hash    =  hash-alg
>> (h-headers, D-SIG with body-hash) signature    =  sig-alg (d-domain,
>> selector, data-hash)
>>
>> where:
>>
>> body-hash:   is the output from hashing the body, using hash-alg. It is set
>> as the value of the bh= tag in D-SIG for computing the data-hash.
>
> I think this should be limited only to change "content-hash" to "body-hash"
> in the "data-hash" line, which is correct.

Right.  This was my error.  the 'content' string was a carry-over from my 
attempt to define DKIM
in terms of Doseta.  I tried to do string replacements but missed this one.

> The remaining changes are inconsistent with the rest of the section or don't
> clarify anything.  For example, the "hash-alg" function on the body-hash line
> takes the canonicalized body and the l-param as inputs, and produce the
> body-hash.  Thus, that expression is correct as-is.

Not merely inconsistent.  The existing text specifies parameters to routines
that do internal processes.  This is a standard form for specifying interfaces.

The proposed change tries to move some of the processing into the parameter, and
hence is not an interface specification (unless, for example, the goal is to
tell the caller to truncate the body, rather than have the subroutine do the
truncating.

d/

-- 

   Dave Crocker
   Brandenburg InternetWorking
   bbiw.net
_______________________________________________
NOTE WELL: This list operates according to 
http://mipassoc.org/dkim/ietf-list-rules.html

---

From: Alessandro Vesely <[email-masked]>
Date: Wed, 18 May 2011 13:55:13 +0200

> tell the caller to truncate the body, rather than have the subroutine do the

Yes, I put the remaining changes quickly and badly just to suggest
that, IMHO, there is room for improvement.  In particular, hash-alg
looks like an overloaded function that can take two or three
parameters, but its definitions are hard to spot.
_______________________________________________
NOTE WELL: This list operates according to 
http://mipassoc.org/dkim/ietf-list-rules.html

---

From: Hector Santos <[email-masked]>
Date: Wed, 18 May 2011 09:54:21 -0400

Alessandro Vesely wrote:
>> The proposed change tries to move some of the processing into 
>> the parameter, and hence is not an interface specification (unless, 
>> for example, the goal is to tell the caller to truncate the body, 
>> rather than have the subroutine do the truncating.
> 

I am not proposing a change, but it may be stated as:

  canon-body =  canon-alg(c-param, body-content limited by l-param)
  pvt-key    =  pvt-key-alg(d-param, s-param, from.domain)
  bh-param   =  body-hash-alg (canon-body, a-param)
  b-param    =  data-hash-alg (pvt-key, h-headers, a-param, D-SIG1, 
bh-param)
  signature  =  sig-alg (D-SIG2, b-param)

  Where

     D-SIG1 is the "pre-prepared" DKIM-SIGNATURE header with all
     the tag= params but without the body hash (bh-param) tag,

     D-SIG2 is the "pre-prepared" DKIM-SIGNATURE header with the
     bh-param but without the b-param (data hash)