Article View: news.software.nntp
Article #87820Re: [canlock-hp] Header parsers for RFC 8315
From: Julien ÉLIE
Date: Sat, 19 May 2018 20:21
Date: Sat, 19 May 2018 20:21
77 lines
3979 bytes
3979 bytes
Hi Michael,
> Because NUL control characters are only allowed in comments for the
> header fields defined by RFC 8315 (and canlock-hfp ignores comments),
> this would only be a problem if canlock-mhp is not used for the
> intended purpose.
Note that RFC 3977 (NNTP) does not allow NUL control characters:
A multi-line data block is used in certain commands and responses.
It MUST adhere to the following rules:
1. The block consists of a sequence of zero or more "lines", each
being a stream of octets ending with a CRLF pair. Apart from
those line endings, the stream MUST NOT include the octets NUL,
LF, or CR.
And also:
article = 1*header CRLF body
header = header-name ":" [CRLF] SP header-content CRLF
header-content = *(S-CHAR / [CRLF] WS)
body = *(*B-CHAR CRLF)
S-CHAR = P-CHAR
P-CHAR = A-CHAR / UTF8-non-ascii
A-CHAR = %x21-7E
UTF8-non-ascii = UTF8-2 / UTF8-3 / UTF8-4
UTF8-2 = %xC2-DF UTF8-tail
UTF8-3 = %xE0 %xA0-BF UTF8-tail / %xE1-EC 2UTF8-tail /
%xED %x80-9F UTF8-tail / %xEE-EF 2UTF8-tail
UTF8-4 = %xF0 %x90-BF 2UTF8-tail / %xF1-F3 3UTF8-tail /
%xF4 %x80-8F 2UTF8-tail
UTF8-tail = %x80-BF
B-CHAR = CTRL / TAB / SP / %x21-FF
CTRL = %x01-08 / %x0B-0C / %x0E-1F
And according to RFC 5536 (USEFOR):
The syntax allowed for Netnews
article headers is a strict subset of the Internet Message Format
headers, making all headers compliant with this specification
inherently compliant with [RFC5322]. Note however that the converse
is not guaranteed to be true in all cases.
[...]
o The character set for header fields is US-ASCII. Where the use of
non-ASCII characters is required, they MUST be encoded using the
MIME mechanisms defined in [RFC2047] and [RFC2231].
So, basically, compliant NNTP implementations of RFC 8315 (Cancel-Lock)
do not allow NUL control characters.
> | $ printf "Cancel-kEy: (\134\0)%s\r\n %s\r\n\r\nBody\r\n" "sHa256:XXX==" "(sha224:wxyz)ShA512:aaaBBBcccDDDeeeFFF" | canlock-mhp -f "Cancel-Key" | canlock-hfp
> | sha256:XXX==
> | sha512:aaaBBBcccDDDeeeFFF
>
> "\134\0" is Backslash-NUL in octal representation (obs-qp from [2]).
This is not a valid Cancel-Key header field.
I therefore believe that the canlock-mhp utility does not need strict
compatibility with RFC 5322 (it is OK if your Version 0.0.0 cannot
process NUL control characters).
--
Julien ÉLIE
« Tous les trois mois, les Gaulois paieront les thermes. »
(Aplusbégalix)
Technical Details
Message-ID:
<pdq116$qgo$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-mailReferences:
<AABbAEjfH2MAAA+x.A1.flnews@Server4.micha.freeshell.org>Show Full Headers
Complete Article Headers
Message-ID: <pdq116$qgo$1@news.trigofacile.com> Subject: Re: [canlock-hp] Header parsers for RFC 8315 Date: Sat, 19 May 2018 22:21:53 +0200 From: Julien ÉLIE <iulius@nom-de-mon-site.com.invalid> References: <AABbAEjfH2MAAA+x.A1.flnews@Server4.micha.freeshell.org> 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=utf-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Sat, 19 May 2018 20:21:58 -0000 (UTC) Injection-Info: news.trigofacile.com; posting-account="julien"; posting-host="2a01cb0800a775008502187f447a8c09.ipv6.abo.wanadoo.fr:2a01:cb08:a7:7500:8502:187f:447a:8c09"; logging-data="27160"; mail-complaints-to="abuse@trigofacile.com" User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 In-Reply-To: <AABbAEjfH2MAAA+x.A1.flnews@Server4.micha.freeshell.org> Content-Language: fr X-Received-Bytes: 4025 X-Received-Body-CRC: 1804106901