Displaying 2 results from an estimated 2 matches for "seckeychainitemfreecont".
2007 Aug 24
0
rsync patch to add Apple keychain support
...ude <CoreServices/CoreServices.h>
OSStatus SecKeychainFindGenericPassword(CFTypeRef keychainOrArray,
UInt32 serviceNameLength, const char *serviceName, UInt32
accountNameLength, const char *accountName, UInt32 *passwordLength,
void **passwordData, SecKeychainItemRef *itemRef);
OSStatus SecKeychainItemFreeContent(SecKeychainAttributeList *attrList,
void *data);
static int get_secret_from_keychain(int module, char *user, char
*secret, unsigned secretmaxlen)
{
char accountname[100] = "";
char* modulename = lp_name(module);
strcat(accountname, modulename);
strcat(accountname, "-&qu...
2004 Jan 06
1
Keychain Patch Try II
...) ==
noErr) {
- /* Then we got the password from the Keychain */
- fprintf(stderr, "%s found in Keychain.", prompt);
- strncpy(buf, (char *)password_data, (size < password_length+1 ?
size : password_length + 1));
- memset(password_data, 'x', password_length);
- SecKeychainItemFreeContent(NULL, password_data);
- return 0; /* Success */
- } else {
- return -1; /* Couldn't get anything from the keychain */
- }
-}
-
-int store_passphrase_on_keychain(const char *prompt, const char buf[])
-{
- if (SecKeychainAddGenericPassword(NULL, strlen(prompt), prompt,
strlen(prompt)...