#ifndef __AUTH_HELPER_UTILS__
#define __AUTH_HELPER_UTILS__
#include <CoreFoundation/CoreFoundation.h>
#include "CDSLocalPlugin.h"
#include "CDSAuthDefs.h"
#include "CAuthAuthority.h"
#define kLocalKDCRealmCacheTimeout 5
__BEGIN_DECLS
tDirStatus GetStateFilePath( const char *inHashPath, char **outStateFilePath );
tDirStatus ReadShadowHash(
const char *inUserName,
const char *inGUIDString,
unsigned char outHashes[kHashTotalLength],
struct timespec *outModTime,
char **outUserHashPath,
SInt32 *outHashDataLen,
bool readHashes );
tDirStatus ReadStateFile(
const char *inUserName,
const char *inGUIDString,
struct timespec *outModTime,
char **outUserHashPath,
char **outStateFilePath,
sHashState *inOutHashState,
SInt32 *outHashDataLen );
int ReadHashStateFile( const char *inFilePath, sHashState *inOutHashState );
tDirStatus GetUserPolicies(
CFMutableDictionaryRef inMutableRecordDict,
sHashState* inState,
CDSLocalPlugin* inPlugin,
char** outPolicyStr );
tDirStatus
OpenPasswordServerNode(
CDSLocalPlugin *inPlugin,
CFMutableDictionaryRef inNodeDict,
const char *inServerAddr,
tDirReference *outDSRef,
tDirNodeReference *outNodeRef );
tDirStatus
OpenLDAPNode(
CDSLocalPlugin *inPlugin,
CFMutableDictionaryRef inNodeDict,
tDataListPtr inNodeName,
tDirReference *outDSRef,
tDirNodeReference *outNodeRef );
void
LoadAuthAuthorities(
CDSLocalPlugin* inPlugin,
tRecordReference inRecordRef,
CAuthAuthority &inOutAATank );
tDirStatus
SaveAuthAuthorities(
CDSLocalPlugin* inPlugin,
tDirNodeReference inNodeRef,
const char *inUsername,
CFStringRef inNativeRecType,
CAuthAuthority &inAATank );
tDirStatus
SaveAuthAuthoritiesWithRecordRef(
CDSLocalPlugin* inPlugin,
tDirNodeReference inNodeRef,
tRecordReference inRecordRef,
CAuthAuthority &inAATank );
tDirStatus
SetUserAuthAuthorityAsRoot(
CFMutableDictionaryRef inMutableRecordDict,
CDSLocalPlugin* inPlugin,
CDSLocalPluginNode* inNode,
CFStringRef inStdRecType,
const char *inUsername,
const char *inAuthAuthority,
tDirNodeReference inNodeRef,
bool inRemoveBasic );
void
AddKerberosAuthAuthority(
tDirNodeReference inNodeRef,
const char *inPrincName,
const char *inAuthAuthorityTag,
CAuthAuthority &inAuthAuthorityList,
CFMutableDictionaryRef inMutableRecordDict,
CDSLocalPlugin* inPlugin,
CDSLocalPluginNode* inNode,
CFStringRef inNativeRecType,
bool inOKToChangeAuthAuthorities );
char *
GetLocalKDCRealmWithCache(
time_t inMaxTimeUntilQuery );
tDirStatus
SASLErrToDirServiceError(
int inSASLError );
__END_DECLS
#endif