Enable Firefox support on Windows, and checkpoint Windows Project files.

This commit is contained in:
Jim Norman
2006-04-13 16:03:49 +00:00
parent 7684bc7aee
commit 7a72dfc4a1
17 changed files with 925 additions and 479 deletions

Binary file not shown.

View File

@@ -1,5 +1,13 @@
Microsoft Visual Studio Solution File, Format Version 8.00
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cSample", "..\..\..\casa2\c_test\c_sample\CSample.vcproj", "{2635AF48-A4B2-42BD-97E2-A9AD9FF79E8C}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cSample", "CSample.vcproj", "{2635AF48-A4B2-42BD-97E2-A9AD9FF79E8C}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "c_micasacache", "..\..\c_micasacache\c_micasacache.vcproj", "{B5DB4B53-AB02-4EDC-9C02-BF7DE68F91A3}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "c_micasadk", "..\..\c_micasadk\c_micasadk.vcproj", "{99988A22-4C58-4BF7-A2DB-57761E76FB26}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
@@ -13,6 +21,14 @@ Global
{2635AF48-A4B2-42BD-97E2-A9AD9FF79E8C}.Debug.Build.0 = Debug|Win32
{2635AF48-A4B2-42BD-97E2-A9AD9FF79E8C}.Release.ActiveCfg = Release|Win32
{2635AF48-A4B2-42BD-97E2-A9AD9FF79E8C}.Release.Build.0 = Release|Win32
{B5DB4B53-AB02-4EDC-9C02-BF7DE68F91A3}.Debug.ActiveCfg = Debug|Win32
{B5DB4B53-AB02-4EDC-9C02-BF7DE68F91A3}.Debug.Build.0 = Debug|Win32
{B5DB4B53-AB02-4EDC-9C02-BF7DE68F91A3}.Release.ActiveCfg = Release|Win32
{B5DB4B53-AB02-4EDC-9C02-BF7DE68F91A3}.Release.Build.0 = Release|Win32
{99988A22-4C58-4BF7-A2DB-57761E76FB26}.Debug.ActiveCfg = Debug|Win32
{99988A22-4C58-4BF7-A2DB-57761E76FB26}.Debug.Build.0 = Debug|Win32
{99988A22-4C58-4BF7-A2DB-57761E76FB26}.Release.ActiveCfg = Release|Win32
{99988A22-4C58-4BF7-A2DB-57761E76FB26}.Release.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
EndGlobalSection

Binary file not shown.

View File

@@ -22,7 +22,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="D:\ccm\SSClient\SecretStoreClient_src\include"
AdditionalIncludeDirectories="..\..\include"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
BasicRuntimeChecks="3"
RuntimeLibrary="5"
@@ -38,10 +38,10 @@
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="micasa_mdd.lib odbc32.lib odbccp32.lib"
AdditionalDependencies=" odbc32.lib odbccp32.lib"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
AdditionalLibraryDirectories="..\..\bin\w32\mdd"
AdditionalLibraryDirectories=""
GenerateDebugInformation="TRUE"
SubSystem="1"
TargetMachine="1"/>

View File

