🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
72 messages
72 total messages Page 1 of 2 Started by Julien ÉLIE Tue, 13 Oct 2015 20:21
Page 1 of 2 • 72 total messages
About compression with NNTP
#87065
Author: Julien ÉLIE
Date: Tue, 13 Oct 2015 20:21
46 lines
2824 bytes
Hi all,

TLS is currently used for several purposes in NNTP, as the abstract of 
RFC 4642 recalls:

    The primary goal is to provide encryption for
    single-link confidentiality purposes, but data integrity, (optional)
    certificate-based peer entity authentication, and (optional) data
    compression are also possible.


The next version of TLS (1.3) will remove support for compression.  A 
huge thread of more than a thousand messages has just been held in the 
TLS IETF working group.  The chairs agreed to remove compression from 
TLS 1.3:
     https://www.ietf.org/mail-archive/web/tls/current/msg17941.html

Basically, it is not the role of a security layer to provide a facility 
(compression) that is known to cause security issues (CRIME attack for 
instance).
If compression with TLS is wanted for NNTP, then clients and servers 
will have to use TLS 1.2 (or more ancient).


Anyway, as compression is not always available (TLS implementations may 
disable it, even with version 1.2) and as one day TLS 1.2 will probably 
be considered not secure enough, NNTP will no longer benefit from the 
compression facility provided by TLS.


So the question is:  are there news clients willing to implement the 
COMPRESS command described in Ken's draft?
     http://tools.ietf.org/id/draft-murchison-nntp-compress-01.html

If there are, then I can consider having a look to implement it in INN.
And probably afterwards we can try to get a revision of Ken's draft 
published as RFC.

-- 
Julien ÉLIE

« Les femmes seront les égales des hommes le jour où elles
   accepteront d'être chauves et de trouver que cela distingue. »
   (Coluche)

Re: About compression with NNTP
#87067
Author: Michael Baeuerle
Date: Wed, 14 Oct 2015 10:16
35 lines
2391 bytes
Julien ÉLIE wrote:
> 
> [Compression dropped in TLS 1.3]
> Anyway, as compression is not always available (TLS implementations may 
> disable it, even with version 1.2) and as one day TLS 1.2 will probably 
> be considered not secure enough, NNTP will no longer benefit from the 
> compression facility provided by TLS.
> 
> 
> So the question is:  are there news clients willing to implement the 
> COMPRESS command described in Ken's draft?
>     http://tools.ietf.org/id/draft-murchison-nntp-compress-01.html

Yes.
 
> If there are, then I can consider having a look to implement it in INN.
> And probably afterwards we can try to get a revision of Ken's draft 
> published as RFC.

+1 from me for implementing it.


Current situation for flnews is:
- STARTTLS is not supported yet, but NNTPS (for encryption)
- AUTHINFO is implemented (for authentication)
It is therefore currently not possible to enable compression after
authentication and the compression is always negotiated to "null".

With the COMPRESS extension it would be possible to open the NNTPS
connection (with compression disabled), then execute AUTHINFO and
finally execute COMPRESS. In this case the authentication step is not
compressed and cannot suffer from any potential encryption vulerability
that is based on the compression.

Re: About compression with NNTP
#87070
Author: Julien ÉLIE
Date: Wed, 14 Oct 2015 19:31
79 lines
3944 bytes
Hi Michael,

>> So the question is:  are there news clients willing to implement the
>> COMPRESS command described in Ken's draft?
>>      http://tools.ietf.org/id/draft-murchison-nntp-compress-01.html
>
> Yes.
>
>> If there are, then I can consider having a look to implement it in INN.
>> And probably afterwards we can try to get a revision of Ken's draft
>> published as RFC.
>
> +1 from me for implementing it.

I received a private comment highlighting the fact that the COMPRESS 
command, as described in that draft, is not necessarily straight-forward 
to implement in all existing software.  The reason is that the mandatory 
use of deflate() from zlib implies that NNTP software can cope with 
0-bytes in the stream.  Which is not always the case.

Another idea would be to do what a few software have already implemented 
regarding compression:  the XZVER and XZHDR commands, using yEnc 
compression.
     http://helpdesk.astraweb.com/index.php?_m=news&_a=viewnews&newsid=9


Well, maybe we could be more generic and allow the use of compression 
for any multi-line data blocks?

A suggestion could be that a client asks for the compression of the 
result of a few commands.  For instance, a client may ask that OVER 
answers are compressed with yEnc and LIST answers with deflate.  It 
could send the following two commands:

STARTCOMPRESSION OVER YENC
STARTCOMPRESSION LIST DEFLATE

The server will respond with the appropriate response codes, and then 
compress the answers to LIST and OVER commands accordingly.

Note that the name of STARTCOMPRESSION is chosen out of homogeneity with 
STARTTLS.

A client may also ask to send compressed data itself.  For instance with:

STARTCOMPRESSION POST YENC
STARTCOMPRESSION TAKETHIS YENC
(the latter being useful for peers)




The server advertises the STARTCOMPRESSION capability followed with the 
compression methods it can use, as keywords of the capability.


Any thoughts about that?
Wouldn't it be an alternative that would be adopted more easily than 
COMPRESS?



> With the COMPRESS extension it would be possible to open the NNTPS
> connection (with compression disabled), then execute AUTHINFO and
> finally execute COMPRESS. In this case the authentication step is not
> compressed and cannot suffer from any potential encryption vulerability
> that is based on the compression.

That's indeed the common scenario that the command would solve: 
enabling compression only after authentication.

-- 
Julien ÉLIE

« – Essayons d'interroger ce garde habilement sans éveiller ses
     soupçons…
   – Hep ! Où est enfermé Assurancetourix ? » (Astérix)

Re: About compression with NNTP
#87071
Author: Julien ÉLIE
Date: Wed, 14 Oct 2015 19:58
27 lines
1988 bytes
Going farther in the idea...

> Wouldn't it be an alternative that would be adopted more easily than
> COMPRESS?

We could even support the two cases with "STARTCOMPRESSION method 
[command(s)]".  Examples:

STARTCOMPRESSION DEFLATE
without a third argument would do what Ken's draft specifies.

STARTCOMPRESSION DEFLATE OVER
would only compress with deflate() the responses to all subsequent OVER 
commands.

STARTCOMPRESSION YENC HDR LIST OVER
would only compress with yEnC the responses to all subsequent HDR, LIST 
and OVER commands.

-- 
Julien ÉLIE

« – Essayons d'interroger ce garde habilement sans éveiller ses
     soupçons…
   – Hep ! Où est enfermé Assurancetourix ? » (Astérix)

Re: About compression with NNTP
#87072
Author: Russ Allbery
Date: Wed, 14 Oct 2015 20:49
45 lines
3299 bytes
Julien ÉLIE <iulius@nom-de-mon-site.com.invalid> writes:

> I received a private comment highlighting the fact that the COMPRESS
> command, as described in that draft, is not necessarily straight-forward
> to implement in all existing software.  The reason is that the mandatory
> use of deflate() from zlib implies that NNTP software can cope with
> 0-bytes in the stream.  Which is not always the case.

But that's also true of STARTTLS.

I think there may be some confusion here.  The point of COMPRESS as an
NNTP extension is to act as a transport layer, similar to STARTTLS or a
SASL confidentiality layer.  This makes it much easier to implement in the
same way that SSL support is easier to implement: you need only worry
about compression and decompression in your network code, when putting
bits on the wire or taking them off.  No command implementation has to
care, since by the time the bits have exited the transport layer,
everything is the plain-text protocol that the rest of the software is
expecting.

The approach that you describe, with compression implemented separately in
each command, is therefore quite a bit more complex.  Rather than having a
simple on-off at the network level such as with STARTTLS, each command now
has to be aware of the compression status and separately compress its own
data (but not the rest of the stream).

Nul octets are also a bit of a red herring for the same reason.  The whole
point of transport layers is that the rest of the software is unaffected
and won't see any nul octets.  Implementing COMPRESS is no harder than
implementing STARTTLS, which also introduces nul octets in the wire
representation, but not in the protocol as seen by the rest of the
implementation.

It should therefore be no harder to implement COMPRESS in an
implementation that can't handle nul octets than in one that can.  In both
cases, COMPRESS happens in the low-level guts of the network code, and the
rest of the software should be able to ignore its presence.

-- 
Russ Allbery (eagle@eyrie.org)              <http://www.eyrie.org/~eagle/>

          Please post questions rather than mailing me directly.
     <http://www.eyrie.org/~eagle/faqs/questions.html> explains why.

Re: About compression with NNTP
#87074
Author: Michael Baeuerle
Date: Thu, 15 Oct 2015 16:44
31 lines
2596 bytes
Russ Allbery wrote:
> Julien ÉLIE <iulius@nom-de-mon-site.com.invalid> writes:
> > 
> > I received a private comment highlighting the fact that the COMPRESS
> > command, as described in that draft, is not necessarily straight-forward
> > to implement in all existing software.  The reason is that the mandatory
> > use of deflate() from zlib implies that NNTP software can cope with
> > 0-bytes in the stream.  Which is not always the case.
> 
> But that's also true of STARTTLS.
> [...]
> It should therefore be no harder to implement COMPRESS in an
> implementation that can't handle nul octets than in one that can.  In both
> cases, COMPRESS happens in the low-level guts of the network code, and the
> rest of the software should be able to ignore its presence.

And this simplicity is what looks nice. The feature can be added without
rewriting larger parts of the agent.

Comment to the algorithm list:
That one or more compression algorithms are mandatory (like DEFLATE in
the draft) is not really necessary. Why should it be forbidden for a
server to advertise something like "COMPRESS LZMA" or anything else it
consider useful (without DEFLATE in the list)?
If the other end of the connection don't support the advertised
algorithm(s), the data transfers would be uncompressed - as with no
COMPRESS capability.
As long as the COMPRESS capability itself is optional, all compression
algorithms can be optional too.

Re: About compression with NNTP
#87075
Author: Russ Allbery
Date: Thu, 15 Oct 2015 18:31
23 lines
2051 bytes
Michael Baeuerle <michael.baeuerle@stz-e.de> writes:

> Comment to the algorithm list:

> That one or more compression algorithms are mandatory (like DEFLATE in
> the draft) is not really necessary. Why should it be forbidden for a
> server to advertise something like "COMPRESS LZMA" or anything else it
> consider useful (without DEFLATE in the list)?

