2
0

Some better memory maintenance.

This commit is contained in:
Maarten Billemont
2014-12-21 12:37:21 -05:00
parent 0ccd545dd4
commit 73c10906e3
4 changed files with 34 additions and 11 deletions

View File

@@ -6,13 +6,15 @@
// Copyright (c) 2014 Lyndir. All rights reserved.
//
#define MP_dkLen 64
/** Derive the master key for a user based on their name and master password.
* @return A new 64-byte allocated buffer. */
* @return A new MP_dkLen-byte allocated buffer or NULL if an allocation error occurred. */
const uint8_t *mpw_masterKeyForUser(
const char *fullName, const char *masterPassword);
/** Encode a password for the site from the given master key and site parameters.
* @return A newly allocated string. */
* @return A newly allocated string or NULL if an allocation error occurred. */
const char *mpw_passwordForSite(
const uint8_t *masterKey, const char *siteName, const MPSiteType siteType, const uint32_t siteCounter,
const MPSiteVariant siteVariant, const char *siteContext);