Article View: news.software.nntp
Article #87821Re: [canlock-hp] Header parsers for RFC 8315
From: Michael Bäuerle
Date: Sun, 20 May 2018 09:26
Date: Sun, 20 May 2018 09:26
67 lines
3762 bytes
3762 bytes
Julien ÉLIE wrote: > Michael Bäuerle wrote: > > > > 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. > [...] I have not checked against RFC 3977 because the parser should not depend on the transport protocol, only on the content. > 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]. Because NUL is an US-ASCII character, in the sense of RFC 20, I think this is not the reason that makes it noncompliant. But this paragraph from Section 2: | | An article that uses the obsolete syntax specified in Section 4 of | [RFC5322] is NOT conformant to this specification, except for the | following two cases: | [No exception for NUL] > So, basically, compliant NNTP implementations of RFC 8315 (Cancel-Lock) > do not allow NUL control characters. Agreed. > > | $ 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. But only because of <obs-qp>, the non-Base64 data should match on <obs-c-key-string>. Or do you mean something else? > 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). I should redefine canlock-mhp to only be an RFC 5536 parser, to reduce its scope to news articles.
Technical Details
Message-ID:
<AABbAT9dFv0AAAt+.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-mailReferences:
<AABbAEjfH2MAAA+x.A1.flnews@Server4.micha.freeshell.org> <pdq116$qgo$1@news.trigofacile.com>Show Full Headers
Complete Article Headers
Message-ID: <AABbAT9dFv0AAAt+.A1.flnews@Server4.micha.freeshell.org> Subject: Re: [canlock-hp] Header parsers for RFC 8315 Date: Sun, 20 May 2018 09:26:53 -0000 From: Michael Bäuerle <michael.baeuerle@gmx.net> References: <AABbAEjfH2MAAA+x.A1.flnews@Server4.micha.freeshell.org> <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-mail Newsgroups: news.software.nntp Lines: 65 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=fixed Content-Transfer-Encoding: 8bit X-Trace: individual.net weLD3IfI9krFDQGtT0edNAn01Hyh6iwc+HoNGnEadmwc3fh/cp X-Orig-Path: not-for-mail Cancel-Lock: sha256:QLlJBYpu3gEVtHfMTxnlIM4zbUb1uxDbMH2FlASzSkc= sha1:Eg4Dlez6Tmhm1AESjTQOUm82aUg= Injection-Date: Sun, 20 May 2018 09:26:53 -0000 User-Agent: flnews/0.15 (for HP-UX) X-Received-Bytes: 3653 X-Received-Body-CRC: 1907268493