Mandatory-to-implement algorithms are an IETF requirement so that two
implementations of the protocol have at least one interoperable algorithm
they can fall back on.  Generally, one picks something pretty simple to
implement that provides most of the benefits of the protocol, which
DEFLATE qualifies for in this case.  (Libraries that implement the
algorithm are very widely available.)

-- 
Russ Allbery (eagle@eyrie.org)              <http://www.eyrie.org/~eagle/>

          Please post questions rather than mailing me directly.
     <http://www.eyrie.org/~eagle/faqs/questions.html> explains why.

Re: About compression with NNTP
#87078
Author: Julien ÉLIE
Date: Fri, 16 Oct 2015 20:07
47 lines
3132 bytes
Hi Michael,

> Comment to the algorithm list:
> That one or more compression algorithms are mandatory (like DEFLATE in
> the draft) is not really necessary.  Why should it be forbidden for a
> server to advertise something like "COMPRESS LZMA" or anything else it
> consider useful (without DEFLATE in the list)?

See Russ's answer about why DEFLATE is mandatory.

If we implement COMPRESS, I believe we should add at the same time other 
methods like LZMA or LZMA2 in the IANA registry.  See Ken's thoughts in 
2010, before the CRIME attack, so they should be reconsidered:

     http://lists.eyrie.org/pipermail/ietf-nntp/2010-January/006157.html

%%%
 >> In order to increase interoperability, it is desirable to have as few
 >> different compression algorithms as possible, so this document
 >> specifies only one.
 >
 > Why couldn't we define several algorithms (some are more efficient
 > than DEFLATE, for instance LZMA or LZMA2) and say that DEFLATE *MUST*
 > be implemented when COMPRESS is implemented?

Well, IMAP/NNTP COMPRESS are really just stop-gaps until existing TLS
implementations support compression.  As mentioned in the text TLS
really should be the preferred way to negotiate compression.  So
I don't see the need to add more algorithms to NNTP COMPRESS.
%%%



I also note that he said that currently, no SASL mechanism negotiates a 
compression layer.  What if, in the future, there exists one?
Maybe we should prohibit the use of AUTHINFO (even USER/PASS) after a 
successful use of COMPRESS.  That prohibition is not present in the 
Internet-Draft.

-- 
Julien ÉLIE

« – Essayons d'interroger ce garde habilement sans éveiller ses
     soupçons…
   – Hep ! Où est enfermé Assurancetourix ? » (Astérix)

Re: About compression with NNTP
#87080
Author: Julien ÉLIE
Date: Fri, 16 Oct 2015 20:22
61 lines
3950 bytes
Hi Russ,

>> I received a private comment highlighting the fact that the COMPRESS
>> command, as described in that draft, is not necessarily straight-forward
>> to implement in all existing software.  The reason is that the mandatory
>> use of deflate() from zlib implies that NNTP software can cope with
>> 0-bytes in the stream.  Which is not always the case.
>
> But that's also true of STARTTLS.
>
> I think there may be some confusion here.  The point of COMPRESS as an
> NNTP extension is to act as a transport layer, similar to STARTTLS or a
> SASL confidentiality layer.  This makes it much easier to implement in the
> same way that SSL support is easier to implement: you need only worry
> about compression and decompression in your network code, when putting
> bits on the wire or taking them off.  No command implementation has to
> care, since by the time the bits have exited the transport layer,
> everything is the plain-text protocol that the rest of the software is
> expecting.

As far as I understand, the issue is for news software still using 
fputs()/fgets() instead of read()/write() on sockets.  Adding support 
for either TLS or compression is not that easy for them.



> The approach that you describe, with compression implemented separately in
> each command, is therefore quite a bit more complex.  Rather than having a
> simple on-off at the network level such as with STARTTLS, each command now
> has to be aware of the compression status and separately compress its own
> data (but not the rest of the stream).

Yet, in order to improve compression efficiency, shouldn't a few 
commands be aware of the compression status anyway?
Ken's draft suggests that the compression dictionary be clear when 
switching from article headers to article body text, notably when 
containing attachments in Base64 or UUencode form for instance.

Well, such an integration in NNTP commands is easy, though, as we just 
need to call the relevant function if compression is active.



More general questions:

- Should we keep the COMPRESS name, or switch to something like 
STARTCOMPRESSION?  (to keep the semantics of the existing STARTTLS command)

- Should we keep the suggested 291 response code instead of re-using the 
(never standardized) 207 response code implemented in NNTPRelay and 
Diablo?  They implement the MODE COMPRESS command, that answers 207:
     http://sedore.com/nntprelay/compressed-nntp-not.htm

-- 
Julien ÉLIE

« – Essayons d'interroger ce garde habilement sans éveiller ses
     soupçons…
   – Hep ! Où est enfermé Assurancetourix ? » (Astérix)

Re: About compression with NNTP
#87084
Author: Michael Baeuerle
Date: Sat, 17 Oct 2015 11:04
48 lines
3151 bytes
Julien ÉLIE wrote:
> Michael Bäuerle wrote:
> > 
> > Comment to the algorithm list:
> > That one or more compression algorithms are mandatory (like DEFLATE in
> > the draft) is not really necessary.  Why should it be forbidden for a
> > server to advertise something like "COMPRESS LZMA" or anything else it
> > consider useful (without DEFLATE in the list)?
> 
> See Russ's answer about why DEFLATE is mandatory.

If there must be a mandatory default algorithm, DEFLATE would be a good
choice.

> If we implement COMPRESS, I believe we should add at the same time 
> other methods like LZMA or LZMA2 in the IANA registry.  See Ken's 
> thoughts in 2010, before the CRIME attack, so they should be 
> reconsidered:
> 
>     http://lists.eyrie.org/pipermail/ietf-nntp/2010-January/006157.html

Yes.

If the security of the TLS layer has highest priority (for all data, not
only authentication), maybe no compression at all should be negotiated
by the user. But for most users only the authentication really needs the
security from TLS and for the rest of the session a better performance
would be worth to potentially weaken it.

> [...] 
> I also note that he said that currently, no SASL mechanism negotiates a 
> compression layer.  What if, in the future, there exists one?
> Maybe we should prohibit the use of AUTHINFO (even USER/PASS) after a 
> successful use of COMPRESS.  That prohibition is not present in the 
> Internet-Draft.

COMPRESS could remove AUTHINFO from the capability list.

But if the server has different content for authenticated users, there
is no way to access it after COMPRESS was executed in non-authenticated
mode. 
-- 
Sorry, aber mit der Einstellung würden wir heute aus Sicherheitsgründen
noch auf dem Baum sitzen. Wer etwas Neues schaffen will, muß auch was
wagen - aber da heute Kinder schon zu Fuß mit Helm rumlaufen gilt das
wohl nicht mehr...                     [Eric Brücklmeier in dse]

Re: About compression with NNTP
#87083
Author: Michael Baeuerle
Date: Sat, 17 Oct 2015 11:23
25 lines
2283 bytes
Julien ÉLIE wrote:
>  
> - Should we keep the COMPRESS name, or switch to something like 
> STARTCOMPRESSION?  (to keep the semantics of the existing STARTTLS 
> command)

I think COMPRESS is OK because the negotiation is already done at
execution time (The capability list advertises the algorithms and then
one is activated with e.g. "COMPRESS DEFLATE" directly). Therefore the
command normally should never fail.

For STARTTLS things are different. This command _start_ a negotiation
and it is unknown at execution time whether there are common algorithms
supported by both ends.
Yes - there are the mandatory algorithms noted by Russ, but they are
insecure in different ways. I have modified my implementation to break
the RFCs by intent (User have to specify "weak" to get the RFC compliant
behaviour). I think other implementations do the same.
-- 
Sorry, aber mit der Einstellung würden wir heute aus Sicherheitsgründen
noch auf dem Baum sitzen. Wer etwas Neues schaffen will, muß auch was
wagen - aber da heute Kinder schon zu Fuß mit Helm rumlaufen gilt das
wohl nicht mehr...                     [Eric Brücklmeier in dse]

Re: About compression with NNTP
#87082
Author: Julien ÉLIE
Date: Sun, 18 Oct 2015 18:26
35 lines
2694 bytes
Hi Michael,

>> Maybe we should prohibit the use of AUTHINFO (even USER/PASS) after a
>> successful use of COMPRESS.  That prohibition is not present in the
>> Internet-Draft.
>
> COMPRESS could remove AUTHINFO from the capability list.
>
> But if the server has different content for authenticated users, there
> is no way to access it after COMPRESS was executed in non-authenticated
> mode.

Yes, in the same way a user cannot authenticate after STARTTLS, whereas 
he could have different content.
Usually, the "first" thing a user will do is authenticate himself.

I think a reasonable pattern for news clients is:
1/ send CAPABILITIES
2/ if not in reader mode, send MODE READER, and then CAPABILITIES again
3/ if available, send STARTTLS, and then CAPABILITIES again
5/ use AUTHINFO to authenticate, if wanted, and then CAPABILITIES again
6/ if available, send COMPRESS

Hmm, CAPABILITIES is sent several times.  I believe it should because 
the available facilities may change (AUTHINFO USER advertised only after 
STARTTLS for instance).

-- 
Julien ÉLIE

« – Essayons d'interroger ce garde habilement sans éveiller ses
     soupçons…
   – Hep ! Où est enfermé Assurancetourix ? » (Astérix)

Re: About compression with NNTP
#87086
Author: Julien ÉLIE
Date: Sun, 18 Oct 2015 18:29
33 lines
2570 bytes
Hi Michael,

>> - Should we keep the COMPRESS name, or switch to something like
>> STARTCOMPRESSION?  (to keep the semantics of the existing STARTTLS
>> command)
>
> I think COMPRESS is OK because the negotiation is already done at
> execution time (The capability list advertises the algorithms and then
> one is activated with e.g. "COMPRESS DEFLATE" directly). Therefore the
> command normally should never fail.
>
> For STARTTLS things are different. This command _start_ a negotiation
> and it is unknown at execution time whether there are common algorithms
> supported by both ends.

OK, you've convinced me for the name of the COMPRESS command.


> Yes - there are the mandatory algorithms noted by Russ, but they are
> insecure in different ways. I have modified my implementation to break
> the RFCs by intent (User have to specify "weak" to get the RFC compliant
> behaviour). I think other implementations do the same.

Do you speak about RC4 ciphers for TLS?

-- 
Julien ÉLIE

« – Essayons d'interroger ce garde habilement sans éveiller ses
     soupçons…
   – Hep ! Où est enfermé Assurancetourix ? » (Astérix)

