Changes

Jump to: navigation, search

OS X Keychain integration

7,316 bytes added, 22:04, 8 February 2007
Code Pages
:Bug Fix: That application we found contained a bug that would prevent it from saving the keychain item description to Apple's keychain. Using our newbie objective-c skills, we located and fixed the problem.
 
MOE TODO: Get the code from the application we fixed and paste it here. Remember to use pre tags. :)
:* We added the method '''createKeychainItem()''', which creates a keychain item based on the passed in parameters.
* '''December 8th, 2006''' - Both MAC1 and MAC2 have been fixed. Myself and Moe began hacking our Keychain code into the Mozilla tree, through the nsPasswordManager.cpp file. This file is primarily used by Firefox to record and retrieve passwords from a flat file system. As we were implementing the code, we realized that FF wont build unless the security framework was included into the build process. Venturing into IRC produced the following results:
:* We have to include the '''-framework Security''' into the build process where ever we are linking in the tree.
:* We were unsuccessful with our first attempt at building Firefox, with the our keychain code:
<pre>
c++ -o nsPasswordManager.o -c -DMOZILLA_INTERNAL_API -DOSTYPE=\"Darwin8.8.2\" -DOSARCH=\"Darwin\" -DBUILD_ID=0000000000
-I../../../../dist/include/necko
-I../../../../dist/include/xpcom -I../../../../dist/include/string -I../../../../dist/include/windowwatcher
-I../../../../dist/include/uriloader
-I../../../../dist/include/pref -I../../../../dist/include/intl -I../../../../dist/include/dom
-I../../../../dist/include/content
-I../../../../dist/include/layout -I../../../../dist/include/widget -I../../../../dist/include/autocomplete
-I../../../../dist/include/pipnss
-I../../../../dist/include/unicharutil -I../../../../dist/include -I../../../../dist/include/passwordmgr
-I../../../../dist/include/nspr -DMOZ_PNG_READ
-DMOZ_PNG_WRITE -I../../../../dist/sdk/include -mdynamic-no-pic -fno-rtti -fno-exceptions -Wall -Wconversion -Wpointer-arith -Wcast-align
-Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor -Wno-long-long -fpascal-strings -no-cpp-precomp -fno-common -fshort-wchar
-I/Developer/Headers/FlatCarbon -pipe -DNDEBUG -DTRIMMED -O -DMOZILLA_CLIENT -include ../../../../mozilla-config.h -Wp,-MD,.deps/nsPasswordManager.pp
/Users/philly/keychain/osxkeychain/trunk/mozilla/toolkit/components/passwordmgr/base/nsPasswordManager.cpp
In file included from /Users/philly/keychain/osxkeychain/trunk/mozilla/toolkit/components/passwordmgr/base/nsPasswordManager.cpp:39:
/Users/philly/keychain/osxkeychain/trunk/mozilla/toolkit/components/passwordmgr/base/nsPasswordManager.h:52:28: error:
CoreFoundation.h: No such file or directory
/Users/philly/keychain/osxkeychain/trunk/mozilla/toolkit/components/passwordmgr/base/nsPasswordManager.h:53:22: error:
Security.h: No such file or directory
/Users/philly/keychain/osxkeychain/trunk/mozilla/toolkit/components/passwordmgr/base/nsPasswordManager.h:146: error:
'SecProtocolType' has not been declared
/Users/philly/keychain/osxkeychain/trunk/mozilla/toolkit/components/passwordmgr/base/nsPasswordManager.h:146: error:
'SecAuthenticationType' has not been declared
/Users/philly/keychain/osxkeychain/trunk/mozilla/toolkit/components/passwordmgr/base/nsPasswordManager.h:151: error:
'SecProtocolType' has not been declared
/Users/philly/keychain/osxkeychain/trunk/mozilla/toolkit/components/passwordmgr/base/nsPasswordManager.h:151: error:
'SecAuthenticationType' has not been declared
/Users/philly/keychain/osxkeychain/trunk/mozilla/toolkit/components/passwordmgr/base/nsPasswordManager.h:159: error:
ISO C++ forbids declaration of 'keychain' with no type
/Users/philly/keychain/osxkeychain/trunk/mozilla/toolkit/components/passwordmgr/base/nsPasswordManager.h:159: error:
expected ';' before '*' token
/Users/philly/keychain/osxkeychain/trunk/mozilla/toolkit/components/passwordmgr/base/nsPasswordManager.cpp:
In destructor 'virtual
nsPasswordManager::~nsPasswordManager()':
/Users/philly/keychain/osxkeychain/trunk/mozilla/toolkit/components/passwordmgr/base/nsPasswordManager.cpp:225: error:
'inst' was not declared in this scope
/Users/philly/keychain/osxkeychain/trunk/mozilla/toolkit/components/passwordmgr/base/nsPasswordManager.cpp:
In member function 'int nsPasswordManager::ChangeInternetPassword(OpaqueSecKeychainItemRef*, int, const char*, int, const void*)':
/Users/philly/keychain/osxkeychain/trunk/mozilla/toolkit/components/passwordmgr/base/nsPasswordManager.cpp:2125: error:
'kSecAccountItemAttr' was not declared in this scope
/Users/philly/keychain/osxkeychain/trunk/mozilla/toolkit/components/passwordmgr/base/nsPasswordManager.cpp:2128: error:
'SecKeychainItemModifyAttributesAndData' was not declared in this scope
/Users/philly/keychain/osxkeychain/trunk/mozilla/toolkit/components/passwordmgr/base/nsPasswordManager.cpp:2132: error:
'SecKeychainItemModifyAttributesAndData' was not declared in this scope
/Users/philly/keychain/osxkeychain/trunk/mozilla/toolkit/components/passwordmgr/base/nsPasswordManager.cpp: At global scope:
/Users/philly/keychain/osxkeychain/trunk/mozilla/toolkit/components/passwordmgr/base/nsPasswordManager.cpp:2144: error:
'SecProtocolType' has not been declared
/Users/philly/keychain/osxkeychain/trunk/mozilla/toolkit/components/passwordmgr/base/nsPasswordManager.cpp:2144: error:
'SecAuthenticationType' has not been declared
/Users/philly/keychain/osxkeychain/trunk/mozilla/toolkit/components/passwordmgr/base/nsPasswordManager.cpp:
In member function 'int nsPasswordManager::RetrieveInternetPassword(OpaqueSecKeychainRef*, int, const char*,
int, const char*, int, const char*,
int, int, int, UInt32*, void**, OpaqueSecKeychainItemRef**)':
/Users/philly/keychain/osxkeychain/trunk/mozilla/toolkit/components/passwordmgr/base/nsPasswordManager.cpp:2149: error:
'SecKeychainFindInternetPassword' was not declared in this scope
/Users/philly/keychain/osxkeychain/trunk/mozilla/toolkit/components/passwordmgr/base/nsPasswordManager.cpp: At global scope:
/Users/philly/keychain/osxkeychain/trunk/mozilla/toolkit/components/passwordmgr/base/nsPasswordManager.cpp:2162: error:
'SecProtocolType' has not been declared
/Users/philly/keychain/osxkeychain/trunk/mozilla/toolkit/components/passwordmgr/base/nsPasswordManager.cpp:2164: error:
'SecAuthenticationType' has not been declared
/Users/philly/keychain/osxkeychain/trunk/mozilla/toolkit/components/passwordmgr/base/nsPasswordManager.cpp: In member
function 'int nsPasswordManager::AddInternetPassword(OpaqueSecKeychainRef*, int, const char*, int, const char*, int,
const char*, int, const char*, int, int, int, int, const void*, OpaqueSecKeychainItemRef**)':
/Users/philly/keychain/osxkeychain/trunk/mozilla/toolkit/components/passwordmgr/base/nsPasswordManager.cpp:2171: error:
'SecKeychainAddInternetPassword' was not declared in this scope
/Users/philly/keychain/osxkeychain/trunk/mozilla/toolkit/components/passwordmgr/base/nsPasswordManager.cpp:
In static member function 'static nsPasswordManager* nsPasswordManager::getInstance()':
/Users/philly/keychain/osxkeychain/trunk/mozilla/toolkit/components/passwordmgr/base/nsPasswordManager.cpp:2177: error:
'inst' was not declared in this scope
/Users/philly/keychain/osxkeychain/trunk/mozilla/toolkit/components/passwordmgr/base/nsPasswordManager.cpp:2180: error:
'inst' was not declared in this scope
/Users/philly/keychain/osxkeychain/trunk/mozilla/toolkit/components/passwordmgr/base/nsPasswordManager.cpp: At global scope:
/Users/philly/keychain/osxkeychain/trunk/mozilla/toolkit/components/passwordmgr/base/nsPasswordManager.cpp:2184: error:
'nsPasswordManager* nsPasswordManager::inst' is not a static member of 'class nsPasswordManager'
make[6]: *** [nsPasswordManager.o] Error 1
make[5]: *** [libs] Error 2
make[4]: *** [libs] Error 2
make[3]: *** [libs_tier_toolkit] Error 2
make[2]: *** [tier_toolkit] Error 2
make[1]: *** [default] Error 2
make: *** [build] Error 2
</pre>
:* Our custom keychain class is now fully commented and available for online viewing. A test main is provided as well as the Xcode project for those who are interesting in compiling the code.
:* The following chat was recorded, discussing a new MoCo involvement in the OS X Keychain integration project:
<pre>
21:12 -!- dolske [dolske@moz-46636307.office.mozilla.org ] has quit [Quit: dolske]
</pre>
 
 
==Project Download==
::[http://mo3b.com/keychain.zip Download archive]
::[http://mo3b.com/keychain/ View the source online]
 
==== Code Pages ====
 
*[[OS_X_Keychain_integration_Keychain.h|keychain.h]]
*[[OS_X_Keychain_integration_Keychain.cpp|keychain.cpp]]
*[[OS_X_Keychain_integration_Keychain_main.cpp|main.cpp]]
*[[OS_X_Keychain_integration_osxkeychain.patch|osxkeychain.patch ]]
===SVN===
1
edit

Navigation menu