@@ -37,7 +37,9 @@
#include <time.h>
#include <string.h>
#include <sscs_utf8.h>
#include <micasa_mgmd.h>
#include <micasa.h>
#include <sscs_cache.h>
///////////////////////////////////////////////////////////////////////
@@ -51,6 +53,147 @@ void Pause()
void ReadKey()
{
int rcode = 0;
char inputID[20];
char inputKey[20];
char inputValue[128] = {0};
uint32_t valueLen = 128;
uint32_t bytesRequired = 0;
SSCS_SECRETSTORE_T store = {0};
SSCS_SECRET_ID_T appSecretId = {0};
SSCS_SECRET_ID_T sharedSecretId = {0};
void *context;
SSCS_KEYCHAIN_ID_T kc = {0};
SSCS_EXT_T ext = {0};
printf("Enter secretID: ");
gets(inputID);
printf("Enter Key: ");
gets(inputKey);
if ((sscs_Utf8Strlen(inputID) > 0) &&
(sscs_Utf8Strlen(inputKey) > 0))
{
appSecretId.len = sscs_Utf8Strlen(inputID) + 1;
sscs_Utf8Strcpy(appSecretId.id, inputID);
printf("SAMPLE: Calling miCASAReadKey\r\n");
// open secretStore
sscs_Utf8Strcpy(store.ssName, SSCS_DEFAULT_SECRETSTORE_ID);
store.version = 1;
context = miCASAOpenSecretStoreCache(&store, 0, NULL);
if (context == NULL)
{
return; // NSSCS_E_SYSTEM_FAILURE;
}
sscs_Utf8Strcpy(kc.keychainID, SSCS_SESSION_KEY_CHAIN_ID);
kc.len = SSCS_S_KC_ID_CHARS;
rcode = miCASAReadKey(context,
0,
&kc,
&appSecretId,
inputKey,
strlen(inputKey)+1,
inputValue,
&valueLen,
NULL,
&bytesRequired,
&ext);
miCASACloseSecretStoreCache(context, 0, NULL);
if (rcode)
{
printf("miCASAReadKey returned %d\r\n", rcode);
Pause();
}
else
{
//set null
//memcpy(inputValue[valueLen + 1],
printf("KeyValue is %s\r\n", inputValue);
}
}
}
void WriteKey()
{
int rcode = 0;
char inputID[20];
char inputKey[20];
char inputValue[20];
SSCS_SECRETSTORE_T store = {0};
SSCS_SECRET_ID_T appSecretId = {0};
SSCS_SECRET_ID_T sharedSecretId = {0};
void *context;
SSCS_KEYCHAIN_ID_T kc = {0};
SSCS_EXT_T ext = {0};
printf("Enter secretID: ");
gets(inputID);
printf("Enter Key: ");
gets(inputKey);
printf("Enter Value: ");
gets(inputValue);
if ((sscs_Utf8Strlen(inputID) > 0) &&
(sscs_Utf8Strlen(inputKey) > 0) &&
(sscs_Utf8Strlen(inputValue) > 0))
{
appSecretId.len = sscs_Utf8Strlen(inputID) + 1;
sscs_Utf8Strcpy(appSecretId.id, inputID);
printf("SAMPLE: Calling miCASAWriteKey\r\n");
// open secretStore
sscs_Utf8Strcpy(store.ssName, SSCS_DEFAULT_SECRETSTORE_ID);
store.version = 1;
context = miCASAOpenSecretStoreCache(&store, 0, NULL);
if (context == NULL)
{
return; // NSSCS_E_SYSTEM_FAILURE;
}
sscs_Utf8Strcpy(kc.keychainID, SSCS_SESSION_KEY_CHAIN_ID);
kc.len = SSCS_S_KC_ID_CHARS;
rcode = miCASAWriteKey(context,
0,
&kc,
&appSecretId,
inputKey,
strlen(inputKey)+1,
inputValue,
strlen(inputValue)+1,
NULL,
&ext);
miCASACloseSecretStoreCache(context, 0, NULL);
if (rcode)
{
printf("miCASAWriteKey returned %d\r\n", rcode);
Pause();
}
}
}
void AddSecret()
{
int rcode = 0;
@@ -396,8 +539,10 @@ void displayMenu()
printf("* 1. Add secret *\r\n");
printf("* 2. Display secret *\r\n");
printf("* 3. Remove secret *\r\n");
printf("* 4. Run automated test *\r\n");
printf("* 5. Quit *\r\n");
printf("* 4. Run automated test *\r\n");
printf("* 5. WriteKey *\r\n");
printf("* 6. ReadKey *\r\n");
printf("* 7. Quit *\r\n");
printf("**************************\r\n");
@@ -407,7 +552,7 @@ void displayMenu()
// get return
getchar();
if (c == '5')
if (c == '7')
return;
else if (c == '1')
AddSecret();
@@ -417,7 +562,12 @@ void displayMenu()
RemoveSecret();
else if (c == '4')
RunTests();
else if (c == '5')
WriteKey();
else if (c == '6')
ReadKey();
}
}