Re: About compression with NNTP
#87088
Author: Michael Baeuerle
Date: Mon, 19 Oct 2015 10:03
50 lines
3436 bytes
Julien ÉLIE wrote:
> Michael Bäuerle wrote:
> > Julien ÉLIE wrote:
> > > 
> > > Maybe we should prohibit the use of AUTHINFO (even USER/PASS) after a
> > > successful use of COMPRESS.  That prohibition is not present in the
> > > Internet-Draft.
> > 
> > COMPRESS could remove AUTHINFO from the capability list.
> > 
> > But if the server has different content for authenticated users, there
> > is no way to access it after COMPRESS was executed in non-authenticated
> > mode.
> 
> Yes, in the same way a user cannot authenticate after STARTTLS, whereas 
> he could have different content.
> Usually, the "first" thing a user will do is authenticate himself.
> 
> I think a reasonable pattern for news clients is:
> 1/ send CAPABILITIES
> 2/ if not in reader mode, send MODE READER, and then CAPABILITIES again
> 3/ if available, send STARTTLS, and then CAPABILITIES again
> 5/ use AUTHINFO to authenticate, if wanted, and then CAPABILITIES again
> 6/ if available, send COMPRESS
> 
> Hmm, CAPABILITIES is sent several times.  I believe it should because 
> the available facilities may change (AUTHINFO USER advertised only 
> after STARTTLS for instance).

Yes. This is what RFC3977 already specify:
| 
| [CAPABILITES]
| Furthermore, a client MUST NOT use cached results in relation to
| security, privacy, and authentication extensions.

If we define it as a potential privacy problem to do authentication
over a compressed TLS connection, this matches STARTTLS, AUTHINFO and
COMPRESS. The capabilities must then be refreshed before all of them.

Some time ago we had the discussion here when to do AUTHINFO. I had
modified flnews to execute AUTHINFO as soon as possible (will be the
default in version 0.11 that is nearly finished now).

But the current RFCs allow AUTHINFO after 480 at any time. Therefore
the potential new RFC for COMPRESS maybe should forbid the wrong order
explicitly. Something like "MUST NOT execute AUTHINFO after COMPRESS".
Removing the corresponding AUTHINFO capability would then be in sync
(forbidden even with cached capabilities).

Re: About compression with NNTP
#87087
Author: Michael Baeuerle
Date: Mon, 19 Oct 2015 11:02
45 lines
2982 bytes
Julien ÉLIE wrote:
> Michael Bäuerle wrote:
> > 
> > Yes - there are the mandatory algorithms noted by Russ, but they are
> > insecure in different ways. I have modified my implementation to break
> > the RFCs by intent (User have to specify "weak" to get the RFC compliant
> > behaviour). I think other implementations do the same.
> 
> Do you speak about RC4 ciphers for TLS?

Not only RC4.

RFC4642 specify for NNTP:
| 
| NNTP client and server implementations MUST implement the
| TLS_RSA_WITH_RC4_128_MD5 [TLS] cipher suite and SHOULD implement the
| TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA [TLS] cipher suite.

and RFC5246 specify for TLSv1.2 in general:
| 
| TLS_RSA_WITH_AES_128_CBC_SHA is now the mandatory to implement
| cipher suite

Together the result is:
------------------------------------------------------------------------
TLS_RSA_WITH_AES_128_CBC_SHA       (mandatory)
TLS_RSA_WITH_RC4_128_MD5           (mandatory)
TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA  (recommended)
------------------------------------------------------------------------

flnews offer none of them by default because:
- The first and the second provide no forward secrecy
- The second one because RC4 cipher is weak
- The third one because of DSA key
  (for authentication and signatures of DHE key exchange)

According to <http://coyotus.com/repo/pdf/openssl-cookbook.pdf>
weak DSA keys are common because MS Windows don't support more than
1024 bit (AFAIK this was the limit of the original DSS definition).

So the third one maybe OK with sufficient DSA key length. But the first
and the second should be considered obsolete (and are likely to be
forbidden with the future TLSv1.3).

Re: About compression with NNTP
#87090
Author: Julien ÉLIE
Date: Mon, 19 Oct 2015 20:25
48 lines
2886 bytes
Hi Michael,

> But the current RFCs allow AUTHINFO after 480 at any time. Therefore
> the potential new RFC for COMPRESS maybe should forbid the wrong order
> explicitly. Something like "MUST NOT execute AUTHINFO after COMPRESS".
> Removing the corresponding AUTHINFO capability would then be in sync
> (forbidden even with cached capabilities).

Adding such wording would indeed be useful.  Wouldn't SHOULD NOT be 
better, though?

An example already shows that behaviour in Ken's draft:

[C] CAPABILITIES
[S] 101 Capability list:
[S] VERSION 2
[S] READER
[S] STARTTLS
[S] AUTHINFO
[S] COMPRESS DEFLATE
[S] .
[C] STARTTLS
[S] 382 Continue with TLS negotiation
[TLS negotiation without compression occurs here]
[Following successful negotiation, all traffic is encrypted]
[C] CAPABILITIES
[S] 101 Capability list:
[S] VERSION 2
[S] READER
[S] AUTHINFO USER
[S] COMPRESS DEFLATE
[S] .
[C] AUTHINFO USER fred
[S] 381 Enter passphrase
[C] AUTHINFO PASS flintstone
[S] 281 Authentication accepted
[C] COMPRESS DEFLATE
[S] 291 Compression active
[From this point on, all traffic is compresssed before being encrypted]

-- 
Julien ÉLIE

« Je vais t'apprendre à chasser… Nous commencerons par les
   marcassins, et puis ensuite, nous passerons aux patrouilles romaines,
   et enfin aux sangliers ! » (Astérix)

Re: About compression with NNTP
#87092
Author: Russ Allbery
Date: Mon, 19 Oct 2015 21:05
26 lines
2091 bytes
Michael Baeuerle <michael.baeuerle@stz-e.de> writes:

> Not only RC4.

> RFC4642 specify for NNTP:
> | 
> | NNTP client and server implementations MUST implement the
> | TLS_RSA_WITH_RC4_128_MD5 [TLS] cipher suite and SHOULD implement the
> | TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA [TLS] cipher suite.

> and RFC5246 specify for TLSv1.2 in general:
> | 
> | TLS_RSA_WITH_AES_128_CBC_SHA is now the mandatory to implement
> | cipher suite

This really needs a refresh of that RFC with modern crypto standards.  I'm
sure there's some precedent by now in the standards for other protocols
that do STARTTLS for new mandatory algorithms that aren't that weak.

-- 
Russ Allbery (eagle@eyrie.org)              <http://www.eyrie.org/~eagle/>

          Please post questions rather than mailing me directly.
     <http://www.eyrie.org/~eagle/faqs/questions.html> explains why.

Re: About compression with NNTP
#87093
Author: Russ Allbery
Date: Mon, 19 Oct 2015 21:07
36 lines
2724 bytes
Julien ÉLIE <iulius@nom-de-mon-site.com.invalid> writes:

> As far as I understand, the issue is for news software still using
> fputs()/fgets() instead of read()/write() on sockets.  Adding support
> for either TLS or compression is not that easy for them.

Ah, indeed, that's true, although it can probably be addressed by
replacing fputs/fgets with wrappers that expose the same API but use
read/write under the hood and understand layers.  It's a large mechanical
change to change the existing calls to use the wrappers, but it should be
doable, since the buffered I/O API is pretty standard and pretty simple to
implement on top of something else.

> Yet, in order to improve compression efficiency, shouldn't a few
> commands be aware of the compression status anyway?  Ken's draft
> suggests that the compression dictionary be clear when switching from
> article headers to article body text, notably when containing
> attachments in Base64 or UUencode form for instance.

Ah, hm, that's a good point.

> - Should we keep the suggested 291 response code instead of re-using the
> (never standardized) 207 response code implemented in NNTPRelay and
> Diablo?  They implement the MODE COMPRESS command, that answers 207:
>     http://sedore.com/nntprelay/compressed-nntp-not.htm

Is it protocol-compatible with the proposed draft other than with the
reply code?

-- 
Russ Allbery (eagle@eyrie.org)              <http://www.eyrie.org/~eagle/>

          Please post questions rather than mailing me directly.
     <http://www.eyrie.org/~eagle/faqs/questions.html> explains why.

Re: About compression with NNTP
#87096
Author: Michael Baeuerle
Date: Tue, 20 Oct 2015 08:17
19 lines
1848 bytes
Russ Allbery wrote:
> Julien ÉLIE <iulius@nom-de-mon-site.com.invalid> writes:
> > 
> > - Should we keep the suggested 291 response code instead of re-using the
> > (never standardized) 207 response code implemented in NNTPRelay and
> > Diablo?  They implement the MODE COMPRESS command, that answers 207:
> >     http://sedore.com/nntprelay/compressed-nntp-not.htm
> 
> Is it protocol-compatible with the proposed draft other than with the
> reply code?

RFC3977 specify:
| 
| x9x - Reserved for private use (non-standard extensions)

Looks like 291 would not be the right code if COMPRESS becomes an
official standard.

Re: About compression with NNTP
#87098
Author: Michael Baeuerle
Date: Tue, 20 Oct 2015 09:59
17 lines
2112 bytes
Julien ÉLIE wrote:
> Michael Bäuerle wrote:
> > 
> > But the current RFCs allow AUTHINFO after 480 at any time. Therefore
> > the potential new RFC for COMPRESS maybe should forbid the wrong order
> > explicitly. Something like "MUST NOT execute AUTHINFO after COMPRESS".
> > Removing the corresponding AUTHINFO capability would then be in sync
> > (forbidden even with cached capabilities).
> 
> Adding such wording would indeed be useful.  Wouldn't SHOULD NOT be 
> better, though?

In this case the reason why it should not be done isn't obvious. If we
think that it is a potential security problem to use AUTHINFO over a
compressed connection, this should at least be noted in the text.

Re: About compression with NNTP
#87099
Author: Julien ÉLIE
Date: Tue, 20 Oct 2015 20:29
38 lines
2960 bytes
Hi Russ,

>> RFC4642
>
> This really needs a refresh of that RFC with modern crypto standards.  I'm
> sure there's some precedent by now in the standards for other protocols
> that do STARTTLS for new mandatory algorithms that aren't that weak.

I still haven't reported in the NNTP IETF mailing-list the outcome of a 
thread I had last month in the TLS IETF mailing-list about that subject.

