CPSPluginDefines.h [plain text]
#ifndef __CPSPLUGINDEFINES__
#define __CPSPLUGINDEFINES__
#ifdef __cplusplus
#include <PasswordServer/CReplicaFile.h>
extern "C" {
#endif
#include <stdio.h>
#include <openssl/rc5.h>
#include <openssl/cast.h>
#include <netdb.h>
#include "sasl.h"
#include "AuthFile.h"
#include "key.h"
#ifdef __cplusplus
};
#else
typedef void CReplicaFile;
#endif
#define kDHX_SASL_Name "DHX"
#define kAuthNative_Priority "DIGEST-MD5 CRAM-MD5 DHX TWOWAYRANDOM"
#define kPasswordServerPrefixStr "/PasswordServer/"
#define kSASLListPrefix "(SASL "
#define kEmptyPasswordAltStr "<1-empty-insecure-1>"
#define kPasswordServerPortStr "3659"
#define kMaxUserNameLength 255
typedef struct AuthInfo {
char username[kMaxUserNameLength + 1];
char *password;
long passwordLen;
Boolean successfulAuth;
bool methodCanSetPassword;
} AuthInfo;
typedef struct sPSServerEntry {
int fd;
bool lastContact;
bool ipFromNode;
char ip[64];
char port[12];
char dns[256];
char id[34];
} sPSServerEntry;
typedef struct sPSContextData {
char *psName; char psPort[10]; unsigned long offset; char localaddr[NI_MAXHOST + NI_MAXSERV + 1];
char remoteaddr[NI_MAXHOST + NI_MAXSERV + 1];
sasl_conn_t *conn;
FILE *serverIn, *serverOut;
int fd;
sasl_callback_t callbacks[5];
char *rsaPublicKeyStr;
Key *rsaPublicKey;
char rsaPublicKeyHash[34];
AuthMethName *mech;
int mechCount;
AuthInfo last; AuthInfo nao;
CReplicaFile *replicaFile;
CFMutableArrayRef serverList;
sPSServerEntry serverProvidedFromNode;
bool providedNodeOnlyOrFail;
RC5_32_KEY rc5Key;
bool madeFirstContact;
char *syncFilePath;
unsigned long pushByteCount;
unsigned char psIV[10];
bool castKeySet;
CAST_KEY castKey;
unsigned char castIV[10];
unsigned char castReceiveIV[10];
} sPSContextData;
typedef struct sPSContinueData {
unsigned long fAuthPass;
unsigned char * fData;
unsigned long fDataLen;
sasl_secret_t * fSASLSecret;
char fUsername[kMaxUserNameLength + 1];
unsigned long fDataPos;
} sPSContinueData;
#endif