This is not the same stuff I was talking about before.

Summary: I've got 3 different segfaults here, and quite a lot of
documentation failures.  If you want me to send an updated man page,
I'd be happy to, just let me know.

I made a very simple structure like so:

mkdir orig
cd orig
mkdir -p a/b/c
mkdir -p d/e/f
touch a/b/c/foo
touch d/e/f/bar

Encrypted like so:

rsyncrypto --ne-nesting=5 --name-encrypt=filemap -c -v -r orig orig.enc 
orig.keys /var/tmp/rcb/backup.crt

Now, I would like to be able to do cold decryption.  The man page
doesn't say how the keys directory is supposed to be defined when
one is doing this, so I just changed the keys directory name to a
directory that doesn't exist, and deleted the filemap, like so:

[EMAIL PROTECTED]> ls -l                                      
total 16
drwxr-xr-x 4 rlpowell users 4096 2008-02-17 10:11 orig/
drwxr-xr-x 4 rlpowell users 4096 2008-02-17 10:12 orig.enc/

[EMAIL PROTECTED]> rsyncrypto --ne-nesting=5 --name-encrypt=filemap -d -v -r 
orig.enc plain plain.keys /var/tmp/rcb/backup.crt
[1]    13122 segmentation fault (core dumped)  rsyncrypto --ne-nesting=5 
--name-encrypt=filemap -d -v -r orig.enc plain

Well, that's a bit uncool.  :)  It'd be nice if --name-encrypt=
understood that in -d mode, I mean the filemap in the encrypted
directory, but oh well, let's try again:

[EMAIL PROTECTED]> rsyncrypto --ne-nesting=5 --name-encrypt=orig.enc/filemap -d 
-v -r orig.enc plain plain.keys /var/tmp/rcb/backup.crt
[1]    13190 bus error (core dumped)  rsyncrypto --ne-nesting=5 
--name-encrypt=orig.enc/filemap -d -v -r orig.enc

Oh, but wait, it gets better!  In this case, it *deleted the
filemap*:

[EMAIL PROTECTED]> ls -l orig.enc/filemap                         
-rw-r--r-- 1 rlpowell users 0 2008-02-17 10:14 orig.enc/filemap

which means my ability to get back what I encrypted is gone forever.
:(

OK, trying again; deleted the encrypted versions, encrypted again,
deleted the filemap, but *not* the keys, for testing:

[EMAIL PROTECTED]> ls -l                                       
total 12
drwxr-xr-x 4 rlpowell users 4096 2008-02-17 10:11 orig/
drwxr-xr-x 4 rlpowell users 4096 2008-02-17 10:20 orig.enc/
drwx------ 4 rlpowell users 4096 2008-02-17 10:20 orig.keys/


[EMAIL PROTECTED]> rsyncrypto --ne-nesting=5 --name-encrypt=orig.enc/filemap -d 
-v -r orig.enc plain orig.keys /var/tmp/rcb/backup.crt
Unexcpeted end of file past sanity checks:

gzip: stdin: unexpected end of file

Not exactly a helpful error message.  And!:

[EMAIL PROTECTED]> ls -l orig.enc/filemap                         
-rw-r--r-- 1 rlpowell users 0 2008-02-17 10:21 orig.enc/filemap

Boom; no more decryption.

As far as I can tell, the *only* way to get back the file structure
you've used --name-encrypt in a cold decryption sort of way is to
decrypt the filemap by hand first, so let's try that:

[EMAIL PROTECTED]> ls -l
total 8
drwxr-xr-x 4 rlpowell users 4096 2008-02-17 10:11 orig/
drwxr-xr-x 4 rlpowell users 4096 2008-02-17 10:23 orig.enc/
[EMAIL PROTECTED]> rsyncrypto -d -v -r orig.enc/filemap filemap enc.keys 
/var/tmp/rcb/backup.crt
opendir failed(orig.enc/filemap): Not a directory

OK, fair enough.  But it turns out that despite me specifying a
single file, it created directories for both the plaintext and the
key.  It "explains" this to me via:

[EMAIL PROTECTED]> rsyncrypto -d -v orig.enc/filemap filemap enc.keys 
/var/tmp/rcb/backup.crt
mmap failed: No such device

OK, deleted those; all that's in my directory are orig and orig.enc,
trying again:

[EMAIL PROTECTED]> rsyncrypto -d -v orig.enc/filemap filemap enc.keys 
/var/tmp/rcb/backup.crt
[1]    14472 segmentation fault (core dumped)  rsyncrypto -d -v 
orig.enc/filemap filemap enc.keys /var/tmp/rcb/backup.crt

This results in a 0-length filemap, but at least it doesn't destroy
orig.enc/filemap.

Try again with the key instead of the crt:

[EMAIL PROTECTED]> rsyncrypto -d -v orig.enc/filemap filemap enc.keys 
/var/tmp/rcb/backup.key

Hey, it (silently, despite -v) works!

enc.keys is a file rather than a directory, but that seems
acceptable; I rename it to filemap.key

Let's try the rest:

[EMAIL PROTECTED]> rsyncrypto --ne-nesting=5 --name-encrypt=filemap -d -v -r 
orig.enc plain enc.keys /var/tmp/rcb/backup.crt
[1]    15237 segmentation fault (core dumped)  rsyncrypto --ne-nesting=5 
--name-encrypt=filemap -d -v -r orig.enc plain

Whoops; forgot to use the .key again.  Not much of an error message
for that, though.  :D

[EMAIL PROTECTED]> rsyncrypto --ne-nesting=5 --name-encrypt=filemap -d -v -r 
orig.enc plain enc.keys /var/tmp/rcb/backup.key
Decrypting orig.enc/3/3E/3E3/3E3F/3E3FB/3E3FB217E4402B24028FB16546A277F3
Decrypting orig.enc/0/06/06B/06B7/06B70/06B70BE9FB8259E0191FA049104225CD

Would be nice if it said the target file names instead of the hashed
ones, but that's very minor.

But *yay*, it did actually work.

-Robin


-- 
Lojban Reason #17: http://en.wikipedia.org/wiki/Buffalo_buffalo
Proud Supporter of the Singularity Institute - http://singinst.org/
http://www.digitalkingdom.org/~rlpowell/ *** http://www.lojban.org/

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Rsyncrypto-devel mailing list
Rsyncrypto-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rsyncrypto-devel

Reply via email to