The good news is that Stephen Farrell, an IETF/IESG chairman, is willing 
to shepherd us on refreshing RFC 4642.  We have to decide the best move 
to do between a new RFC that obsoletes RFC 4642 or a short RFC that 
updates RFC 4242.
     http://www.ietf.org/mail-archive/web/tls/current/msg17562.html

We should first contact the UTA WG (Using TLS in Applications) to get 
possible advice from them.

An idea is that we could refer to RFC 7525 (Recommendations for Secure 
Use of Transport Layer Security (TLS) and Datagram Transport Layer 
Security (DTLS)), that is a Best Current Practice:
     https://tools.ietf.org/html/bcp195


P.-S.:  Rich Salz also suggested that NNTP just uses the UTA 
specifications, and that it's been awhile since he "dabbled" in NNTP :)
     http://www.ietf.org/mail-archive/web/tls/current/msg17543.html

-- 
Julien ÉLIE

« Je vais t'apprendre à chasser… Nous commencerons par les
   marcassins, et puis ensuite, nous passerons aux patrouilles romaines,
   et enfin aux sangliers ! » (Astérix)

Re: About compression with NNTP
#87101
Author: Julien ÉLIE
Date: Tue, 20 Oct 2015 20:30
25 lines
2569 bytes
Hi Michael,

>>> But the current RFCs allow AUTHINFO after 480 at any time. Therefore
>>> the potential new RFC for COMPRESS maybe should forbid the wrong order
>>> explicitly. Something like "MUST NOT execute AUTHINFO after COMPRESS".
>>> Removing the corresponding AUTHINFO capability would then be in sync
>>> (forbidden even with cached capabilities).
>>
>> Adding such wording would indeed be useful.  Wouldn't SHOULD NOT be
>> better, though?
>
> In this case the reason why it should not be done isn't obvious. If we
> think that it is a potential security problem to use AUTHINFO over a
> compressed connection, this should at least be noted in the text.

Yep, the reason for the SHOULD NOT has to be explained in the sentence.

-- 
Julien ÉLIE

« Je vais t'apprendre à chasser… Nous commencerons par les
   marcassins, et puis ensuite, nous passerons aux patrouilles romaines,
   et enfin aux sangliers ! » (Astérix)

Re: About compression with NNTP
#87103
Author: Julien ÉLIE
Date: Tue, 20 Oct 2015 20:48
33 lines
2262 bytes
Hi Russ,

>> - Should we keep the suggested 291 response code instead of re-using the
>> (never standardized) 207 response code implemented in NNTPRelay and
>> Diablo?  They implement the MODE COMPRESS command, that answers 207:
>>      http://sedore.com/nntprelay/compressed-nntp-not.htm
>
> Is it protocol-compatible with the proposed draft other than with the
> reply code?

No, it is not protocol-compatible.
It was intended for feeds.

[C] MODE COMPRESS
[S] 207 compression enabled
[C*] CHECK <a@b>
[S] 238 <a@b>
[C*] TAKETHIS <a@b>
[C*] (...article...CRLF.CRLF)
[S] 239 OK

Only [C*] are compressed.  Server responses are never compressed with 
MODE COMPRESS.
So it probably means that we should take another response code than 
207...  Perhaps 206?  Or 250?

-- 
Julien ÉLIE

« La vérité pure et simple est très rarement pure et jamais
   simple. » (Oscar Wilde)

Re: About compression with NNTP
#87104
Author: Russ Allbery
Date: Tue, 20 Oct 2015 20:59
24 lines
2275 bytes
Julien ÉLIE <iulius@nom-de-mon-site.com.invalid> writes:

> An idea is that we could refer to RFC 7525 (Recommendations for Secure Use
> of Transport Layer Security (TLS) and Datagram Transport Layer Security
> (DTLS)), that is a Best Current Practice:
>     https://tools.ietf.org/html/bcp195

Yup, that looks like exactly what we want.

> P.-S.:  Rich Salz also suggested that NNTP just uses the UTA
> specifications, and that it's been awhile since he "dabbled" in NNTP :)
>     http://www.ietf.org/mail-archive/web/tls/current/msg17543.html

I still find it entertaining that both Rich and I "started" on NNTP
software and are now both security people and mostly work on security
software rather than messaging.  :)

-- 
Russ Allbery (eagle@eyrie.org)              <http://www.eyrie.org/~eagle/>

          Please post questions rather than mailing me directly.
     <http://www.eyrie.org/~eagle/faqs/questions.html> explains why.

Re: About compression with NNTP
#87102
Author: Russ Allbery
Date: Tue, 20 Oct 2015 21:01
30 lines
2191 bytes
Julien ÉLIE <iulius@nom-de-mon-site.com.invalid> writes:

> No, it is not protocol-compatible.
> It was intended for feeds.

> [C] MODE COMPRESS
> [S] 207 compression enabled
> [C*] CHECK <a@b>
> [S] 238 <a@b>
> [C*] TAKETHIS <a@b>
> [C*] (...article...CRLF.CRLF)
> [S] 239 OK

> Only [C*] are compressed.  Server responses are never compressed with
> MODE COMPRESS.  So it probably means that we should take another
> response code than 207...  Perhaps 206?  Or 250?

Yeah, numbers are cheap so we should use something else.  I think I'd lean
towards using whatever in the 2xx sequence is the next one that we don't
think anyone has used for anything.  I haven't checked to see if that's
206.  (Do we have a comprehensive list of all the response codes in use
anywhere?)

-- 
Russ Allbery (eagle@eyrie.org)              <http://www.eyrie.org/~eagle/>

          Please post questions rather than mailing me directly.
     <http://www.eyrie.org/~eagle/faqs/questions.html> explains why.

Re: About compression with NNTP
#87106
Author: Julien ÉLIE
Date: Wed, 21 Oct 2015 19:05
60 lines
3807 bytes
Hi Russ,

> Yeah, numbers are cheap so we should use something else.  I think I'd lean
> towards using whatever in the 2xx sequence is the next one that we don't
> think anyone has used for anything.  I haven't checked to see if that's
> 206.  (Do we have a comprehensive list of all the response codes in use
> anywhere?)

I don't know such a list (up-to-date and complete).  Maybe we could 
initialize it in our Trac wiki?  (though it would also mention codes 
implemented in other software than INN)

200 and 201 are defined in RFC 3977 for the initial greeting.

202 is defined in RFC 977 in response to SLAVE... but also in response 
to VERS defined in RFC 4707!

203 is defined in RFC 4644 in response to MODE STREAM.

204 is mentioned in "Bandwidth Usage Optimization for NNTP Protocol", a 
recent paper that I have just found via a Google search.  It is used in 
response to MODE STREAM with delayed/sized extension allowed. 
Basically, CHECK has an extra argument telling how many bytes the 
articles has; and in case the server defers the article, it adds an 
extra number after the response to CHECK, telling how many seconds the 
other peer should delay its next CHECK for that message-ID (the author 
of the paper says it is better than the currently 5 seconds hard-coded 
in innfeed).

205 is defined in RFC 3977 in response to QUIT.

207 is used by at least Diablo in response to MODE COMPRESS.

209 is defined in a draft for generic data extensions (SET and GET).



206 and 208 do not seem to be currently used (according to a quick 
Google search).  That's why I suggested the 206 response code.

I do not know whether 204 has already been used in real life, but as it 
is in "Bandwidth Usage Optimization for NNTP Protocol", maybe we should 
leave it.  They say they have successfully implemented it in INN but as 
far as I know, the patch has not been made public.


P.-S.:  We should probably consider adding a per-feed parameter in 
innfeed.conf to configure how many seconds innfeed should wait between 
two CHECKs.
Or ask them the patch in order to integrate it into INN, and rewrite 
their paper into an Internet-Draft?  Most of the work is already done in 
matter of wording in their paper.

-- 
Julien ÉLIE

« La vérité pure et simple est très rarement pure et jamais
   simple. » (Oscar Wilde)

Re: About compression with NNTP
#87160
Author: D. Stussy
Date: Tue, 27 Oct 2015 01:01
10 lines
1581 bytes
"Julien ÉLIE"  wrote in message news:mvjp3s$n0u$1@news.trigofacile.com...
....
The next version of TLS (1.3) will remove support for compression.
============
I don't see a problem with this because I turn on compression for my server 
in the IPSEC layer (IPCOMP) for both IPv4 and IPv6 for NNTP connections on 
port 119 (servers only; my readers go to port 563). 


Re: About compression with NNTP
#87166
Author: Michael Baeuerle
Date: Mon, 02 Nov 2015 22:19
33 lines
2005 bytes
Detection of the COMPRESS capability and the DEFLATE method offered
by INN seems to work now:
------------------------------------------------------------------------
[Using NNTP protocol driver]
[=> Connect to news.trigofacile.com:119]
[<=] 200 news.trigofacile.com InterNetNews NNRP server INN 2.7.0 (20151028 prerelease) ready (no posting)
[=>] CAPABILITIES
[<=] 101 Capability list:
[<= Expect multiline data block]
VERSION 2
IMPLEMENTATION INN 2.7.0 (20151028 prerelease)
AUTHINFO USER SASL
COMPRESS DEFLATE
HDR
LIST ACTIVE ACTIVE.TIMES COUNTS DISTRIB.PATS DISTRIBUTIONS HEADERS MODERATORS MOTD NEWSGROUPS OVERVIEW.FMT SUBSCRIPTIONS
NEWNEWS
OVER
READER
SASL GSSAPI OTP PLAIN NTLM LOGIN DIGEST-MD5 CRAM-MD5
STARTTLS
[Switch to NNTP V2 (RFC3977) mode]
[=>] COMPRESS DEFLATE
[<=] 403 Work in progress...
[Enabling compression failed]
[=>] GROUP trigofacile.test
[<=] 211 483 7 542 trigofacile.test
------------------------------------------------------------------------

TLS and AUTH were disabled for this test. 

zlib detection and linking in the build system is now present too.

Re: About compression with NNTP
#87179
Author: Michael Baeuerle
Date: Fri, 06 Nov 2015 18:14
69 lines
3356 bytes
Michael Baeuerle wrote:
> 
> Detection of the COMPRESS capability and the DEFLATE method offered
> by INN seems to work now:
> ------------------------------------------------------------------------
> [...]
> ------------------------------------------------------------------------
> 
> TLS and AUTH were disabled for this test. 
> 
> zlib detection and linking in the build system is now present too.

