SecKeychainRef ...; SecKeychainStatus status; err = SecKeychainGetStatus(keychain, &status); if(err == noErr) { if((err = SecKeychainUnlock(keychain, keychainPassword.size(), pass, pass != 0))) { throw unable to unlock keychain; } } else if(err == errSecNoSuchKeychain) { const char* pass = keychainPassword.empty() ? 0 : keychainPassword.c_str(); if((err = SecKeychainCreate(keychainPath.c_str(), keychainPassword.size(), pass, pass == 0, 0, &keychain))) { throw unable to create keychain; } k.reset(keychain); }I use a code like this to Unlock the keychain and create it if not exists, then I have a test case were several servers use the same keychain, and they could run this code concurrently if separate processes.In such case I see that SecKeychainGetStatus some times fails with error: 100022 description: UNIX[Invalid argument]. Could this be related to concurrent calls to SecKeychainUnlock/SecKeychainCreate on the same keychain?Any recomendations on how to handle this execenario in wich several
1
0
513