🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #87611

Re: New draft for Cancel-Lock

#87611
From: Julien ÉLIE
Date: Thu, 09 Mar 2017 20:52
106 lines
5135 bytes
Hi Michael,

>> - Section 2:
>> code-string  = 1*base64-octet
>> base64-octet = ALPHA / DIGIT / "+" / "/" / "="
>>
>> Shouldn't something like RFC 3977 specifies be used?
>>
>>      base64 = *(4base64-char) [base64-terminal]
>>      base64-char = UPPER / LOWER / DIGIT / "+" / "/"
>                     ^^^^^^^^^^^^^
> Is there a particular reason to not use ALPHA here?

No particular reason.  I just did a copy/paste without trying to 
optimize the grammar.  You're right that ALPHA is fine, especially when 
importing ABNF RFC 5234 core rules.



>>      base64-terminal = 2base64-char "==" / 3base64-char "="
>
> At all it is obviously a definition that matches Base64 much closer than
> the one I copied from Simons draft.
>
> In general I agree that it would be better to define it as you have
> suggested above (if we use "base64" to create names for the syntax
> definition, the defined thing should be Base64).
> But from the formal point of view there is a possibility to break the
> backward compatibility:
> In Simons draft (on which all current implementations are based) it is
> sufficient that a Cancel-Key code string "looks like Base64", it must
> not be real Base64. Simon has defined this as an example (I have simply
> copied it):
> |
> | Cancel-Key: sha1:aaaBBBcccDDDeeeFFF
>                    |   |   |   |   |

Oh, then don't we have a problem?
In Section 2.2, <c-key> is defined as "base64(K)" whereas it is in fact 
not the case.  I understand <c-key> is in fact just a string of 
base64-octets.
K has no real significance, and I then think the document should not 
mention it in Section 2.  Maybe K could be used in Section 4 as K = 
HMAC(mid+sec) if you want.

Correct me if I am wrong, but I believe the only thing to mention is 
that we just have a Cancel-Key, that is a string of base64-octets, and:
   <c-lock-string> = base64(hash(<c-key-string>))


I would then suggest:

   c-lock          = scheme ":" c-lock-string
   c-lock-string   = *(4base64-char) [base64-terminal]
   base64-char     = ALPHA / DIGIT / "+" / "/"
   base64-terminal = 2base64-char "==" / 3base64-char "="


   c-key         = scheme ":" c-key-string
   c-key-string  = 1*base64-octet
   base64-octet  = ALPHA / DIGIT / "+" / "/" / "="


It is consistent with both Simon's draft and yours.



> This is obviously crafted and not calculated, the point is that it's
> *not* Base64 because the padding is wrong (I have marked the quad block
> boundaries above, the required Base64 padding would be "==").
> By using it as an example, Simon must have considered this as allowed,
> but it doesn't match the more strict syntax definition you suggested
> above.

I think the new suggested syntax above deals with that.

<c-lock-string> is indeed different when adding the padding.

$ printf "%s" "aaaBBBcccDDDeeeFFF" | openssl dgst -sha1 -binary | 
openssl enc -base64
bNXHc6ohSmeHaRHHW56BIWZJt+4=

$ printf "%s" "aaaBBBcccDDDeeeFFF==" | openssl dgst -sha1 -binary | 
openssl enc -base64
4oimxobgoBdnD/gubSoXpW5R7J4=



> I prefer to nevertheless switch over to the more strict syntax, but in
> this case I think we should preserve the current syntax for the SHA1
> scheme to ensure backward compatibility. What do you think about this:
> Move the current syntax to section 6 (and bind it to the deprecated SHA1
> scheme) and define the new syntax only for the new SHA2 scheme?

It would complicates the understanding with an <obs-c-key> syntax, 
especially when there is no reason for <c-key-string> to really be a 
Base64 string.
I suggest to have the same ABNF syntax for all schemes.

-- 
Julien ÉLIE

« Le cercle est le plus long chemin d'un point au même point. »
   (Tom Stoppard, _Every Good Boy Deserves Favour_)

Technical Details
Message-ID: <o9sf8o$35n$1@news.trigofacile.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.(19219).mbox.7z!not-for-mail
References: <AABYvbRwKe8AABT3.A1.flnews@WStation5.stz-e.de> <o9pu2k$759$1@news.trigofacile.com> <AABYwYYoBNgAAAJq.A1.flnews@WStation5.stz-e.de>

Show Full Headers
Complete Article Headers
Message-ID: <o9sf8o$35n$1@news.trigofacile.com>
Subject: Re: New draft for Cancel-Lock
Date: Thu, 9 Mar 2017 21:52:55 +0100
From: Julien ÉLIE <iulius@nom-de-mon-site.com.invalid>
References: <AABYvbRwKe8AABT3.A1.flnews@WStation5.stz-e.de> <o9pu2k$759$1@news.trigofacile.com> <AABYwYYoBNgAAAJq.A1.flnews@WStation5.stz-e.de>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.(19219).mbox.7z!not-for-mail
Newsgroups: news.software.nntp
Organization: TrigoFACILE -- http://www.trigofacile.com/
Mime-Version: 1.0
Content-Type: text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 9 Mar 2017 20:51:36 -0000 (UTC)
Injection-Info: news.trigofacile.com; posting-account="julien"; posting-host="2a01cb08012ff800d010b437bffa83ef.ipv6.abo.wanadoo.fr:2a01:cb08:12f:f800:d010:b437:bffa:83ef";
 logging-data="3255"; mail-complaints-to="abuse@trigofacile.com"
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:45.0)
 Gecko/20100101 Thunderbird/45.7.1
In-Reply-To: <AABYwYYoBNgAAAJq.A1.flnews@WStation5.stz-e.de>
X-Received-Bytes: 5055
X-Received-Body-CRC: 2677202680