Now it seems to work with TLS and AUTH too:
------------------------------------------------------------------------
[Using NNTP protocol driver]
[=> Connect to news.trigofacile.com:nntps]
[Established encrypted connection using TLSv1 protocol with cipher suite DHE-RSA-AES256-SHA]
[<= Expect X509 certificate]
[...]
[Server certificate verification successful]
[<=] 200 news.trigofacile.com InterNetNews NNRP server INN 2.7.0 (20151028 prerelease) ready (no posting)
[=>] CAPABILITIES
[<=] 101 Capability list:
[<= Expect multiline data block]
VERSION 2
IMPLEMENTATION INN 2.7.0 (20151028 prerelease)
AUTHINFO USER SASL
COMPRESS DEFLATE
HDR
LIST ACTIVE ACTIVE.TIMES COUNTS DISTRIB.PATS DISTRIBUTIONS HEADERS MODERATORS MOTD NEWSGROUPS OVERVIEW.FMT SUBSCRIPTIONS
NEWNEWS
OVER
POST
READER
SASL GSSAPI OTP PLAIN NTLM LOGIN DIGEST-MD5 CRAM-MD5
[Switch to NNTP V2 (RFC3977) mode]
[=>] AUTHINFO USER test
[<=] 381 Enter password
[=>] AUTHINFO PASS ********
[<=] 281 Authentication succeeded
[=>] CAPABILITIES
[<=] 101 Capability list:
[<= Expect multiline data block]
VERSION 2
IMPLEMENTATION INN 2.7.0 (20151028 prerelease)
COMPRESS DEFLATE
HDR
LIST ACTIVE ACTIVE.TIMES COUNTS DISTRIB.PATS DISTRIBUTIONS HEADERS MODERATORS MOTD NEWSGROUPS OVERVIEW.FMT SUBSCRIPTIONS
OVER
POST
READER
SASL GSSAPI OTP PLAIN NTLM LOGIN DIGEST-MD5 CRAM-MD5
[Switch to NNTP V2 (RFC3977) mode]
[=>] COMPRESS DEFLATE
[<=] 403 Work in progress...
[Enabling compression failed]
[=>] GROUP trigofacile.test
[<=] 211 483 7 542 trigofacile.test
------------------------------------------------------------------------


I have configured the compressor part of zlib like this:
| 
| deflateInit2(strm, Z_BEST_COMPRESSION, Z_DEFLATED, -15, 9, Z_DEFAULT_STRATEGY);
                                                     ^^^
The negative sign should give a raw data stream without zlib container
(header, dictionary and checksum).

Re: About compression with NNTP
#87182
Author: Julien ÉLIE
Date: Sat, 07 Nov 2015 14:23
50 lines
3074 bytes
Hi Michael,

> I have configured the compressor part of zlib like this:
> |
> | deflateInit2(strm, Z_BEST_COMPRESSION, Z_DEFLATED, -15, 9, Z_DEFAULT_STRATEGY);
>                                                       ^^^
> The negative sign should give a raw data stream without zlib container
> (header, dictionary and checksum).

I was planing to use for INN:

#define MEM_LEVEL 8
#define WINDOW_BITS (-15)      /* Raw deflate. */

deflateInit2(zstream_out, Z_DEFAULT_COMPRESSION, Z_DEFLATED,
              WINDOW_BITS, MEM_LEVEL, Z_DEFAULT_STRATEGY);


As 8 is the default value for MEM_LEVEL, I kept it.  Do you think 9 
would be better to use?

    The memLevel parameter specifies how much memory should be allocated
    for the internal compression state.  memLevel=1 uses minimum memory
    but is slow and reduces compression ratio; memLevel=9 uses maximum
    memory for optimal speed.  The default value is 8.


Also, I see that you use Z_BEST_COMPRESSION (9).

     The compression level must be Z_DEFAULT_COMPRESSION, or between
     0 and 9:  1 gives best speed, 9 gives best compression, 0 gives no
     compression at all (the input data is simply copied a block at a
     time).  Z_DEFAULT_COMPRESSION requests a default compromise
     between speed and compression (currently equivalent to level 6).



Do you plan on changing the compression level depending on the commands 
you send?  It is configurable by the user?
I wonder whether INN should also use 9.  It may consume too many 
resources if hundreds of users are connected.  Or be a parameter for 
news administrators?  (this way, they could deactivate compression if 
wanted, with the 0 value)

-- 
Julien ÉLIE

« Faites le mur, pas la guerre. » (Astérix)

Re: About compression with NNTP
#87181
Author: Michael Baeuerle
Date: Sat, 07 Nov 2015 18:36
71 lines
3853 bytes
Julien ÉLIE wrote:
> Michael Bäuerle wrote:
> > 
> > I have configured the compressor part of zlib like this:
> > |
> > | deflateInit2(strm, Z_BEST_COMPRESSION, Z_DEFLATED, -15, 9, Z_DEFAULT_STRATEGY);
> >                                                      ^^^
> > The negative sign should give a raw data stream without zlib container
> > (header, dictionary and checksum).
> 
> I was planing to use for INN:
> 
> #define MEM_LEVEL 8
> #define WINDOW_BITS (-15)      /* Raw deflate. */
> 
> deflateInit2(zstream_out, Z_DEFAULT_COMPRESSION, Z_DEFLATED,
>              WINDOW_BITS, MEM_LEVEL, Z_DEFAULT_STRATEGY);
> 
> 
> As 8 is the default value for MEM_LEVEL, I kept it.  Do you think 9 
> would be better to use?
> [...]
>      memLevel=9 uses maximum memory for optimal speed.

I have used 9 because of the "optimal speed". Because flnews can handle
only one connection at a time, I expect no memory problems.

> Also, I see that you use Z_BEST_COMPRESSION (9).
> [...]
> 
> Do you plan on changing the compression level depending on the commands 
> you send?

I plan to add at least an API call to the compression module for this.
But I'm not sure whether it would be worth the work using it from the
NNTP module.

> It is configurable by the user?

I plan to only make config options for disabling compression completely
in 3 ways:
- No zlib installed (detected by build system)
  zlib should be an optional dependency
- Disabled at compile time (manually by user)
  flnews was originally written for historic, very slow machines (down
  to 100MHz CPU clock or less). On such machines, things will likely
  work better without compression
- Disabled at runtime
  If somebody will find a security vulnerablity in zlib in the future,
  there should be a quick way to disable usage of zlib immediately
  (until it is patched). Maybe a checkbox in the GUI like this:
  [X] Use compression if available

> I wonder whether INN should also use 9.  It may consume too many 
> resources if hundreds of users are connected.  Or be a parameter for 
> news administrators?  (this way, they could deactivate compression if 
> wanted, with the 0 value)

If INN choose a lower level like 6, it still gets the decompressor CPU
load from communication partners that have chosen 9. Looks like this
can't be configured completely in one place.
If high compression levels really will create problems for servers,
maybe forbid them in the update of the RFC draft?
Or a bit weaker like "not more than level x SHOULD be used"?
-- 
> It works.
Die Beschreibung hört sich aber eher nach "It würgs" an...

                                               Günter Frenz in ger.ct

Re: About compression with NNTP
#87185
Author: Julien ÉLIE
Date: Mon, 09 Nov 2015 21:21
44 lines
2901 bytes
Hi Michael,

>> As 8 is the default value for MEM_LEVEL, I kept it.  Do you think 9
>> would be better to use?
>> [...]
>>       memLevel=9 uses maximum memory for optimal speed.
>
> I have used 9 because of the "optimal speed". Because flnews can handle
> only one connection at a time, I expect no memory problems.

OK, we could probably also use 9 in news servers.


> I plan to only make config options for disabling compression completely
> in 3 ways:
> - No zlib installed (detected by build system)
> - Disabled at compile time (manually by user)
> - Disabled at runtime

I imagine the same thing for INN:
* no zlib installed,
* --without-zlib configure flag,
* compressionlevel set to -1 in inn.conf (if set to 0, the news server 
accepts encrypted input but compresses with the 0 level its output).


> If high compression levels really will create problems for servers,
> maybe forbid them in the update of the RFC draft?
> Or a bit weaker like "not more than level x SHOULD be used"?

I think even a SHOULD is too strong because a fully compliant server may 
want to use level 9.  It cannot be declared not RFC-compliant because of 
that.
Maybe a cave-at could just be mentioned about that potential issue.

-- 
Julien ÉLIE

« Les grands voyages ont ceci de merveilleux que leur enchantement
   commence avant le départ même. On ouvre les atlas, on rêve sur les
   cartes. On répète les noms magnifiques des villes inconnues… »
   (Joseph Kessel)

Re: About compression with NNTP
#87187
Author: Michael Baeuerle
Date: Tue, 10 Nov 2015 17:13
27 lines
2485 bytes
Julien ÉLIE wrote:
> Michael Bäuerle wrote:
> > 
> > If high compression levels really will create problems for servers,
> > maybe forbid them in the update of the RFC draft?
> > Or a bit weaker like "not more than level x SHOULD be used"?
> 
> I think even a SHOULD is too strong because a fully compliant server 
> may want to use level 9.  It cannot be declared not RFC-compliant 
> because of that.
> Maybe a cave-at could just be mentioned about that potential issue.

From the 'inflateInit2()' documentation in zlib.h:
| 
| [...] windowBits must be greater than or equal to the windowBits value
| provided to deflateInit2() while compressing, or it must be equal to
| 15 if deflateInit2() was not used.  If a compressed stream with a
| larger window size is given as input, inflate() will return with the
| error code Z_DATA_ERROR instead of trying to allocate a larger window.

Looks like the "intended way" to handle this is to use the zlib
container with the window size field in its header.
Because we want to use the raw format, the decompressor should always
use the maximum window size (-15), or it would not be able to handle
data that was compressed with arbitrary window size.

Re: About compression with NNTP
#87186
Author: Julien ÉLIE
Date: Tue, 10 Nov 2015 20:25
37 lines
3111 bytes
Hi Michael,

>  From the 'inflateInit2()' documentation in zlib.h:
> |
> | [...] windowBits must be greater than or equal to the windowBits value
> | provided to deflateInit2() while compressing, or it must be equal to
> | 15 if deflateInit2() was not used.  If a compressed stream with a
> | larger window size is given as input, inflate() will return with the
> | error code Z_DATA_ERROR instead of trying to allocate a larger window.
>
> Looks like the "intended way" to handle this is to use the zlib
> container with the window size field in its header.
> Because we want to use the raw format, the decompressor should always
> use the maximum window size (-15), or it would not be able to handle
> data that was compressed with arbitrary window size.

