Author: jmagne
Update of /cvs/dirsec/esc/src/app/xpcom
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv388
Modified Files:
rhCoolKey.cpp rhICoolKey.idl
Log Message:
Latest bug fixes.
Index: rhCoolKey.cpp
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xpcom/rhCoolKey.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- rhCoolKey.cpp 24 Feb 2007 01:59:50 -0000 1.6
+++ rhCoolKey.cpp 7 May 2007 23:45:43 -0000 1.7
@@ -1074,7 +1074,7 @@
char tBuff[56];
PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s rhCoolKey::GetCoolKeyIsReallyCoolKey
thread: %p \n",GetTStamp(tBuff,56),PR_GetCurrentThread()));
- if (ASCCoolKeyIsAvailable(aKeyType, (char *) aKeyID)) {
+ if (aKeyType && aKeyID && ASCCoolKeyIsAvailable(aKeyType, (char *)
aKeyID)) {
if (aKeyID) {
AutoCoolKey key(aKeyType, aKeyID);
PRBool isCool = CoolKeyIsReallyCoolKey(&key);
@@ -1164,6 +1164,34 @@
return NS_OK;
}
+/* string GetCoolKeyTokenName (in unsigned long aKeyType, in string aKeyID); */
+ NS_IMETHODIMP rhCoolKey::GetCoolKeyTokenName(PRUint32 aKeyType, const char *aKeyID, char
**_retval)
+{
+ char tBuff[56];
+
+ *_retval = NULL;
+
+ if(!aKeyType && !aKeyID)
+ return NS_OK;
+
+ AutoCoolKey key(aKeyType,aKeyID);
+
+ char *tokenName = NULL;
+
+ tokenName = (char *) CoolKeyGetTokenName(&key);
+
+ PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s rhCoolKey::GetCoolKeyTokenName %s
\n",GetTStamp(tBuff,56),tokenName));
+ if(tokenName)
+ {
+ char *temp = (char *) nsMemory::Clone(tokenName,sizeof(char) * strlen((char
*)tokenName) + 1);
+ *_retval = temp;
+
+ }
+
+ return NS_OK;
+
+}
+
/* string GetCoolKeyIssuerInfo (in unsigned long aKeyType, in string aKeyID); */
NS_IMETHODIMP rhCoolKey::GetCoolKeyIssuerInfo(PRUint32 aKeyType, const char *aKeyID, char
**_retval)
{
char tBuff[56];
@@ -1251,6 +1279,40 @@
return NS_OK;
}
+
+/* string GetCoolKeyIssuer (in unsigned long aKeyType, in string aKeyID); */
+NS_IMETHODIMP rhCoolKey::GetCoolKeyIssuer(PRUint32 aKeyType, const char *aKeyID, char
**issuer)
+{
+ char tBuff[56];
+ if (!aKeyID) {
+ return NS_ERROR_FAILURE;
+ }
+
+ AutoCoolKey key(aKeyType, ( char *)aKeyID);
+
+ // const char *keyName = CoolKeyGetTokenName(&key);
+
+ char buff[512];
+ int bufLength = 512;
+ buff[0] = 0;
+
+ CoolKeyGetIssuer(&key, (char *) buff, bufLength);
+
+ if(!buff[0])
+ {
+ return NS_OK;
+ }
+
+ PR_LOG(coolKeyLog,PR_LOG_DEBUG,("%s rhCoolKey::RhGetCoolKeyGetIssuer %s
\n",GetTStamp(tBuff,56),(char *) buff));
+
+ char *temp = (char *) nsMemory::Clone(buff,sizeof(char) * strlen(buff) + 1);
+
+ *issuer = temp;
+
+ return NS_OK;
+
+}
+
/* boolean SetCoolKeyConfigValue (in string aName, in string aValue); */
NS_IMETHODIMP rhCoolKey::SetCoolKeyConfigValue(const char *aName, const char *aValue,
PRBool *_retval)
{
Index: rhICoolKey.idl
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xpcom/rhICoolKey.idl,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- rhICoolKey.idl 24 Feb 2007 01:58:30 -0000 1.5
+++ rhICoolKey.idl 7 May 2007 23:45:43 -0000 1.6
@@ -66,9 +66,13 @@
string GetCoolKeyCertInfo(in unsigned long aKeyType, in string aKeyID, in string
aCertNickname);
string GetCoolKeyIssuedTo(in unsigned long aKeyType, in string aKeyID);
+
+ string GetCoolKeyIssuer(in unsigned long aKeyType, in string aKeyID);
string GetCoolKeyATR(in unsigned long aKeyType, in string aKeyID);
+ string GetCoolKeyTokenName(in unsigned long aKeyType, in string aKeyID);
+
boolean GetCoolKeyRequiresAuthentication(in unsigned long aKeyType,in string
aKeyID);
boolean GetCoolKeyIsAuthenticated(in unsigned long aKeyType,in string aKeyID);