[tahoe-dev] about cap

David-Sarah Hopwood david-sarah at jacaranda.org
Wed Aug 4 06:31:10 UTC 2010


Zooko O'Whielacronx wrote:
> Hi Yu Xue.
> 
> Okay, I looked at this file:
> 
> http://tahoe-lafs.org/trac/tahoe-lafs/browser/trunk/src/allmydata/uri.py
> 
> The step that I was suggesting to you--to define a new URI type which
> is just like the old type but uses a new encryption scheme--would
> probably involve copying each of the following classes to a new class
> and then changing the name of it and the URI prefix that it matches,
> something like the following. Take the following set of Python class:
> string prefix:
> 
> CHKFileURI: 'URI:CHK:'
> CHKFileVerifierURI: 'URI:CHK-Verifier:'
> WriteableSSKFileURI: 'URI:SSK:'
> ReadonlySSKFileURI: 'URI:SSK-RO:'
> SSKVerifierURI: 'URI:SSK-Verifier:'
> DirectoryURI: 'URI:DIR2:'
> ReadonlyDirectoryURI: 'URI:DIR2-RO:'
> ImmutableDirectoryURI: 'URI:DIR2-CHK:'
> LiteralDirectoryURI: 'URI:DIR2-LIT:'
> DirectoryURIVerifier: 'URI:DIR2-Verifier:'
> ImmutableDirectoryURIVerifier: 'URI:DIR2-CHK-Verifier:'
> 
> and make a new set of classes in addition to the ones that already
> exist (above), something like:
> 
> CHKFileXURI: 'URI:CHKX:'
> CHKFileXVerifierURI: 'URI:CHKX-Verifier:'
> WriteableSSKXFileURI: 'URI:SSKX:'
> ReadonlySSKXFileURI: 'URI:SSKX-RO:'
> SSKXVerifierURI: 'URI:SSKX-Verifier:'
> DirectoryXURI: 'URI:DIR2X:'
> ReadonlyDirectoryXURI: 'URI:DIR2X-RO:'
> ImmutableDirectoryXURI: 'URI:DIR2X-CHK:'
> DirectoryXURIVerifier: 'URI:DIR2X-Verifier:'
> ImmutableDirectoryXURIVerifier: 'URI:DIR2-CHKX-Verifier:'

Alternatively, use the existing classes, but extend the URI-parsing code
in each class so that it sets a 'cipher' attribute based on the URI string.
For the time being, this can just be set to any two unique values
representing AES and AES+XSalsa20. I think this approach may involve less
code duplication and smaller changes overall.

> Then immediately add unit tests of the code in
> http://tahoe-lafs.org/trac/tahoe-lafs/browser/trunk/src/allmydata/test/test_uri.py
> so that they exercise the code you just created by
> cutting-and-pasting.

Yes, you'll need this with either approach.

> Note: you may receive some objections to this patch!

Even before you've written it :-)

-- 
David-Sarah Hopwood  ⚥  http://davidsarah.livejournal.com

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 292 bytes
Desc: OpenPGP digital signature
URL: <http://tahoe-lafs.org/pipermail/tahoe-dev/attachments/20100804/db184e66/attachment.pgp>


More information about the tahoe-dev mailing list