So it appears that implementations MUST use (-15) for the window size 
given to inflateInit2() in order to ensure interoperability.
Or should it be said that the window size MUST be the highest available? 
  (in absolute value, because in fact we take the lowest:  -15)

The documentation says "It should be in the range 8..15 for this version 
of the library" so the number may change in future versions of zlib... 
which could break existing implementations!

And what happens if someone uses an implementation of DEFLATE other than 
zlib?  Will zlib always be able to decode their compressed stream?

-- 
Julien ÉLIE

« Les grands voyages ont ceci de merveilleux que leur enchantement
   commence avant le départ même. On ouvre les atlas, on rêve sur les
   cartes. On répète les noms magnifiques des villes inconnues… »
   (Joseph Kessel)

Re: About compression with NNTP
#87188
Author: Michael Baeuerle
Date: Wed, 11 Nov 2015 12:15
74 lines
4197 bytes
Julien ÉLIE wrote:
> Michael Bäuerle wrote:
> > 
> >  From the 'inflateInit2()' documentation in zlib.h:
> > |
> > | [...] windowBits must be greater than or equal to the windowBits value
> > | provided to deflateInit2() while compressing, or it must be equal to
> > | 15 if deflateInit2() was not used.  If a compressed stream with a
> > | larger window size is given as input, inflate() will return with the
> > | error code Z_DATA_ERROR instead of trying to allocate a larger window.
> > 
> > Looks like the "intended way" to handle this is to use the zlib
> > container with the window size field in its header.
> > Because we want to use the raw format, the decompressor should always
> > use the maximum window size (-15), or it would not be able to handle
> > data that was compressed with arbitrary window size.
> 
> So it appears that implementations MUST use (-15) for the window size 
> given to inflateInit2() in order to ensure interoperability.

Yes (if the window size is not negotiated).

The RFC draft for the COMPRESS extension specify in chapter 3:
| 
| The windowBits value must be in the range -8 to -15, or else
| deflateInit2() uses the wrong format.

I read this as it's explicitly intended to not use the zlib container
(that would provide a window size field in its header).

> Or should it be said that the window size MUST be the highest 
> available?  (in absolute value, because in fact we take the lowest:  
> -15)

From zlib.h:
| 
| The windowBits parameter is the base two logarithm of the window size
| [...]
| windowBits can also be -8..-15 for raw deflate.  In this case,
| -windowBits determines the window size.

The sign should therefore only indicate the format and for the raw
format the maximum window size should calculate as:

   log₂(window size) = -windowBits

   2⁻⁽⁻¹⁵⁾ = 32Ki

> The documentation says "It should be in the range 8..15 for this 
> version of the library" so the number may change in future versions of 
> zlib... which could break existing implementations!

Agreed.

> And what happens if someone uses an implementation of DEFLATE other 
> than zlib?  Will zlib always be able to decode their compressed stream?

Not if a window larger than 32KiByte is used. But it looks like that
the algorithm defined as "DEFLATE" in RFC1951 has an implicit 32KiByte
window limit. Quoted from chapter 2:
| 
| [...]
| the LZ77 algorithm may use a reference to a duplicated string
| occurring in a previous block, up to 32K input bytes before.
| [...]
| The representation used in the "deflate" format limits distances to
| 32K bytes
| [...]

Implementations that support/use larger window sizes seem to exist, but
they use different names like "DEFLATE64":
<http://deflate64.com/deflate64-vs-deflate-compression/>

Re: About compression with NNTP
#87189
Author: Julien ÉLIE
Date: Wed, 11 Nov 2015 13:54
36 lines
2867 bytes
Hi Michael,

> Not if a window larger than 32KiByte is used. But it looks like that
> the algorithm defined as "DEFLATE" in RFC1951 has an implicit 32KiByte
> window limit. Quoted from chapter 2:
> |
> | [...]
> | the LZ77 algorithm may use a reference to a duplicated string
> | occurring in a previous block, up to 32K input bytes before.
> | [...]
> | The representation used in the "deflate" format limits distances to
> | 32K bytes
> | [...]
>
> Implementations that support/use larger window sizes seem to exist, but
> they use different names like "DEFLATE64":
> <http://deflate64.com/deflate64-vs-deflate-compression/>

Many thanks for all your searches!
Looks like we MUST use -15 and that it will always be working for DEFLATE.
The DEFLATE64 variant could be another *optional* algorithm advertised 
by the COMPRESS capability (like LZMA).

I have good news:  Ken will (normally) soon participate in our current 
discussions.  He is willing to release a -02 draft and go on the process 
of standardization of his draft.

-- 
Julien ÉLIE

« Les grands voyages ont ceci de merveilleux que leur enchantement
   commence avant le départ même. On ouvre les atlas, on rêve sur les
   cartes. On répète les noms magnifiques des villes inconnues… »
   (Joseph Kessel)

Re: About compression with NNTP
#87190
Author: Michael Baeuerle
Date: Wed, 11 Nov 2015 15:08
26 lines
2281 bytes
Julien ÉLIE wrote:
> Michael Bäuerle wrote:
> > 
> > [...]
> > Implementations that support/use larger window sizes seem to exist, but
> > they use different names like "DEFLATE64":
> > <http://deflate64.com/deflate64-vs-deflate-compression/>
> 
> Many thanks for all your searches!
> Looks like we MUST use -15 and that it will always be working for DEFLATE.

At least for the decompressor.

> The DEFLATE64 variant could be another *optional* algorithm advertised 
> by the COMPRESS capability (like LZMA).

Yes. The mandatory DEFLATE should comply to RFC1951 and work with zlib.
Anything else should be optional.

> I have good news:  Ken will (normally) soon participate in our current 
> discussions.  He is willing to release a -02 draft and go on the 
> process of standardization of his draft.

Nice to hear that.

Re: About compression with NNTP
#87194
Author: Ken Murchison
Date: Wed, 11 Nov 2015 15:38
36 lines
2918 bytes
On 10/20/2015 04:30 PM, Julien ÉLIE wrote:
> Hi Michael,
>
>>>> But the current RFCs allow AUTHINFO after 480 at any time. Therefore
>>>> the potential new RFC for COMPRESS maybe should forbid the wrong order
>>>> explicitly. Something like "MUST NOT execute AUTHINFO after COMPRESS".
>>>> Removing the corresponding AUTHINFO capability would then be in sync
>>>> (forbidden even with cached capabilities).
>>>
>>> Adding such wording would indeed be useful.  Wouldn't SHOULD NOT be
>>> better, though?
>>
>> In this case the reason why it should not be done isn't obvious. If we
>> think that it is a potential security problem to use AUTHINFO over a
>> compressed connection, this should at least be noted in the text.
>
> Yep, the reason for the SHOULD NOT has to be explained in the sentence.
>

Is there actually a security problem?  I think we'd have to ask some 
security people.

My understanding of the TLS compression issue is that compression occurs 
prior to encryption being negotiated/enabled.  Presumably TLS would be 
active prior to COMPRESS and/or AUTHINFO so I don't think any 
credentials would be leaked.

That being said, we probably want to restrict the use of COMPRESS to 
after STARTTLS, if we don't already.

-- 
Kenneth Murchison
Principal Systems Software Engineer
Carnegie Mellon University

Re: About compression with NNTP
#87197
Author: Ken Murchison
Date: Wed, 11 Nov 2015 15:54
42 lines
3063 bytes
On 11/11/2015 08:54 AM, Julien ÉLIE wrote:

> I have good news:  Ken will (normally) soon participate in our current
> discussions.  He is willing to release a -02 draft and go on the process
> of standardization of his draft.
>

I'm here and ready to refresh the draft.

The only change that I believe has been agreed to is the use of response 
code 206 for successful COMPRESS in lieu of the 291 placeholder in the 
draft.

One issue being discussed is whether "SHOULD NOT use AUTHINFO after 
COMPRESS" and discuss security reasons why.  I'm not sure there is a 
security issue here.  I need to do some digging to see if there is 
chatter about updating IMAP COMPRESS (which this draft is based on) in 
light of CRIME, etc.

One question I have is whether we should remove all discussion of TLS 
compression, or leave it and discuss why COMPRESS is preferred.

Regarding the discussion of implementation with zlib, any text in the 
draft with respect to that is informative, not normative.  RFC 1951 is 
the normative reference for the compression format.

Russ is correct in that the IETF/IESG will require a 
mandatory-to-implement compression scheme, which is why DEFLATE is 
mandatory in the draft.  Its easy to implement and already has been 
deployed by IMAP servers and clients.  I'm open to adding other formats 
but I think a case needs to be made as to why scheme XXX is 
better/faster/cheaper than DEFLATE.


Anything else?

-- 
Kenneth Murchison
Principal Systems Software Engineer
Carnegie Mellon University

Re: About compression with NNTP
#87198
Author: Julien ÉLIE
Date: Wed, 11 Nov 2015 16:28
95 lines
5065 bytes
Hi Ken,

>>> In this case the reason why it should not be done isn't obvious. If we
>>> think that it is a potential security problem to use AUTHINFO over a
>>> compressed connection, this should at least be noted in the text.
>>
>> Yep, the reason for the SHOULD NOT has to be explained in the sentence.
>
> Is there actually a security problem?  I think we'd have to ask some
> security people.

I had a discussion about that in the TLS WG last September.  The problem 
comes from the following scenario:
     http://www.ietf.org/mail-archive/web/tls/current/msg17741.html

Quoted below:
%%%
It may well be true that some (typically unauthenticated) application 
protocols on top of TLS can survive TLS compression,
but it is unlikely.  You ask a pointed question about AUTHINFO, so just 
as a fun game, let’s analyze its security:

AUTHINFO USER test
381 Enter password
AUTHINFO PASS test
281 Authentication succeeded

 From a formal security viewpoint, the logic behind disabling 
compression in this exchange is as follows.
TLS does not hide the length of plaintext, so an 8-character password 
is distinguishable from a 4-character one.
While this loss of confidentiality may arguably be expected and 
acceptable, compression makes it worse.

Consider the two lines:
AUTHINFO PASS AAAAAAAA
AUTHINFO PASS 12345678

Both passwords have 8 characters, and so when no compression is used, a 
passive network adversary cannot distinguish between them.
However, if they are compressed with gzip, the first results in 7 fewer 
bytes than the second.
So compression of this line already yields 3 bits of the password to a 
passive adversary.
No online attack needed so far.

