On Jun 15, 2007, at 5:18 AM, Kern Sibbald wrote:

Hello,

I am now working on bug #807, where decrypting files gets signature digest errors on each file restored. As far as I can tell, these are *false* error messages, most likely due to the fact that Microsoft BackupWrite() does not
restore exactly the same bits as BackupRead() gave.

Anyway, in looking at the encryption code in detail, which I have not totally finished, I come to realize that there are some important problems that need
fixing.

Thank you for spending the time on this code.

1. The code is rather inefficient from several stand points -- see items
    below.

2. It does a number of malloc() and free()s for each file backed up
    which is something that Bacula does not normally do.  Over time,
    I will fix this.

Given performance profiling, is this a demonstrable issue? Compared to the cost of the public-key operations, calling the OS' malloc() is a drop in the bucket, and even if the malloc() calls are somehow reduced/removed, OpenSSL is still going to make extensive dynamic allocations.

Moreover, by encapsulating data structures (rather than trying to re- use buffers from one big loop), I was able to avoid significant implementation complexity.

Ultimately my performance profiling has shown that the greatest gains would be made in adding support for HMAC validation as an alternative to per-file RSA signatures.

4. The current signature digest algorithm (as far as I can tell) is not saved on the Volume. The signature digest algorithm is compiled into the code, and it is a different algorithm depending on whether or not you have only SHA1 or you have SHA2 algorithms available. This is *very* bad. It means that if you rebuild your Bacula FD, it may not be able to compute a signature digest for a restore in the same way it did for the backup.

This isn't the case -- both the signature and digest algorithm are stored in the SignatureData->SignerInfo record and used on restoration. At no point does any part of the code make any assumptions regarding the algorithms of on-disk data -- I was very careful with this.

See crypto_sign_add_signer()

6. There are a good number of places where the error code returned is
     simply ignored.

OpenSSL errors?

-landonf

Attachment: PGP.sig
Description: This is a digitally signed message part

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users

Reply via email to