2
0

Support for dynamically linking libscrypt & libsodium as alternative to statically linking Tarsnap's scrypt.

This commit is contained in:
Maarten Billemont
2017-04-08 14:25:54 -04:00
parent 98c5ee3425
commit 4058d33202
10 changed files with 170 additions and 40 deletions

View File

@@ -13,7 +13,6 @@
#include <errno.h>
#include <sys/time.h>
#include <scrypt/sha256.h>
#include <bcrypt/ow-crypt.h>
#include "mpw-algorithm.h"

View File

@@ -213,8 +213,12 @@ int main(int argc, char *const argv[]) {
// Summarize operation.
const char *identicon = mpw_identicon( fullName, masterPassword );
fprintf( stderr, "%s's password for %s:\n[ %s ]: ", fullName, siteName, identicon );
mpw_free_string( identicon );
if (!identicon) {
err( "Couldn't determine identicon.\n" );
} else {
fprintf( stderr, "%s's password for %s:\n[ %s ]: ", fullName, siteName, identicon );
mpw_free_string( identicon );
}
// Output the password.
const uint8_t *masterKey = mpw_masterKeyForUser(

View File

@@ -15,6 +15,11 @@ int main(int argc, char *const argv[]) {
int failedTests = 0;
xmlNodePtr tests = xmlDocGetRootElement( xmlParseFile( "mpw_tests.xml" ) );
if (!tests) {
ftl( "Couldn't find test case: mpw_tests.xml\n" );
abort();
}
for (xmlNodePtr testCase = tests->children; testCase; testCase = testCase->next) {
if (testCase->type != XML_ELEMENT_NODE || xmlStrcmp( testCase->name, BAD_CAST "case" ) != 0)
continue;