Suppose, the client also uses this password with a different command 
(e.g. XSECRET).

XSECRET test AAAAAAAA
XSECRET test 12345678

Now looking at the compressed lengths of this, the passive attacker can 
get another 3 bits. Considering that the average password entropy can be 
as low as 20 bits, the attacker now has a significant headstart on any 
other attack she may wish to pursue.

HTTP is a particularly bad case because the attacker can potentially 
inject arbitrary data before (and after) the secret. With NNTP you may 
escape the worst of this adversary, but you probably won’t find any TLS 
expert willing to say that compressing the password is ok.
%%%


Another comment:
     http://www.ietf.org/mail-archive/web/tls/current/msg17743.html

%%%
Consider what happens when data that follows authentication (in
sunsequent message bodies) either does or does not match some part
of the password...
%%%



> My understanding of the TLS compression issue is that compression occurs
> prior to encryption being negotiated/enabled.  Presumably TLS would be
> active prior to COMPRESS and/or AUTHINFO so I don't think any
> credentials would be leaked.
>
> That being said, we probably want to restrict the use of COMPRESS to
> after STARTTLS, if we don't already.

It is already restricted.  STARTTLS is no longer a valid command after 
COMPRESS has been successfully used.

-- 
Julien ÉLIE

« – Et souvenez-vous ! La seule chose que nous ayons à craindre,
     c'est que le ciel nous tombe sur la tête !
   – …Et souvenez-vous, Romains, la seule chose que nous ayons à
     craindre, c'est les Gaulois ! » (Astérix)

Re: About compression with NNTP
#87199
Author: Julien ÉLIE
Date: Wed, 11 Nov 2015 16:48
34 lines
2702 bytes
Michael,

>> - Should we keep the COMPRESS name, or switch to something like
>> STARTCOMPRESSION?  (to keep the semantics of the existing STARTTLS
>> command)
>
> I think COMPRESS is OK because the negotiation is already done at
> execution time (The capability list advertises the algorithms and then
> one is activated with e.g. "COMPRESS DEFLATE" directly). Therefore the
> command normally should never fail.
>
> For STARTTLS things are different. This command _start_ a negotiation
> and it is unknown at execution time whether there are common algorithms
> supported by both ends.

The only counter-arguments I would have is the fact that 
STARTCOMPRESSION could be read as "straight after the successful 
response of the server, every exchange is compressed".
And, in case it could be useful for clients, we could define 
ENDCOMPRESSION, that purely removes compression.

(Another possibility:  "COMPRESS START DEFLATE" and "COMPRESS END".)

Well, that's only thoughts for an additional feature to compression.

-- 
Julien ÉLIE

« – Et souvenez-vous ! La seule chose que nous ayons à craindre,
     c'est que le ciel nous tombe sur la tête !
   – …Et souvenez-vous, Romains, la seule chose que nous ayons à
     craindre, c'est les Gaulois ! » (Astérix)

Re: About compression with NNTP
#87200
Author: Julien ÉLIE
Date: Wed, 11 Nov 2015 17:25
77 lines
4183 bytes
Hi Ken,

> I'm here and ready to refresh the draft.

Many thanks!



> One question I have is whether we should remove all discussion of TLS
> compression, or leave it and discuss why COMPRESS is preferred.

I think the discussion of TLS compression can remain, but explicitly 
mentioning that it concerns versions <= 1.2 of TLS.  Then, say why 
COMPRESS is preferred.
In the TLS WG, they mention another reason that you could say in the 
revised draft:  using COMPRESS instead of relaying on TLS compression is 
a simpler and less-risky approach in terms of software dependencies. 
Moreover, application protocols can handle compression better and more 
safely, as they can actually know what they are doing and how to 
properly compress it.



> Regarding the discussion of implementation with zlib, any text in the
> draft with respect to that is informative, not normative.  RFC 1951 is
> the normative reference for the compression format.

Though the text is informative, I reckon that it should not give the 
inexact feeling that any choice between -8 and -15 is also good for 
inflateInit2().  One could choose -10 for deflateInit2() and, when then 
he mechanically also use the same number for inflateInit2().

Adding the informative precision to use -15 for inflateInit2() could be 
worthwhile I think.  It wouldn't harm.



> Anything else?

A word about "high compression levels that could create problems"?  or 
is it totally out of scope of an RFC?

In Section 3, mentioning:
- LAST at the same time as NEXT,
- LISTGROUP and NEWGROUPS at the same time as GROUP,
- HDR at the same time as HEAD,
- OVER at the same time as HEAD *instead* of where it is currently 
mentioned, because OVER is related to article headers.

I see that AUTHINFO is not mentioned in Section 3, so maybe it was 
already not intended to be compressed?  :)

As for ABNF:
   compress-capability = "COMPRESS" *(WS algorithm)

=> I suggest 1*(WS algorithm) for "at least one".


    algorithm = "DEFLATE" / token

=> I suggest a grammar similar to RFC 4644 (SASL mechanisms):
    algorithm = "DEFLATE" / 1*20algo-char
    algo-char = UPPER / DIGIT / "-" / "_"

Yet, is it necessary to add "DEFLATE" here and not only having:
    algorithm = 1*20algo-char
?

-- 
Julien ÉLIE

« – Et souvenez-vous ! La seule chose que nous ayons à craindre,
     c'est que le ciel nous tombe sur la tête !
   – …Et souvenez-vous, Romains, la seule chose que nous ayons à
     craindre, c'est les Gaulois ! » (Astérix)

Re: About compression with NNTP
#87201
Author: Julien ÉLIE
Date: Wed, 11 Nov 2015 17:54
19 lines
2208 bytes
Ken,

> One issue being discussed is whether "SHOULD NOT use AUTHINFO after
> COMPRESS" and discuss security reasons why.

Incidentally, if AUTHINFO is still a valid command after the use of 
COMPRESS, how do we tell Cyrus SASL that an encryption layer is active?
All communication between the client and the server is supposed to be 
encrypted.
I see the SASL_SSF_EXTERNAL property to tell Cyrus SASL that a TLS layer 
is active, but what for compression?

-- 
Julien ÉLIE

« N'écoutant que son courage qui ne lui disait rien, il se garda
   d'intervenir. » (Jules Renard)

Re: About compression with NNTP
#87203
Author: Ken Murchison
Date: Wed, 11 Nov 2015 18:34
30 lines
2431 bytes
On 11/11/2015 12:54 PM, Julien ÉLIE wrote:
> Ken,
>
>> One issue being discussed is whether "SHOULD NOT use AUTHINFO after
>> COMPRESS" and discuss security reasons why.
>
> Incidentally, if AUTHINFO is still a valid command after the use of
> COMPRESS, how do we tell Cyrus SASL that an encryption layer is active?
> All communication between the client and the server is supposed to be
> encrypted.
> I see the SASL_SSF_EXTERNAL property to tell Cyrus SASL that a TLS layer
> is active, but what for compression?


Given your info regarding TLS compression and auth credentials, I think 
we probably don't want AUTHINFO after COMPRESS.  So the order of 
commands should always be:

STARTTLS (or implicit TLS on port 563)
AUTHINFO
COMPRESS



-- 
Kenneth Murchison
Principal Systems Software Engineer
Carnegie Mellon University

Re: About compression with NNTP
#87202
Author: Julien ÉLIE
Date: Wed, 11 Nov 2015 19:16
25 lines
2496 bytes
Hi Ken,

> Given your info regarding TLS compression and auth credentials, I think
> we probably don't want AUTHINFO after COMPRESS.  So the order of
> commands should always be:
>
> STARTTLS (or implicit TLS on port 563)
> AUTHINFO
> COMPRESS

That sounds good, and is a sequence in example in your draft.
In its next version, could you please add an example of 
STARTTLS/CAPABILITIES/COMPRESS/CAPABILITIES sequence, where "AUTHINFO 
USER" is advertised in response to the first CAPABILITIES, and 
"AUTHINFO" (without argument) is advertised in response to the second 
CAPABILITIES?  It will clearly show that authentication is not possible 
in that state.  Thanks!

-- 
Julien ÉLIE

« N'écoutant que son courage qui ne lui disait rien, il se garda
   d'intervenir. » (Jules Renard)

Re: About compression with NNTP
#87204
Author: Michael Baeuerle
Date: Thu, 12 Nov 2015 09:17
32 lines
2632 bytes
Julien ÉLIE wrote:
> Michael Bäuerle wrote:
> > Julien ÉLIE wrote:
> > > 
> > > - Should we keep the COMPRESS name, or switch to something like
> > > STARTCOMPRESSION?  (to keep the semantics of the existing STARTTLS
> > > command)
> > 
> > I think COMPRESS is OK because the negotiation is already done at
> > execution time (The capability list advertises the algorithms and then
> > one is activated with e.g. "COMPRESS DEFLATE" directly). Therefore the
> > command normally should never fail.
> > 
> > For STARTTLS things are different. This command _start_ a negotiation
> > and it is unknown at execution time whether there are common algorithms
> > supported by both ends.
> 
> The only counter-arguments I would have is the fact that 
> STARTCOMPRESSION could be read as "straight after the successful 
> response of the server, every exchange is compressed".
> And, in case it could be useful for clients, we could define 
> ENDCOMPRESSION, that purely removes compression.
> 
> (Another possibility:  "COMPRESS START DEFLATE" and "COMPRESS END".)
> 
> Well, that's only thoughts for an additional feature to compression.

This syntax IMHO looks nice (for a protocol like NNTP, that is designed
to be human readable too), but is more complicated. I think we should
only use it if the option "END" is really required.

Re: About compression with NNTP
#87205
Author: Ken Murchison
Date: Thu, 12 Nov 2015 11:40
49 lines
3295 bytes
On 11/12/2015 04:17 AM, Michael Baeuerle wrote:
> Julien ÉLIE wrote:
>> Michael Bäuerle wrote:
>>> Julien ÉLIE wrote:
>>>>
>>>> - Should we keep the COMPRESS name, or switch to something like
>>>> STARTCOMPRESSION?  (to keep the semantics of the existing STARTTLS
>>>> command)
>>>
>>> I think COMPRESS is OK because the negotiation is already done at
>>> execution time (The capability list advertises the algorithms and then
>>> one is activated with e.g. "COMPRESS DEFLATE" directly). Therefore the
>>> command normally should never fail.
>>>
>>> For STARTTLS things are different. This command _start_ a negotiation
>>> and it is unknown at execution time whether there are common algorithms
>>> supported by both ends.
>>
>> The only counter-arguments I would have is the fact that
>> STARTCOMPRESSION could be read as "straight after the successful
>> response of the server, every exchange is compressed".
>> And, in case it could be useful for clients, we could define
>> ENDCOMPRESSION, that purely removes compression.
>>
>> (Another possibility:  "COMPRESS START DEFLATE" and "COMPRESS END".)
>>
>> Well, that's only thoughts for an additional feature to compression.
>
> This syntax IMHO looks nice (for a protocol like NNTP, that is designed
> to be human readable too), but is more complicated. I think we should
> only use it if the option "END" is really required.


