2006-01-19 00:34:21 +01:00
|
|
|
/***********************************************************************
|
|
|
|
*
|
2006-02-01 18:48:29 +01:00
|
|
|
* Copyright (C) 2005-2006 Novell, Inc. All Rights Reserved.
|
2006-01-19 00:34:21 +01:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; version 2.1
|
|
|
|
* of the License.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
2006-01-31 23:01:47 +01:00
|
|
|
* Library Lesser General Public License for more details.
|
2006-01-19 00:34:21 +01:00
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
2006-01-31 23:01:47 +01:00
|
|
|
* License along with this library; if not, Novell, Inc.
|
2006-01-19 00:34:21 +01:00
|
|
|
*
|
|
|
|
* To contact Novell about this file by physical or electronic mail,
|
|
|
|
* you may find current contact information at www.novell.com.
|
|
|
|
*
|
|
|
|
***********************************************************************/
|
|
|
|
|
2006-04-24 20:47:56 +02:00
|
|
|
#ifndef _SSCS_IPC_H
|
|
|
|
#define _SSCS_IPC_H
|
|
|
|
#include <micasa_types.h>
|
|
|
|
|
|
|
|
typedef uint8_t Byte;
|
|
|
|
#define MAX_SOCKET_PATH_LEN 256
|
|
|
|
#ifdef DEBUG
|
|
|
|
#define DMSG(x) printf x
|
|
|
|
#else
|
|
|
|
#define DMSG(x)
|
|
|
|
#endif
|
|
|
|
// Used for global buffers.
|
|
|
|
#define MIN_REQUEST_BUF_LEN 1024
|
|
|
|
#define MIN_REPLY_BUF_LEN 4096
|
|
|
|
|
|
|
|
#ifdef SSCS_LINUX_PLAT_F
|
|
|
|
#include "sscs_unx_ipc_client.h"
|
|
|
|
#include "sscs_unx_cache_defines.h"
|
|
|
|
#include <sscs_lldefs.h>
|
|
|
|
#include <errno.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
|
|
|
|
void* ipc_unx_create(void);
|
|
|
|
int ipc_unx_write(int fd, Byte *pData, int bytes);
|
|
|
|
int ipc_unx_read(int fd, Byte *pData, int bytes);
|
|
|
|
int ipc_unx_close(int fd);
|
|
|
|
|
|
|
|
#define IPC_CREATE(...) ipc_unx_create(__VA_ARGS__);
|
|
|
|
#define IPC_READ(...) ipc_unx_read(__VA_ARGS__);
|
|
|
|
#define IPC_WRITE(...) ipc_unx_write(__VA_ARGS__);
|
|
|
|
#define IPC_CLOSE(...) ipc_unx_close(__VA_ARGS__);
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
//#ifdef SSCS_WIN32_PLAT_F
|
|
|
|
|
|
|
|
#include <windows.h>
|
|
|
|
#include "sscs_unx_ipc_client.h"
|
|
|
|
#include "sscs_unx_cache_defines.h"
|
|
|
|
#include <sscs_lldefs.h>
|
|
|
|
#include <errno.h>
|
|
|
|
|
|
|
|
void * ipc_win_create(void);
|
|
|
|
int ipc_win_write(HANDLE hPipe, LPCVOID lpBuffer, DWORD bytesToWrite);
|
|
|
|
int ipc_win_read(HANDLE hPipe, LPVOID lpBuffer, DWORD numOfBytesToRead);
|
|
|
|
int ipc_win_close(HANDLE hPipe);
|
|
|
|
|
|
|
|
#define IPC_CREATE() ipc_win_create();
|
|
|
|
#define IPC_READ(s1,s2,s3) ipc_win_read(s1,s2,s3);
|
|
|
|
#define IPC_WRITE(s1,s2,s3) ipc_win_write(s1,s2,s3);
|
|
|
|
#define IPC_CLOSE(s1) ipc_win_close(s1);
|
|
|
|
|
|
|
|
//#endif
|
|
|
|
|
|
|
|
// function prototypes
|
|
|
|
int ipc_OpenSecretStore
|
|
|
|
(
|
|
|
|
void *secretStoreID,
|
|
|
|
SSCS_SECRETSTORE_HANDLE_T *ssHandle
|
|
|
|
);
|
|
|
|
|
|
|
|
int ipc_CloseSecretStore
|
|
|
|
(
|
|
|
|
SSCS_SECRETSTORE_HANDLE_T *ssHandle,
|
|
|
|
uint32_t ssFlags
|
|
|
|
);
|
|
|
|
|
|
|
|
int ipc_RemoveSecretStore
|
|
|
|
(
|
|
|
|
SSCS_SECRETSTORE_HANDLE_T *ssHandle
|
|
|
|
);
|
|
|
|
|
|
|
|
int ipc_EnumerateKeychainIDs
|
|
|
|
(
|
|
|
|
SSCS_SECRETSTORE_HANDLE_T *ssHandle,
|
|
|
|
SSCS_KEYCHAIN_ID_LIST_T *kcIDList
|
|
|
|
);
|
|
|
|
|
|
|
|
int ipc_AddKeychain
|
|
|
|
(
|
|
|
|
SSCS_SECRETSTORE_HANDLE_T *ssHandle,
|
|
|
|
unsigned int ssFlags,
|
|
|
|
SSCS_KEYCHAIN_ID_T *keychainID
|
|
|
|
);
|
|
|
|
|
|
|
|
int ipc_RemoveKeychain
|
|
|
|
(
|
|
|
|
SSCS_SECRETSTORE_HANDLE_T *ssHandle,
|
|
|
|
SSCS_KEYCHAIN_ID_T *keychainID
|
|
|
|
);
|
|
|
|
|
|
|
|
int ipc_EnumerateSecretIDs
|
|
|
|
(
|
|
|
|
SSCS_SECRETSTORE_HANDLE_T *ssHandle,
|
|
|
|
SSCS_KEYCHAIN_ID_T *keychainID,
|
|
|
|
SSCS_SECRET_ID_LIST_T *secretIDList
|
|
|
|
);
|
|
|
|
|
|
|
|
int ipc_ReadSecret
|
|
|
|
(
|
|
|
|
SSCS_SECRETSTORE_HANDLE_T *ssHandle,
|
|
|
|
SSCS_KEYCHAIN_ID_T *keychainID,
|
|
|
|
SSCS_SECRET_ID_T *secretID,
|
|
|
|
SSCS_SECRET_T *secretData,
|
|
|
|
SSCS_PASSWORD_T *epPassword,
|
|
|
|
unsigned int *bytesRequired
|
|
|
|
);
|
|
|
|
|
|
|
|
int ipc_WriteSecret
|
|
|
|
(
|
|
|
|
SSCS_SECRETSTORE_HANDLE_T *ssHandle,
|
|
|
|
unsigned int ssFlags,
|
|
|
|
SSCS_KEYCHAIN_ID_T *keychainID,
|
|
|
|
SSCS_SECRET_ID_T *secretID,
|
|
|
|
SSCS_SECRET_T *secretData,
|
|
|
|
SSCS_PASSWORD_T *epPassword,
|
|
|
|
SSCS_EXT_T *ext
|
|
|
|
);
|
|
|
|
|
|
|
|
int ipc_RemoveSecret
|
|
|
|
(
|
|
|
|
SSCS_SECRETSTORE_HANDLE_T *ssHandle,
|
|
|
|
SSCS_KEYCHAIN_ID_T *keychainID,
|
|
|
|
SSCS_SECRET_ID_T *secretID,
|
|
|
|
SSCS_PASSWORD_T *epPassword
|
|
|
|
);
|
|
|
|
|
|
|
|
int ipc_GetSecretStoreInfo
|
|
|
|
(
|
|
|
|
SSCS_SECRETSTORE_HANDLE_T *ssHandle,
|
|
|
|
SSCS_SECRETSTORE_INFO_T *ssInfo
|
|
|
|
);
|
|
|
|
|
|
|
|
int ipc_GetKeychainInfo
|
|
|
|
(
|
|
|
|
SSCS_SECRETSTORE_HANDLE_T *ssHandle,
|
|
|
|
SSCS_KEYCHAIN_ID_T *keychainID,
|
|
|
|
SSCS_KEYCHAIN_INFO_T *kcInfo
|
|
|
|
);
|
|
|
|
|
|
|
|
int ipc_LockCache
|
|
|
|
(
|
|
|
|
SSCS_SECRETSTORE_HANDLE_T *ssHandle
|
|
|
|
);
|
|
|
|
|
|
|
|
int ipc_UnlockCache
|
|
|
|
(
|
|
|
|
SSCS_SECRETSTORE_HANDLE_T *ssHandle,
|
|
|
|
SSCS_PASSCODE_T *passcode
|
|
|
|
);
|
|
|
|
|
|
|
|
int ipc_SetMasterPasscode
|
|
|
|
(
|
|
|
|
SSCS_SECRETSTORE_HANDLE_T *ssHandle,
|
|
|
|
SSCS_PASSCODE_T *passcode
|
|
|
|
);
|
|
|
|
|
2005-10-11 21:51:00 +02:00
|
|
|
int ipc_ReadKey
|
|
|
|
(
|
|
|
|
SSCS_SECRETSTORE_HANDLE_T *ssHandle,
|
|
|
|
SSCS_KEYCHAIN_ID_T *keychainID,
|
|
|
|
SSCS_SECRET_ID_T *secretID,
|
|
|
|
SS_UTF8_T *key,
|
|
|
|
uint32_t keyLen,
|
|
|
|
uint8_t *val,
|
2005-12-09 18:42:13 +01:00
|
|
|
uint32_t *valLen,
|
2005-10-11 21:51:00 +02:00
|
|
|
SSCS_PASSWORD_T *epPassword,
|
|
|
|
uint32_t *bytesRequired
|
2006-04-24 20:47:56 +02:00
|
|
|
);
|
|
|
|
|
2005-10-11 21:51:00 +02:00
|
|
|
int ipc_WriteKey
|
2006-04-24 20:47:56 +02:00
|
|
|
(
|
|
|
|
SSCS_SECRETSTORE_HANDLE_T *ssHandle,
|
|
|
|
uint32_t ssFlags,
|
|
|
|
SSCS_KEYCHAIN_ID_T *keychainID,
|
|
|
|
SSCS_SECRET_ID_T *secretID,
|
|
|
|
SS_UTF8_T *key,
|
|
|
|
uint32_t keyLen,
|
|
|
|
uint8_t *val,
|
|
|
|
uint32_t valLen,
|
|
|
|
SSCS_PASSWORD_T *epPassword,
|
|
|
|
SSCS_EXT_T *ext
|
|
|
|
);
|
|
|
|
|
2005-12-09 18:42:13 +01:00
|
|
|
int ipc_ReadBinaryKey
|
|
|
|
(
|
|
|
|
SSCS_SECRETSTORE_HANDLE_T *ssHandle,
|
|
|
|
SSCS_KEYCHAIN_ID_T *keychainID,
|
|
|
|
SSCS_SECRET_ID_T *secretID,
|
|
|
|
SS_UTF8_T *key,
|
|
|
|
uint32_t keyLen,
|
|
|
|
uint8_t *val,
|
|
|
|
uint32_t *valLen,
|
|
|
|
SSCS_PASSWORD_T *epPassword,
|
|
|
|
uint32_t *bytesRequired
|
2006-04-24 20:47:56 +02:00
|
|
|
);
|
|
|
|
|
|
|
|
int ipc_WriteBinaryKey
|
2005-10-11 21:51:00 +02:00
|
|
|
(
|
|
|
|
SSCS_SECRETSTORE_HANDLE_T *ssHandle,
|
|
|
|
uint32_t ssFlags,
|
|
|
|
SSCS_KEYCHAIN_ID_T *keychainID,
|
|
|
|
SSCS_SECRET_ID_T *secretID,
|
|
|
|
SS_UTF8_T *key,
|
|
|
|
uint32_t keyLen,
|
|
|
|
uint8_t *val,
|
|
|
|
uint32_t valLen,
|
|
|
|
SSCS_PASSWORD_T *epPassword,
|
|
|
|
SSCS_EXT_T *ext
|
2006-04-24 20:47:56 +02:00
|
|
|
);
|
|
|
|
|
2005-10-11 21:51:00 +02:00
|
|
|
int32_t ipc_SetMasterPassword
|
|
|
|
(
|
|
|
|
SSCS_SECRETSTORE_HANDLE_T *ssHandle,
|
|
|
|
SSCS_PASSWORD_T *passwd,
|
|
|
|
SSCS_HINT_T *hint
|
2006-04-24 20:47:56 +02:00
|
|
|
);
|
|
|
|
|
2005-10-11 21:51:00 +02:00
|
|
|
int ipc_IsSecretPersistent
|
|
|
|
(
|
|
|
|
SSCS_SECRETSTORE_HANDLE_T *ssHandle,
|
|
|
|
uint32_t ssFlags,
|
|
|
|
SSCS_KEYCHAIN_ID_T *keychainID,
|
|
|
|
SSCS_SECRET_ID_T *secretID,
|
|
|
|
SSCS_EXT_T *ext
|
2006-04-24 20:47:56 +02:00
|
|
|
);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|