🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
9 messages
9 total messages Started by Aioe Thu, 23 Oct 2008 12:14
Cancel-Key and Cancel-Lock
#79553
Author: Aioe
Date: Thu, 23 Oct 2008 12:14
2 lines
875 bytes
Do you know where i can find documentation about them?
(I need to know how to implement it)
Re: Cancel-Key and Cancel-Lock
#79548
Author: Xavier Roche
Date: Thu, 23 Oct 2008 12:51
7 lines
1271 bytes
Aioe wrote:
> Do you know where i can find documentation about them?
> (I need to know how to implement it)

It seems that there is only an (expired) draft from 1999:
<http://tools.ietf.org/html/draft-ietf-usefor-cancel-lock-01>
Re: Cancel-Key and Cancel-Lock
#79549
Author: Ray Banana
Date: Thu, 23 Oct 2008 12:52
13 lines
1890 bytes
Thus spake Aioe <estasi@aioe.org>
 
> Do you know where i can find documentation about them?
> (I need to know how to implement it)

http://tools.ietf.org/html/draft-ietf-usefor-cancel-lock-01

If you are interested, I can mail you the code I use in my
implementation of Postfilter.

-- 
Time flies like an arrow, fruit flies like a Banana.
http://news.motzarella.org
Re: Cancel-Key and Cancel-Lock
#79551
Author: Aioe
Date: Thu, 23 Oct 2008 12:55
15 lines
1363 bytes
Aioe wrote:

> Do you know where i can find documentation about them?
> (I need to know how to implement it)

i'm trying to understand how Cancel-Key works. It sounds a bit strange for
me.
When an user adds the Cancel-Key header, which algorithm he has to use in
order to generate it? Since this is probably done by a newsreader, which
alogrithms are used?
When a server receives a cancel message (which header has the user to use:
Control cancel or Supersedes or Cancel?) which kind of checks it's needed
to do?

Re: Cancel-Key and Cancel-Lock
#79558
Author: Aioe
Date: Thu, 23 Oct 2008 13:14
10 lines
1179 bytes
Ray Banana wrote:

> If you are interested, I can mail you the code I use in my
> implementation of Postfilter.

yes, of course.
thank you again and again

which are the differences between my and your implementation of postfilter?
(i'm searching new features to add to postfilter)
Re: Cancel-Key and Cancel-Lock
#79554
Author: Ray Banana
Date: Thu, 23 Oct 2008 13:15
29 lines
2480 bytes
Thus spake Aioe <estasi@aioe.org>
 
> Aioe wrote:

> When an user adds the Cancel-Key header, which algorithm he has to use in
> order to generate it? Since this is probably done by a newsreader, which
> alogrithms are used?

This is explained in 

http://tools.ietf.org/html/draft-ietf-usefor-cancel-lock-01

> When a server receives a cancel message (which header has the user to use:
> Control cancel or Supersedes or Cancel?) which kind of checks it's needed
> to do?

Both Control: cancel and Supersedes: should be  checked, as supersedes
are implicit cancels. Basically, you will have to check if the cancel key
provided with the control messages matches the cancel lock contained in
the original article. Take a look at Alexander Bartolich's sample in

<f683h5$51u$7@news.albasani.net>
<f8ffta$dd1$3@news.albasani.net>

Even though it's in German, the code should be intelligible.

-- 
Time flies like an arrow, fruit flies like a Banana.
http://news.motzarella.org
Re: Cancel-Key and Cancel-Lock
#79555
Author: Ray Banana
Date: Thu, 23 Oct 2008 13:22
18 lines
2159 bytes
Thus spake Aioe <estasi@aioe.org>
 
>> If you are interested, I can mail you the code I use in my
>> implementation of Postfilter.
> yes, of course.

I will mail it tonight, when I'm back from the office.

> which are the differences between my and your implementation of postfilter?
> (i'm searching new features to add to postfilter)

I have lots of LDAP related stuff in it, as I use LDAP for
authentication and authorization information. Most features require that
a user has an account name, so it won't be useful for aioe. 

-- 
Time flies like an arrow, fruit flies like a Banana.
http://news.motzarella.org
Re: Cancel-Key and Cancel-Lock
#79556
Author: Alexander Bartolich
Date: Thu, 23 Oct 2008 13:22
14 lines
1703 bytes
Ray Banana wrote:
> [...] Take a look at Alexander Bartolich's sample in
>
><f683h5$51u$7@news.albasani.net>
><f8ffta$dd1$3@news.albasani.net>
>
> Even though it's in German, the code should be intelligible.

The code I have in use is published here:

http://albasani.net/viewvc.cgi/trunk/lib/Schnuerpel/INN/?root=schnuerpel

-- 
usingwhitespaceisracism
Re: Cancel-Key and Cancel-Lock
#79557
Author: Alexander Bartolich
Date: Thu, 23 Oct 2008 16:36
49 lines
3185 bytes
Aioe schrieb:
> [...]
> When an user adds the Cancel-Key header, which algorithm he has to use in
> order to generate it? Since this is probably done by a newsreader, which
> alogrithms are used?

First a key is generated. The lock is then defined as

  $lock = encode_base64(sha1($key))

This lock is then published as Cancel-Lock.

It is assumed that sha1 has no reverse operation, i.e. for the general
case it's practically impossible to calculate $key from $lock. This
means that only the original publisher of Cancel-Lock can later on
present a matching Cancel-Key.

One straightforward method to generate $key is to just gather some
random bits. However, that would mean that the publisher would have
to remember every generated $key.

The other extreme, having one $key for all messages, does not work
since the first published Cancel-Key would then reveal the secret
for all published messages.

The middle ground is to base $key on a combination of message ID
and a master key. Since the message ID is by definition unique this
results in a different $key for every post but does not require the
publisher to remember each $key.

  $digest = Digest::HMAC_SHA1::hmac_sha1($message_id, $master_key);
  $cancel_key = MIME::Base64::encode($digest, '');
  $cancel_lock = MIME::Base64::encode(Digest::SHA1::sha1($cancel_key, ''));

Only few newsreaders support Cancel-Lock. Fortunately it can be
implemented transparently by the newsserver.

> When a server receives a cancel message (which header has the user to use:
> Control cancel or Supersedes or Cancel?) which kind of checks it's needed
> to do?

Cancel-Lock can be used for both cancel controls and supersedes.

However, the correct response to a supersede with broken or missing
Cancel-Key is to keep both the original post and the new post. With
INN this requires option -C and a filter script that calls INN::cancel.

-- 
usingwhitespaceisracism
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