1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-06-14 23:44:58 +02:00

Improve type safety of interfaces and drivers.

The function pointer casting used when creating drivers made changing interfaces difficult and led to slightly divergent driver implementations.  Unit testing caught production-level errors but there were a lot of small issues and the process was harder than it should have been.

Use void pointers instead so that no casts are required.  Introduce the THIS_VOID and THIS() macros to make dealing with void pointers a little safer.

Since we don't want to expose void pointers in header files, driver functions have been removed from the headers and the various driver objects return their interface type.  This cuts down on accessor methods and the vast majority of those functions were not being used.  Move functions that are still required to .intern.h.

Remove the special "C" crypto functions that were used in libc and instead use the standard interface.
This commit is contained in:
David Steele
2019-05-02 17:52:24 -04:00
parent 28359eea83
commit 8c712d89eb
104 changed files with 2701 additions and 4219 deletions

View File

@ -59,7 +59,7 @@ sub run
$self->testException(
sub {new pgBackRest::Storage::Filter::CipherBlock(
$oDriver->openRead($strFile), BOGUS, $tCipherPass)},
ERROR_ASSERT, "unable to load cipher '" . BOGUS . "'");
ERROR_ASSERT, "invalid cipher name '" . BOGUS . "'");
$self->testException(
sub {new pgBackRest::Storage::Filter::CipherBlock(
@ -69,7 +69,7 @@ sub run
$self->testException(
sub {new pgBackRest::Storage::Filter::CipherBlock(
$oDriver->openWrite($strFile), BOGUS, $tCipherPass)},
ERROR_ASSERT, "unable to load cipher '" . BOGUS . "'");
ERROR_ASSERT, "invalid cipher name '" . BOGUS . "'");
}
################################################################################################################################