diff --git a/extensions/mk-winxpi.sh b/extensions/mk-winxpi.sh new file mode 100644 index 00000000..0ccce310 --- /dev/null +++ b/extensions/mk-winxpi.sh @@ -0,0 +1,45 @@ +#make the .dll library (xpcom) +echo '*******************************************' +echo '** Using a pre-built dll **' +echo '** **' +echo '** To rebuild the windows xpcom dll **' +echo '** 1. edit the win/makefile.mak **' +echo '** 2. enter the path to your gecko-sdk **' +echo '** 3. In cmd box, enter the following: **' +echo '** 4. nmake cfg=Release makefile.mak **' +echo '*******************************************' +echo + +#copy all files to a temp directory +rm -rf temp +mkdir temp +cp -r common temp +cp -r win temp +cd temp + +#remove all svn stuff +echo 'Removing svn stuff' +find . -name "*svn*" |xargs rm -rf + +#build the casa.jar +echo 'building casa.jar' +cd common/casajar +zip -rD casa.jar * +mv casa.jar ../. + +#copy files to correct location +cd ../.. +cp win/Release/MiCASAKeys.dll win/xpi/components/. +cp common/casa.jar win/xpi/chrome/. + +#now zip up the xpi +cd win/xpi +echo 'creating XPI' +zip -rD casa4windows.xpi * + +# copy xpi to extensions folder +cp casa4windows.xpi ../../../. +cd ../../.. + +echo 'Done' + diff --git a/extensions/win/IMiCASAKeys.h b/extensions/win/IMiCASAKeys.h new file mode 100644 index 00000000..7bd44325 --- /dev/null +++ b/extensions/win/IMiCASAKeys.h @@ -0,0 +1,101 @@ +/* + * DO NOT EDIT. THIS FILE IS GENERATED FROM IMiCASAKeys.idl + */ + +#ifndef __gen_IMiCASAKeys_h__ +#define __gen_IMiCASAKeys_h__ + + +#ifndef __gen_nsISupports_h__ +#include "nsISupports.h" +#endif + +/* For IDL files that don't want to include root IDL files. */ +#ifndef NS_NO_VTABLE +#define NS_NO_VTABLE +#endif + +/* starting interface: IMiCASAKeys */ +#define IMICASAKEYS_IID_STR "a3f70ce4-fae8-4bd1-98eb-0cf581e4b4dc" + +#define IMICASAKEYS_IID \ + {0xa3f70ce4, 0xfae8, 0x4bd1, \ + { 0x98, 0xeb, 0x0c, 0xf5, 0x81, 0xe4, 0xb4, 0xdc }} + +class NS_NO_VTABLE IMiCASAKeys : public nsISupports { + public: + + NS_DEFINE_STATIC_IID_ACCESSOR(IMICASAKEYS_IID) + + /* PRInt32 miCASAWriteKey (in AUTF8String secretId, in AUTF8String key, in AUTF8String value); */ + NS_IMETHOD MiCASAWriteKey(const nsACString & secretId, const nsACString & key, const nsACString & value, PRInt32 *_retval) = 0; + + /* PRInt32 miCASAReadKey (in AUTF8String secretId, in AUTF8String key, out AUTF8String value); */ + NS_IMETHOD MiCASAReadKey(const nsACString & secretId, const nsACString & key, nsACString & value, PRInt32 *_retval) = 0; + +}; + +/* Use this macro when declaring classes that implement this interface. */ +#define NS_DECL_IMICASAKEYS \ + NS_IMETHOD MiCASAWriteKey(const nsACString & secretId, const nsACString & key, const nsACString & value, PRInt32 *_retval); \ + NS_IMETHOD MiCASAReadKey(const nsACString & secretId, const nsACString & key, nsACString & value, PRInt32 *_retval); + +/* Use this macro to declare functions that forward the behavior of this interface to another object. */ +#define NS_FORWARD_IMICASAKEYS(_to) \ + NS_IMETHOD MiCASAWriteKey(const nsACString & secretId, const nsACString & key, const nsACString & value, PRInt32 *_retval) { return _to MiCASAWriteKey(secretId, key, value, _retval); } \ + NS_IMETHOD MiCASAReadKey(const nsACString & secretId, const nsACString & key, nsACString & value, PRInt32 *_retval) { return _to MiCASAReadKey(secretId, key, value, _retval); } + +/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */ +#define NS_FORWARD_SAFE_IMICASAKEYS(_to) \ + NS_IMETHOD MiCASAWriteKey(const nsACString & secretId, const nsACString & key, const nsACString & value, PRInt32 *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->MiCASAWriteKey(secretId, key, value, _retval); } \ + NS_IMETHOD MiCASAReadKey(const nsACString & secretId, const nsACString & key, nsACString & value, PRInt32 *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->MiCASAReadKey(secretId, key, value, _retval); } + +#if 0 +/* Use the code below as a template for the implementation class for this interface. */ + +/* Header file */ +class _MYCLASS_ : public IMiCASAKeys +{ +public: + NS_DECL_ISUPPORTS + NS_DECL_IMICASAKEYS + + _MYCLASS_(); + +private: + ~_MYCLASS_(); + +protected: + /* additional members */ +}; + +/* Implementation file */ +NS_IMPL_ISUPPORTS1(_MYCLASS_, IMiCASAKeys) + +_MYCLASS_::_MYCLASS_() +{ + /* member initializers and constructor code */ +} + +_MYCLASS_::~_MYCLASS_() +{ + /* destructor code */ +} + +/* PRInt32 miCASAWriteKey (in AUTF8String secretId, in AUTF8String key, in AUTF8String value); */ +NS_IMETHODIMP _MYCLASS_::MiCASAWriteKey(const nsACString & secretId, const nsACString & key, const nsACString & value, PRInt32 *_retval) +{ + return NS_ERROR_NOT_IMPLEMENTED; +} + +/* PRInt32 miCASAReadKey (in AUTF8String secretId, in AUTF8String key, out AUTF8String value); */ +NS_IMETHODIMP _MYCLASS_::MiCASAReadKey(const nsACString & secretId, const nsACString & key, nsACString & value, PRInt32 *_retval) +{ + return NS_ERROR_NOT_IMPLEMENTED; +} + +/* End of implementation class template. */ +#endif + + +#endif /* __gen_IMiCASAKeys_h__ */ diff --git a/extensions/win/IMiCASAKeys.idl b/extensions/win/IMiCASAKeys.idl new file mode 100644 index 00000000..bd311eab --- /dev/null +++ b/extensions/win/IMiCASAKeys.idl @@ -0,0 +1,19 @@ +#include + + +[scriptable, uuid(A3F70CE4-FAE8-4bd1-98EB-0CF581E4B4DC)] +interface IMiCASAKeys : nsISupports +{ + PRInt32 miCASAWriteKey( + in AUTF8String secretId, + in AUTF8String key, + in AUTF8String value + ); + + PRInt32 miCASAReadKey( + in AUTF8String secretId, + in AUTF8String key, + out AUTF8String value + ); +}; + diff --git a/extensions/win/IMiCASAKeys.xpt b/extensions/win/IMiCASAKeys.xpt new file mode 100644 index 00000000..d27391e2 Binary files /dev/null and b/extensions/win/IMiCASAKeys.xpt differ diff --git a/extensions/win/MiCASAKeys.cpp b/extensions/win/MiCASAKeys.cpp new file mode 100644 index 00000000..6159dd7b --- /dev/null +++ b/extensions/win/MiCASAKeys.cpp @@ -0,0 +1,173 @@ +#include "MiCASAKeys.h" +#include +#include + +/* Implementation file */ +NS_IMPL_ISUPPORTS1(MiCASAKeys, IMiCASAKeys) + +MiCASAKeys::MiCASAKeys() +{ + m_bLibraryLoaded = FALSE; + m_pCASAOpen = NULL; + m_pCASAClose = NULL; + m_pCASAWriteKey = NULL; + m_pCASAReadKey = NULL; + + /* member initializers and constructor code */ + m_hCASALibrary = LoadLibrary("micasa.dll"); + + if (m_hCASALibrary) + { + m_pCASAOpen = (PCASAOPEN)GetProcAddress(m_hCASALibrary, "miCASAOpenSecretStoreCache"); + m_pCASAClose = (PCASACLOSE)GetProcAddress(m_hCASALibrary, "miCASACloseSecretStoreCache"); + m_pCASAWriteKey = (PCASAWRITEKEY)GetProcAddress(m_hCASALibrary, "miCASAWriteKey"); + m_pCASAReadKey = (PCASAREADKEY)GetProcAddress(m_hCASALibrary, "miCASAReadKey"); + + m_bLibraryLoaded = TRUE; + } +} + +MiCASAKeys::~MiCASAKeys() +{ + /* destructor code */ +// if (m_bLibraryLoaded == TRUE) +// { +// FreeLibrary(m_hCASALibrary); +// m_bLibraryLoaded = FALSE; +// } +} + +/* PRInt32 miCASAWriteKey (in string secretId, in string key, in string value); */ +//NS_IMETHODIMP MiCASAKeys::MiCASAWriteKey(const char *secretId, const char *key, const char *value, PRInt32 *_retval) + +/* PRInt32 miCASAWriteKey (in AUTF8String secretId, in AUTF8String key, in AUTF8String value); */ +NS_IMETHODIMP MiCASAKeys::MiCASAWriteKey(const nsACString & secretId, const nsACString & key, const nsACString & value, PRInt32 *_retval) +{ + + if (m_bLibraryLoaded == TRUE) + { + nsresult result; + SSCS_KEYCHAIN_ID_T sessionKeyChain = {26, "SSCS_SESSION_KEY_CHAIN_ID"}; + SSCS_SECRET_ID_T sharedId; + SSCS_SECRETSTORE_T ssId; + HANDLE context; + + ssId.version = NSSCS_VERSION_NUMBER; + strncpy((char *)ssId.ssName, (char *)SSCS_DEFAULT_SECRETSTORE_ID, sizeof(ssId.ssName)); + + result = NSSCS_E_SYSTEM_FAILURE; + + if (m_pCASAOpen) + { + context = (*m_pCASAOpen)( + &ssId, + 0, + NULL); + + + if (context) + { + sharedId.len = secretId.Length() + 1; + strncpy((char *)sharedId.id, secretId.BeginReading(), sizeof(sharedId.id)); + + if (m_pCASAWriteKey) + { + result = (*m_pCASAWriteKey)( + context, + 0, + &sessionKeyChain, + &sharedId, + (unsigned char *)key.BeginReading(), + key.Length() + 1, + (unsigned char *)value.BeginReading(), + value.Length() + 1, + NULL, + NULL); + } + + (*m_pCASAClose)( + context, + 0, + NULL); + } + } + + *_retval = result; + return result; + } + else + { + return NSSCS_E_SERVICE_NOT_FOUND; + } +} + +/* PRInt32 miCASAReadKey (in string secretId, in string key, out string value); */ +//NS_IMETHODIMP MiCASAKeys::MiCASAReadKey(const char *secretId, const char *key, char **value, PRInt32 *_retval) + +/* PRInt32 miCASAReadKey (in AUTF8String secretId, in AUTF8String key, out AUTF8String value); */ +NS_IMETHODIMP MiCASAKeys::MiCASAReadKey(const nsACString & secretId, const nsACString & key, nsACString & value, PRInt32 *_retval) +{ + + if (m_bLibraryLoaded == TRUE) + { + nsresult result; + SSCS_KEYCHAIN_ID_T sessionKeyChain = {26, "SSCS_SESSION_KEY_CHAIN_ID"}; + SSCS_SECRET_ID_T sharedId; + SSCS_SECRETSTORE_T ssId; + uint32_t bytesRequired; + HANDLE context; + + ssId.version = NSSCS_VERSION_NUMBER; + strncpy((char *)ssId.ssName, (char *)SSCS_DEFAULT_SECRETSTORE_ID, sizeof(ssId.ssName)); + + result = NSSCS_E_SYSTEM_FAILURE; + + if (m_pCASAOpen) + { + context = (*m_pCASAOpen)( + &ssId, + 0, + NULL); + + if (context) + { + uint32_t valueLength = 256; + unsigned char tempValue[257]; + + sharedId.len = secretId.Length() + 1; + strncpy((char *)sharedId.id, secretId.BeginReading(), sizeof(sharedId.id)); + + if (m_pCASAReadKey) + { + result = (*m_pCASAReadKey)( + context, + 0, + &sessionKeyChain, + &sharedId, + (unsigned char *)key.BeginReading(), + key.Length() + 1, + tempValue, + &valueLength, + NULL, + &bytesRequired, + NULL); + + value.Assign((char *)tempValue, valueLength - 1); + } + + (*m_pCASAClose)( + context, + 0, + NULL); + } + } + + *_retval = result; + return result; + } + else + { + return NSSCS_E_SERVICE_NOT_FOUND; + } +} + diff --git a/extensions/win/MiCASAKeys.h b/extensions/win/MiCASAKeys.h new file mode 100644 index 00000000..ddb9a4dc --- /dev/null +++ b/extensions/win/MiCASAKeys.h @@ -0,0 +1,86 @@ +#ifndef _MICASA_KEYS_H_ +#define _MICASA_KEYS_H_ + +#include +#include "IMiCASAKeys.h" +#include + +#define MICASA_KEYS_CONTRACTID "@novell.com/CASA/MiCASAKeys;1" +#define MICASA_KEYS_CLASSNAME "Common Authentication Services Adapter" +// {287249D7-A851-4aa4-9AEE-5BCDA3B53566} +#define MICASA_KEYS_CID { 0x287249d7, 0xa851, 0x4aa4, { 0x9a, 0xee, 0x5b, 0xcd, 0xa3, 0xb5, 0x35, 0x66 } } + +// External prototypes not yet in micasa.h +typedef +void * +(STDAPICALLTYPE *PCASAOPEN)( + SSCS_SECRETSTORE_T * ssid, + unsigned long ssFlags, + SSCS_EXT_T * ext + ); + +typedef +int +(STDAPICALLTYPE *PCASACLOSE)( + void * context, + unsigned long ssFlags, + SSCS_EXT_T * ext + ); + + +typedef +int +(STDAPICALLTYPE *PCASAWRITEKEY)( + void * context, + uint32_t ssFlags, + SSCS_KEYCHAIN_ID_T * keyChainID, + SSCS_SECRET_ID_T * sharedSecretID, + SS_UTF8_T * key, + uint32_t keyLen, + uint8_t * val, + uint32_t valLen, + SSCS_PASSWORD_T * epPassword, + SSCS_EXT_T * ext + ); + +typedef +int +(STDAPICALLTYPE *PCASAREADKEY)( + void * context, + uint32_t ssFlags, + SSCS_KEYCHAIN_ID_T * keyChainID, + SSCS_SECRET_ID_T * sharedSecretID, + SS_UTF8_T * key, + uint32_t keyLen, + uint8_t * val, + uint32_t * valLen, + SSCS_PASSWORD_T * epPassword, + uint32_t * bytesRequired, + SSCS_EXT_T * ext + ); + + +/* Header file */ +class MiCASAKeys : public IMiCASAKeys +{ +public: + NS_DECL_ISUPPORTS + NS_DECL_IMICASAKEYS + + MiCASAKeys(); + +private: + ~MiCASAKeys(); + HINSTANCE m_hCASALibrary; + BOOLEAN m_bLibraryLoaded; + + PCASAOPEN m_pCASAOpen; + PCASACLOSE m_pCASAClose; + PCASAWRITEKEY m_pCASAWriteKey; + PCASAREADKEY m_pCASAReadKey; + +protected: + /* additional members */ +}; + +#endif //_MICASA_KEYS_H_ diff --git a/extensions/win/MiCASAKeys.suo b/extensions/win/MiCASAKeys.suo new file mode 100644 index 00000000..e5ce94b8 Binary files /dev/null and b/extensions/win/MiCASAKeys.suo differ diff --git a/extensions/win/MiCASAKeysModule.cpp b/extensions/win/MiCASAKeysModule.cpp new file mode 100644 index 00000000..9b8383b7 --- /dev/null +++ b/extensions/win/MiCASAKeysModule.cpp @@ -0,0 +1,17 @@ +#include "nsIGenericFactory.h" +#include "MiCASAKeys.h" + +NS_GENERIC_FACTORY_CONSTRUCTOR(MiCASAKeys) + +static nsModuleComponentInfo components[] = +{ + { + MICASA_KEYS_CLASSNAME, + MICASA_KEYS_CID, + MICASA_KEYS_CONTRACTID, + MiCASAKeysConstructor, + } +}; + +NS_IMPL_NSGETMODULE("MiCASAModule", components) + diff --git a/extensions/win/Release/MiCASAKeys.dll b/extensions/win/Release/MiCASAKeys.dll new file mode 100644 index 00000000..f5bb3ee7 Binary files /dev/null and b/extensions/win/Release/MiCASAKeys.dll differ diff --git a/extensions/win/makefile.mak b/extensions/win/makefile.mak new file mode 100644 index 00000000..7ba858bd --- /dev/null +++ b/extensions/win/makefile.mak @@ -0,0 +1,237 @@ +GECKO_SDK_PATH=d:\gecko-sdk +CASA_SDK_PATH=c:\PROGRA~1\Novell\CASA + +!IF "$(CFG)" == "" +CFG=Debug +!MESSAGE No configuration specified. Defaulting to Debug. +!ENDIF + +!IF "$(CFG)" != "Release" && "$(CFG)" != "Debug" +!MESSAGE Invalid configuration "$(CFG)" specified. +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "makefile.mak" CFG="Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE +!ERROR An invalid configuration is specified. +!ENDIF + +!IF "$(OS)" == "Windows_NT" +NULL= +!ELSE +NULL=nul +!ENDIF + +!IF "$(CFG)" == "Release" + +OUTDIR=.\Release +INTDIR=.\Release +# Begin Custom Macros +OutDir=.\Release +# End Custom Macros + +ALL : "$(OUTDIR)\MiCASAKeys.dll" "$(OUTDIR)\MiCASAKeys.bsc" + + +CLEAN : + -@erase "$(INTDIR)\MiCASAKeys.obj" + -@erase "$(INTDIR)\MiCASAKeys.sbr" + -@erase "$(INTDIR)\MiCASAKeysModule.obj" + -@erase "$(INTDIR)\MiCASAKeysModule.sbr" + -@erase "$(INTDIR)\vc70.idb" + -@erase "$(OUTDIR)\MiCASAKeys.bsc" + -@erase "$(OUTDIR)\MiCASAKeys.dll" + -@erase "$(OUTDIR)\MiCASAKeys.exp" + -@erase "$(OUTDIR)\MiCASAKeys.lib" + +"$(OUTDIR)" : + if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" + +CPP=cl.exe +CPP_PROJ=/nologo /MD /W3 /O1 /I "$(GECKO_SDK_PATH)\include" /I "$(CASA_SDK_PATH)\include" /FI"$(GECKO_SDK_PATH)\include\mozilla-config.h" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XPCOM_GLUE" /FR"$(INTDIR)\\" /Fp"$(INTDIR)\MiCASAKeys.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c + +.c{$(INTDIR)}.obj:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cpp{$(INTDIR)}.obj:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cxx{$(INTDIR)}.obj:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.c{$(INTDIR)}.sbr:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cpp{$(INTDIR)}.sbr:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cxx{$(INTDIR)}.sbr:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +MTL=midl.exe +MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32 +RSC=rc.exe +BSC32=bscmake.exe +BSC32_FLAGS=/nologo /o"$(OUTDIR)\MiCASAKeys.bsc" +BSC32_SBRS= \ + "$(INTDIR)\MiCASAKeys.sbr" \ + "$(INTDIR)\MiCASAKeysModule.sbr" + +"$(OUTDIR)\MiCASAKeys.bsc" : "$(OUTDIR)" $(BSC32_SBRS) + $(BSC32) @<< + $(BSC32_FLAGS) $(BSC32_SBRS) +<< + +LINK32=link.exe +LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib nspr4.lib plds4.lib plc4.lib xpcomglue.lib shlwapi.lib /nologo /dll /incremental:no /pdb:"$(OUTDIR)\MiCASAKeys.pdb" /machine:I386 /out:"$(OUTDIR)\MiCASAKeys.dll" /implib:"$(OUTDIR)\MiCASAKeys.lib" /libpath:"$(GECKO_SDK_PATH)\lib" +LINK32_OBJS= \ + "$(INTDIR)\MiCASAKeys.obj" \ + "$(INTDIR)\MiCASAKeysModule.obj" + +"$(OUTDIR)\MiCASAKeys.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) + $(LINK32) @<< + $(LINK32_FLAGS) $(LINK32_OBJS) +<< + +TargetPath=.\Release\MiCASAKeys.dll +SOURCE="$(InputPath)" + +# Begin Custom Macros +OutDir=.\Release +# End Custom Macros + +!ELSEIF "$(CFG)" == "Debug" + +OUTDIR=.\Debug +INTDIR=.\Debug +# Begin Custom Macros +OutDir=.\Debug +# End Custom Macros + +ALL : "$(OUTDIR)\MiCASAKeys.dll" "$(OUTDIR)\MiCASAKeys.bsc" + + +CLEAN : + -@erase "$(INTDIR)\MiCASAKeys.obj" + -@erase "$(INTDIR)\MiCASAKeys.sbr" + -@erase "$(INTDIR)\MiCASAKeysModule.obj" + -@erase "$(INTDIR)\MiCASAKeysModule.sbr" + -@erase "$(INTDIR)\vc70.idb" + -@erase "$(INTDIR)\vc70.pdb" + -@erase "$(OUTDIR)\MiCASAKeys.bsc" + -@erase "$(OUTDIR)\MiCASAKeys.dll" + -@erase "$(OUTDIR)\MiCASAKeys.exp" + -@erase "$(OUTDIR)\MiCASAKeys.ilk" + -@erase "$(OUTDIR)\MiCASAKeys.lib" + -@erase "$(OUTDIR)\MiCASAKeys.pdb" + +"$(OUTDIR)" : + if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" + +CPP=cl.exe +CPP_PROJ=/nologo /MDd /W3 /Gm /ZI /Od /I "$(GECKO_SDK_PATH)\include" /I "$(CASA_SDK_PATH)\include" /FI"$(GECKO_SDK_PATH)\include\mozilla-config.h" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XPCOM_GLUE" /FR"$(INTDIR)\\" /Fp"$(INTDIR)\MiCASAKeys.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c + +.c{$(INTDIR)}.obj:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cpp{$(INTDIR)}.obj:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cxx{$(INTDIR)}.obj:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.c{$(INTDIR)}.sbr:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cpp{$(INTDIR)}.sbr:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cxx{$(INTDIR)}.sbr:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +MTL=midl.exe +MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /win32 +RSC=rc.exe +BSC32=bscmake.exe +BSC32_FLAGS=/nologo /o"$(OUTDIR)\MiCASAKeys.bsc" +BSC32_SBRS= \ + "$(INTDIR)\MiCASAKeys.sbr" \ + "$(INTDIR)\MiCASAKeysModule.sbr" + +"$(OUTDIR)\MiCASAKeys.bsc" : "$(OUTDIR)" $(BSC32_SBRS) + $(BSC32) @<< + $(BSC32_FLAGS) $(BSC32_SBRS) +<< + +LINK32=link.exe +LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib nspr4.lib plds4.lib plc4.lib xpcomglue.lib shlwapi.lib /nologo /dll /incremental:yes /pdb:"$(OUTDIR)\MiCASAKeys.pdb" /debug /machine:I386 /out:"$(OUTDIR)\MiCASAKeys.dll" /implib:"$(OUTDIR)\MiCASAKeys.lib" /pdbtype:sept /libpath:"$(GECKO_SDK_PATH)\lib" +LINK32_OBJS= \ + "$(INTDIR)\MiCASAKeys.obj" \ + "$(INTDIR)\MiCASAKeysModule.obj" + +"$(OUTDIR)\MiCASAKeys.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) + $(LINK32) @<< + $(LINK32_FLAGS) $(LINK32_OBJS) +<< + +TargetPath=.\Debug\MiCASAKeys.dll +SOURCE="$(InputPath)" + +# Begin Custom Macros +OutDir=.\Debug +# End Custom Macros + +!ENDIF + +NO_EXTERNAL_DEPS=1 + +!IF "$(NO_EXTERNAL_DEPS)" != "1" +!IF EXISTS("MiCASAKeys.dep") +!INCLUDE "MiCASAKeys.dep" +!ELSE +!MESSAGE Warning: cannot find "MiCASAKeys.dep" +!ENDIF +!ENDIF + + +!IF "$(CFG)" == "Release" || "$(CFG)" == "Debug" +SOURCE=.\MiCASAKeys.cpp + +"$(INTDIR)\MiCASAKeys.obj" "$(INTDIR)\MiCASAKeys.sbr" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + +SOURCE=.\MiCASAKeysModule.cpp + +"$(INTDIR)\MiCASAKeysModule.obj" "$(INTDIR)\MiCASAKeysModule.sbr" : $(SOURCE) "$(INTDIR)" + +!ENDIF + diff --git a/extensions/win/makefile.new b/extensions/win/makefile.new new file mode 100644 index 00000000..77b3f166 --- /dev/null +++ b/extensions/win/makefile.new @@ -0,0 +1,243 @@ +GECKO_SDK_PATH=c:\source\xpcom\gecko-sdk +CASA_SDK_PATH=c:\PROGRA~1\Novell\CASA + +!IF "$(CFG)" == "" +CFG=Debug +!MESSAGE No configuration specified. Defaulting to Debug. +!ENDIF + +!IF "$(CFG)" != "Release" && "$(CFG)" != "Debug" +!MESSAGE Invalid configuration "$(CFG)" specified. +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "makefile.mak" CFG="Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE +!ERROR An invalid configuration is specified. +!ENDIF + +!IF "$(OS)" == "Windows_NT" +NULL= +!ELSE +NULL=nul +!ENDIF + +!IF "$(CFG)" == "Release" + +OUTDIR=.\Release +INTDIR=.\Release +# Begin Custom Macros +OutDir=.\Release +# End Custom Macros + +ALL : "$(OUTDIR)\MiCASAKeys.dll" "$(OUTDIR)\MiCASAKeys.bsc" + + +CLEAN : + -@erase "$(INTDIR)\MiCASAKeys.obj" + -@erase "$(INTDIR)\MiCASAKeys.sbr" + -@erase "$(INTDIR)\MiCASAKeysModule.obj" + -@erase "$(INTDIR)\MiCASAKeysModule.sbr" + -@erase "$(INTDIR)\vc60.idb" + -@erase "$(OUTDIR)\MiCASAKeys.bsc" + -@erase "$(OUTDIR)\MiCASAKeys.dll" + -@erase "$(OUTDIR)\MiCASAKeys.exp" + -@erase "$(OUTDIR)\MiCASAKeys.lib" + +"$(OUTDIR)" : + if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" + +CPP=cl.exe +CPP_PROJ=/nologo /MD /W3 /O1 /I "$(GECKO_SDK_PATH)\include" /I "$(CASA_SDK_PATH)\include" /FI"$(GECKO_SDK_PATH)\include\mozilla-config.h" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XPCOM_GLUE" /FR"$(INTDIR)\\" /Fp"$(INTDIR)\MiCASAKeys.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c +#CPP_PROJ=/nologo /MD /W3 /O2 /I "$(GECKO_SDK_PATH)\include" /I "$(CASA_SDK_PATH)\include" /FI"$(GECKO_SDK_PATH)\include\mozilla-config.h" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MYCOMPONENT_EXPORTS" /D "XPCOM_GLUE" /D "_WINDLL" /FR"$(INTDIR)\\" /Fp"$(INTDIR)\MiCASAKeys.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /EHsc /c +#CPP_PROJ=/nologo /MD /W3 /O1 /I "$(GECKO_SDK_PATH)\include" /I "$(CASA_SDK_PATH)\include" /FI"$(GECKO_SDK_PATH)\include\mozilla-config.h" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XPCOM_GLUE" /FR"$(INTDIR)\\" /Fp"$(INTDIR)\MiCASAKeys.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c + +.c{$(INTDIR)}.obj:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cpp{$(INTDIR)}.obj:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cxx{$(INTDIR)}.obj:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.c{$(INTDIR)}.sbr:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cpp{$(INTDIR)}.sbr:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cxx{$(INTDIR)}.sbr:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +MTL=midl.exe +MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32 +RSC=rc.exe +BSC32=bscmake.exe +BSC32_FLAGS=/nologo /o"$(OUTDIR)\MiCASAKeys.bsc" +BSC32_SBRS= \ + "$(INTDIR)\MiCASAKeys.sbr" \ + "$(INTDIR)\MiCASAKeysModule.sbr" + +"$(OUTDIR)\MiCASAKeys.bsc" : "$(OUTDIR)" $(BSC32_SBRS) + $(BSC32) @<< + $(BSC32_FLAGS) $(BSC32_SBRS) +<< + +LINK32=link.exe +#LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib nspr4.lib plds4.lib plc4.lib xpcomglue.lib shlwapi.lib /nologo /dll /incremental:no /pdb:"$(OUTDIR)\MiCASAKeys.pdb" /machine:I386 /out:"$(OUTDIR)\MiCASAKeys.dll" /implib:"$(OUTDIR)\MiCASAKeys.lib" /libpath:"$(GECKO_SDK_PATH)\lib" +LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib nspr4.lib plds4.lib plc4.lib xpcomglue.lib shlwapi.lib /nologo /dll /incremental:no /pdb:"$(OUTDIR)\MiCASAKeys.pdb" /machine:I386 /out:"$(OUTDIR)\MiCASAKeys.dll" /implib:"$(OUTDIR)\MiCASAKeys.lib" /libpath:"$(GECKO_SDK_PATH)\lib" +LINK32_OBJS= \ + "$(INTDIR)\MiCASAKeys.obj" \ + "$(INTDIR)\MiCASAKeysModule.obj" + +"$(OUTDIR)\MiCASAKeys.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) + $(LINK32) @<< + $(LINK32_FLAGS) $(LINK32_OBJS) +<< + +TargetPath=.\Release\MiCASAKeys.dll +SOURCE="$(InputPath)" + +# Begin Custom Macros +OutDir=.\Release +# End Custom Macros + +!ELSEIF "$(CFG)" == "Debug" + +OUTDIR=.\Debug +INTDIR=.\Debug +# Begin Custom Macros +OutDir=.\Debug +# End Custom Macros + +ALL : "$(OUTDIR)\MiCASAKeys.dll" "$(OUTDIR)\MiCASAKeys.bsc" + + +CLEAN : + -@erase "$(INTDIR)\MiCASAKeys.obj" + -@erase "$(INTDIR)\MiCASAKeys.sbr" + -@erase "$(INTDIR)\MiCASAKeysModule.obj" + -@erase "$(INTDIR)\MiCASAKeysModule.sbr" + -@erase "$(INTDIR)\vc60.idb" + -@erase "$(INTDIR)\vc60.pdb" + -@erase "$(OUTDIR)\MiCASAKeys.bsc" + -@erase "$(OUTDIR)\MiCASAKeys.dll" + -@erase "$(OUTDIR)\MiCASAKeys.exp" + -@erase "$(OUTDIR)\MiCASAKeys.ilk" + -@erase "$(OUTDIR)\MiCASAKeys.lib" + -@erase "$(OUTDIR)\MiCASAKeys.pdb" + +"$(OUTDIR)" : + if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" + +CPP=cl.exe +#CPP_PROJ=/nologo /MDd /W3 /Gm /ZI /Od /I "$(GECKO_SDK_PATH)\include" /I "$(CASA_SDK_PATH)\include" /FI"$(GECKO_SDK_PATH)\include\mozilla-config.h" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XPCOM_GLUE" /FR"$(INTDIR)\\" /Fp"$(INTDIR)\MiCASAKeys.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c +#CPP_PROJ=/nologo /MDd /W3 /ZI /Od /I "$(GECKO_SDK_PATH)\include" /I "$(CASA_SDK_PATH)\include" /FI"$(GECKO_SDK_PATH)\include\mozilla-config.h" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XPCOM_GLUE" /D "MYCOMPONENT_EXPORTS" /D "_WINDLL" /FR"$(INTDIR)\\" /Fp"$(INTDIR)\MiCASAKeys.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /RTC1 /EHsc /c +CPP_PROJ=/nologo /MDd /W3 /Gm /ZI /Od /I "$(GECKO_SDK_PATH)\include" /I "$(CASA_SDK_PATH)\include" /FI"$(GECKO_SDK_PATH)\include\mozilla-config.h" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XPCOM_GLUE" /FR"$(INTDIR)\\" /Fp"$(INTDIR)\MiCASAKeys.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c + +.c{$(INTDIR)}.obj:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cpp{$(INTDIR)}.obj:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cxx{$(INTDIR)}.obj:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.c{$(INTDIR)}.sbr:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cpp{$(INTDIR)}.sbr:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cxx{$(INTDIR)}.sbr:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +MTL=midl.exe +MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /win32 +RSC=rc.exe +BSC32=bscmake.exe +BSC32_FLAGS=/nologo /o"$(OUTDIR)\MiCASAKeys.bsc" +BSC32_SBRS= \ + "$(INTDIR)\MiCASAKeys.sbr" \ + "$(INTDIR)\MiCASAKeysModule.sbr" + +"$(OUTDIR)\MiCASAKeys.bsc" : "$(OUTDIR)" $(BSC32_SBRS) + $(BSC32) @<< + $(BSC32_FLAGS) $(BSC32_SBRS) +<< + +LINK32=link.exe +LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib nspr4.lib plds4.lib plc4.lib xpcomglue.lib shlwapi.lib /nologo /dll /incremental:yes /pdb:"$(OUTDIR)\MiCASAKeys.pdb" /debug /machine:I386 /out:"$(OUTDIR)\MiCASAKeys.dll" /implib:"$(OUTDIR)\MiCASAKeys.lib" /pdbtype:sept /libpath:"$(GECKO_SDK_PATH)\lib" +#LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib nspr4.lib plds4.lib plc4.lib xpcomglue.lib /nologo /dll /incremental:no /pdb:"$(OUTDIR)\MiCASAKeys.pdb" /debug /machine:I386 /out:"$(OUTDIR)\MiCASAKeys.dll" /implib:"$(OUTDIR)\MiCASAKeys.lib" /libpath:"$(GECKO_SDK_PATH)\lib" +LINK32_OBJS= \ + "$(INTDIR)\MiCASAKeys.obj" \ + "$(INTDIR)\MiCASAKeysModule.obj" + +"$(OUTDIR)\MiCASAKeys.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) + $(LINK32) @<< + $(LINK32_FLAGS) $(LINK32_OBJS) +<< + +TargetPath=.\Debug\MiCASAKeys.dll +SOURCE="$(InputPath)" + +# Begin Custom Macros +OutDir=.\Debug +# End Custom Macros + +!ENDIF + +NO_EXTERNAL_DEPS=1 + +!IF "$(NO_EXTERNAL_DEPS)" != "1" +!IF EXISTS("MiCASAKeys.dep") +!INCLUDE "MiCASAKeys.dep" +!ELSE +!MESSAGE Warning: cannot find "MiCASAKeys.dep" +!ENDIF +!ENDIF + + +!IF "$(CFG)" == "Release" || "$(CFG)" == "Debug" +SOURCE=.\MiCASAKeys.cpp + +"$(INTDIR)\MiCASAKeys.obj" "$(INTDIR)\MiCASAKeys.sbr" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + +SOURCE=.\MiCASAKeysModule.cpp + +"$(INTDIR)\MiCASAKeysModule.obj" "$(INTDIR)\MiCASAKeysModule.sbr" : $(SOURCE) "$(INTDIR)" + +!ENDIF + diff --git a/extensions/win/xpi/components/IMiCASAKeys.xpt b/extensions/win/xpi/components/IMiCASAKeys.xpt new file mode 100644 index 00000000..d27391e2 Binary files /dev/null and b/extensions/win/xpi/components/IMiCASAKeys.xpt differ diff --git a/extensions/win/xpi/install.js b/extensions/win/xpi/install.js new file mode 100644 index 00000000..337594b2 --- /dev/null +++ b/extensions/win/xpi/install.js @@ -0,0 +1,119 @@ +// install.js +// XpiInstaller + +var XpiInstaller = { + // --- Editable items begin --- + + extFullName: 'Novell CASA', // The name displayed to the user (don't include the version) + extShortName: 'casa', // The leafname of the JAR file (without the .jar part) + extVersion: '1.0', + extAuthor: 'CSL.Manojna', + extLocaleNames: null, // e.g. ['en-US', 'en-GB'] + extSkinNames: null, // e.g. ['classic', 'modern'] + extPostInstallMessage: 'Extension successfully installed.', // Set to null for no post-install message + + // --- Editable items end --- + + profileInstall: true, + silentInstall: false, + + install: function() + { + var jarName = this.extShortName + '.jar'; + var profileDir = Install.getFolder('Profile', 'chrome'); + + // Parse HTTP arguments + this.parseArguments(); + + // Check if extension is already installed in profile + if (File.exists(Install.getFolder(profileDir, jarName))) + { + if (!this.silentInstall) + { + Install.alert('Updating existing Profile install of ' + this.extFullName + ' to version ' + this.extVersion + '.'); + } + this.profileInstall = true; + } + else if (!this.silentInstall) + { + // Ask user for install location, profile or browser dir? + this.profileInstall = Install.confirm('Install ' + this.extFullName + ' ' + this.extVersion + ' to your Profile directory (OK) or your Browser directory (Cancel)?'); + } + + // Init install + var dispName = this.extFullName + ' ' + this.extVersion; + var regName = '/' + this.extAuthor + '/' + this.extShortName; + Install.initInstall(dispName, regName, this.extVersion); + + // Find directory to install into + var installPath; + if (this.profileInstall) installPath = profileDir; + else installPath = Install.getFolder('chrome'); + + // Add JAR file + Install.addFile(null, 'chrome/' + jarName, installPath, null); + + // Register chrome + var jarPath = Install.getFolder(installPath, jarName); + var installType = this.profileInstall ? Install.PROFILE_CHROME : Install.DELAYED_CHROME; + + // Register content + Install.registerChrome(Install.CONTENT | installType, jarPath, 'content/' + this.extShortName + '/'); + + // Register locales + for (var locale in this.extLocaleNames) + { + var regPath = 'locale/' + this.extLocaleNames[locale] + '/' + this.extShortName + '/'; + Install.registerChrome(Install.LOCALE | installType, jarPath, regPath); + } + + // Register skins + for (var skin in this.extSkinNames) + { + var regPath = 'skin/' + this.extSkinNames[skin] + '/' + this.extShortName + '/'; + Install.registerChrome(Install.SKIN | installType, jarPath, regPath); + } + + // Perform install + var err = Install.performInstall(); + if (err == Install.SUCCESS || err == Install.REBOOT_NEEDED) + { + if (!this.silentInstall && this.extPostInstallMessage) + { + Install.alert(this.extPostInstallMessage); + } + } + else + { + this.handleError(err); + return; + } + }, + + parseArguments: function() + { + // Can't use string handling in install, so use if statement instead + var args = Install.arguments; + if (args == 'p=0') + { + this.profileInstall = false; + this.silentInstall = true; + } + else if (args == 'p=1') + { + this.profileInstall = true; + this.silentInstall = true; + } + }, + + handleError: function(err) + { + if (!this.silentInstall) + { + Install.alert('Error: Could not install ' + this.extFullName + ' ' + this.extVersion + ' (Error code: ' + err + ')'); + } + Install.cancelInstall(err); + } +}; + +XpiInstaller.install(); \ No newline at end of file diff --git a/extensions/win/xpi/install.rdf b/extensions/win/xpi/install.rdf new file mode 100644 index 00000000..844b8176 --- /dev/null +++ b/extensions/win/xpi/install.rdf @@ -0,0 +1,44 @@ + + + + + + {CE9E7AA3-C32A-444b-9BF1-703DAADC0E3C} + Novell CASA + 1.0 + Common Authentication Service Adapter + CSL.Manojna + + Jim Norman + http://www.novell.com + chrome://casa/skin/CASA_48.png + chrome://casa/content/about.xul + + + + content/ + + skin/classic/ + + + + + + {ec8030f7-c20a-464f-9b0e-13a3a9e97384} + 0.9 + 1.5.1 + + + + + + {86c18b42-e466-45a9-ae7a-9b95ba6f5640} + 1.7 + 1.8 + + + + + + \ No newline at end of file