2
0

Split the API into the three distinct phases of the mpw algorithm.

This commit is contained in:
Maarten Billemont
2017-08-01 08:31:39 -04:00
parent 13107063df
commit 3c5cb1673a
15 changed files with 163 additions and 92 deletions

View File

@@ -311,16 +311,17 @@ int main(int argc, char *const argv[]) {
mpw_free_string( identicon );
// Output the password.
MPMasterKey masterKey = mpw_masterKeyForUser(
MPMasterKey masterKey = mpw_masterKey(
fullName, masterPassword, algorithmVersion );
mpw_free_string( masterPassword );
mpw_free_string( fullName );
if (!masterKey)
ftl( "Couldn't derive master key." );
const char *sitePassword = mpw_passwordForSite(
masterKey, siteName, siteType, siteCounter, siteVariant, siteContextArg, algorithmVersion );
MPSiteKey siteKey = mpw_siteKey( masterKey, siteName, siteCounter, siteVariant, siteContextArg, algorithmVersion );
const char *sitePassword = mpw_sitePassword(siteKey, siteType, algorithmVersion );
mpw_free( masterKey, MPMasterKeySize );
mpw_free( siteKey, MPSiteKeySize );
mpw_free_string( siteName );
if (!sitePassword)
ftl( "Couldn't derive site password." );