Agreed, is there an actual use case for disabling compression once it 
has been enabled?

COMPRESS has been deployed for IMAP for quite a while and I'm not aware 
of anyone requesting an ENDCOMPRESS command, or an ENDTLS command for 
that matter.

If the client wants to stop compression (or TLS) on a particular 
connection, it can simply QUIT and open a new connection.

-- 
Kenneth Murchison
Principal Systems Software Engineer
Carnegie Mellon University

Re: About compression with NNTP
#87211
Author: Julien ÉLIE
Date: Thu, 12 Nov 2015 19:04
71 lines
3816 bytes
Hi Ken,

>>> The only counter-arguments I would have is the fact that
>>> STARTCOMPRESSION could be read as "straight after the successful
>>> response of the server, every exchange is compressed".
>>> And, in case it could be useful for clients, we could define
>>> ENDCOMPRESSION, that purely removes compression.
>>
>> This syntax IMHO looks nice (for a protocol like NNTP, that is designed
>> to be human readable too), but is more complicated. I think we should
>> only use it if the option "END" is really required.
>
> Agreed, is there an actual use case for disabling compression once it
> has been enabled?

The only use case I see is for news readers dedicated to binaries.  Some 
of them have implemented the XZVER and XZHDR commands to respectively 
download compressed overview and headers.
     http://helpdesk.astraweb.com/index.php?_m=news&_a=viewnews&newsid=9

Afterwards, article bodies are downloaded with normal ARTICLE or BODY 
commands, without compression.  The bodies are already in a compressed 
form (using for instance yEnc).

The client is therefore actor of the compression it wants.
(Whereas the text that previously was in Section 3 of the first version 
of the draft regarding binary and uncompressible attachments was 
server-oriented.  Maybe it was the reason why the text was removed, or 
maybe because it was not generic enough.)


A possible use case would then be:

STARTCOMPRESSION
GROUP my.group
OVER 1000-
ENDCOMPRESSION
ARTICLE 1000
ARTICLE 1001
[...]
STARTCOMPRESSION
GROUP my.group2
OVER 7000-
ENDCOMPRESSION
ARTICLE 7000
ARTICLE 7001
[...]


XZVER and XZHDR would then no longer be needed.



> If the client wants to stop compression (or TLS) on a particular
> connection, it can simply QUIT and open a new connection.

It is true that the client could do that with COMPRESS, or also open 
several parallel connections (one compressed to download overview, 
others uncompressed to download articles).

Could a sentence mention that use case in the draft?  (something 
basically saying "the unstandardized XZVER and XZHDR commands can be 
efficiently replaced with COMPRESS")

-- 
Julien ÉLIE

« N'écoutant que son courage qui ne lui disait rien, il se garda
   d'intervenir. » (Jules Renard)

Re: About compression with NNTP
#87209
Author: Ken Murchison
Date: Thu, 12 Nov 2015 19:26
83 lines
4395 bytes
On 11/12/2015 02:04 PM, Julien ÉLIE wrote:
> Hi Ken,
>
>>>> The only counter-arguments I would have is the fact that
>>>> STARTCOMPRESSION could be read as "straight after the successful
>>>> response of the server, every exchange is compressed".
>>>> And, in case it could be useful for clients, we could define
>>>> ENDCOMPRESSION, that purely removes compression.
>>>
>>> This syntax IMHO looks nice (for a protocol like NNTP, that is designed
>>> to be human readable too), but is more complicated. I think we should
>>> only use it if the option "END" is really required.
>>
>> Agreed, is there an actual use case for disabling compression once it
>> has been enabled?
>
> The only use case I see is for news readers dedicated to binaries.  
> Some of them have implemented the XZVER and XZHDR commands to 
> respectively download compressed overview and headers.
> http://helpdesk.astraweb.com/index.php?_m=news&_a=viewnews&newsid=9
>
> Afterwards, article bodies are downloaded with normal ARTICLE or BODY 
> commands, without compression.  The bodies are already in a compressed 
> form (using for instance yEnc).
>
> The client is therefore actor of the compression it wants.
> (Whereas the text that previously was in Section 3 of the first 
> version of the draft regarding binary and uncompressible attachments 
> was server-oriented.  Maybe it was the reason why the text was 
> removed, or maybe because it was not generic enough.)
>
>
> A possible use case would then be:
>
> STARTCOMPRESSION
> GROUP my.group
> OVER 1000-
> ENDCOMPRESSION
> ARTICLE 1000
> ARTICLE 1001
> [...]
> STARTCOMPRESSION
> GROUP my.group2
> OVER 7000-
> ENDCOMPRESSION
> ARTICLE 7000
> ARTICLE 7001
> [...]
>
>
> XZVER and XZHDR would then no longer be needed.
>
>
>
>> If the client wants to stop compression (or TLS) on a particular
>> connection, it can simply QUIT and open a new connection.
>
> It is true that the client could do that with COMPRESS, or also open 
> several parallel connections (one compressed to download overview, 
> others uncompressed to download articles).
>
> Could a sentence mention that use case in the draft?  (something 
> basically saying "the unstandardized XZVER and XZHDR commands can be 
> efficiently replaced with COMPRESS")
>

I'm actually not sure I care about interoperability with non-standard 
extensions.  That being said, if a client does do COMPRESS + XZVER, the 
server should be smart enough to either disable/reject the XZ* commands 
or to set the compression level to 0 at the COMPRESS layer for the XZ* 
responses.

I thought the text that was removed was generic enough (for both POST 
and BODY, etc) but maybe not.  I will have to dig around the ietf-nntp 
mailing list to see what the issue was with that text.

-- 
Kenneth Murchison
Principal Systems Software Engineer
Carnegie Mellon University


Re: About compression with NNTP
#87210
Author: Julien ÉLIE
Date: Thu, 12 Nov 2015 20:35
56 lines
3744 bytes
Hi Ken,

>> Could a sentence mention that use case in the draft?  (something
>> basically saying "the unstandardized XZVER and XZHDR commands can be
>> efficiently replaced with COMPRESS")
>
> I'm actually not sure I care about interoperability with non-standard
> extensions.  That being said, if a client does do COMPRESS + XZVER, the
> server should be smart enough to either disable/reject the XZ* commands
> or to set the compression level to 0 at the COMPRESS layer for the XZ*
> responses.

I was not speaking about interoperability of COMPRESS+XZVER but the fact 
that implementing COMPRESS removes the need of XZVER and XZHDR.

If you do not want to mention these commands, which I perfectly 
understand, I suggest to only add a sentence about the possible use of 
two parallel or consecutive connections to download overview data and/or 
headers via the first connection (using a compression layer) and bodies 
on the second (without any compression layer) if the client knows they 
are already in a compressed form (yEnc-encoded for instance).



> I thought the text that was removed was generic enough (for both POST
> and BODY, etc) but maybe not.  I will have to dig around the ietf-nntp
> mailing list to see what the issue was with that text.

It was a discussion between the two of us:

     http://lists.eyrie.org/pipermail/ietf-nntp/2010-January/006157.html

%%
 >> A very simple strategy is to change the level to 0 at the start of
 >> a multi-line data block provided the first two bytes are either
 >> 0x1F 0x8B (as in deflate-compressed files) or 0xFF 0xD8 (JPEG),
 >> and to keep it at 1-5 the rest of the time.
 >
 > It would apply to BODY only (at the start of a multi-line data block).

It would also apply to ARTICLE, POST, IHAVE, TAKETHIS.

 > But we usually have a MIME message or yEnc.  Not a binary file.

Correct, so this text can probably be removed.  IMAP has the ability to
fetch individual MIME parts, and an extension to do so with any CTE
stripped.
%%

-- 
Julien ÉLIE

« N'écoutant que son courage qui ne lui disait rien, il se garda
   d'intervenir. » (Jules Renard)

Re: About compression with NNTP
#87215
Author: Ken Murchison
Date: Thu, 12 Nov 2015 21:12
47 lines
3791 bytes
On 11/12/2015 03:35 PM, Julien ÉLIE wrote:
> Hi Ken,
>
>>> Could a sentence mention that use case in the draft?  (something
>>> basically saying "the unstandardized XZVER and XZHDR commands can be
>>> efficiently replaced with COMPRESS")
>>
>> I'm actually not sure I care about interoperability with non-standard
>> extensions.  That being said, if a client does do COMPRESS + XZVER, the
>> server should be smart enough to either disable/reject the XZ* commands
>> or to set the compression level to 0 at the COMPRESS layer for the XZ*
>> responses.
>
> I was not speaking about interoperability of COMPRESS+XZVER but the 
> fact that implementing COMPRESS removes the need of XZVER and XZHDR.
>
> If you do not want to mention these commands, which I perfectly 
> understand, I suggest to only add a sentence about the possible use of 
> two parallel or consecutive connections to download overview data 
> and/or headers via the first connection (using a compression layer) 
> and bodies on the second (without any compression layer) if the client 
> knows they are already in a compressed form (yEnc-encoded for instance).

The client shouldn't have to do this.  The whole point of the verbiage 
in Section 3 is/was to inform a server author that it can and should 
adjust the compression setting based on the content that it is sending.  
The server should use a compression setting > 0 for  the OVER, etc 
responses.  The server should use a compression setting = 0 for the 
BODY, etc responses if/when the content is already compressed.  The 
server is in a much better position to understand the content and is 
able to adjust the compression setting on the fly within the connection.

This is what is outlined in IMAP COMPRESS with similar text that we 
removed from NNTP COMPRESS, and at the very least, the Cyrus IMAP server 
does adjust the compression level according to the content.

Note that the compression levels of what the client sends to the server 
and what the server sends to the client can be different from one 
another.  They are two separate streams with separate dictionaries.

-- 
Kenneth Murchison
Principal Systems Software Engineer
Carnegie Mellon University


Page 1 of 2 • 72 total messages
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads