From 1c2f03e2b532dddf3b467626790d6ec2d6b1192e Mon Sep 17 00:00:00 2001 From: Jim Norman Date: Wed, 12 Mar 2008 14:13:25 +0000 Subject: [PATCH] CardSelector changes --- CASA/micasadk/cardselector.c | 48 +++++++++++++++++++++--------------- 1 file changed, 28 insertions(+), 20 deletions(-) diff --git a/CASA/micasadk/cardselector.c b/CASA/micasadk/cardselector.c index f98dd6f5..d2e42876 100644 --- a/CASA/micasadk/cardselector.c +++ b/CASA/micasadk/cardselector.c @@ -260,44 +260,46 @@ int getLine(char *line, int max, FILE *fp) Desc: ****************************************************************************/ int launchSelector(char* pSecretID, - void *secretHandle, - SSCS_BASIC_CREDENTIAL *basicCred) + void *secretHandle, + SSCS_BASIC_CREDENTIAL *basicCred) { int32_t rcode = 0; int32_t userFound = 0, passFound = 0; SS_UTF8_T *pKey = NULL; uint8_t *pValue = NULL; - uint32_t unkLen = 0; - uint32_t kLen = 0; - uint32_t vLen = 0; + uint32_t unkLen = 0; + uint32_t kLen = 0; + uint32_t vLen = 0; int32_t argCount = 0; - void *pArgs[MAXARGS] = {0}; + void *pArgs[MAXARGS] = {0}; - void *pAppliesTo; + void *pAppliesTo; int32_t claimCount = 0; - void *pKeys[MAXCLAIMS] = {0}; - void *pClaims[MAXCLAIMS] = {0}; + void *pKeys[MAXCLAIMS] = {0}; + void *pClaims[MAXCLAIMS] = {0}; int32_t claimStrLen = 0; - void *pClaimsStr = 0; + void *pClaimsStr = 0; - void *pTempPtr; - int i = 0; + void *pTempPtr; + int i = 0; FILE * tokenfile; - char filename[L_tmpnam+1]; - char *ptr; - void *pFileName = 0; + char filename[L_tmpnam+1]; + char *ptr; + void *pFileName = 0; - const char line[256]; + const char line[256]; - char claimURI[256] = {0}; - char claimvalue[256] = {0}; - int indexToDigitalMeApp = 0; + char claimURI[256] = {0}; + char passwordURI[256] = {0}; + char claimvalue[256] = {0}; + + int indexToDigitalMeApp = 0; printf("launchSelector method called\r\n"); @@ -354,6 +356,12 @@ int launchSelector(char* pSecretID, sscs_strncpy(pTempPtr, pValue, vLen); pClaims[claimCount++] = pTempPtr; claimStrLen += sscs_strlen(pValue); + + if (!strcmp("Password", pKey)) + { + printf("Mapped password is: %s\r\n", pValue); + sscs_strncpy(passwordURI, pValue, vLen); + } } // clear the buffers @@ -447,7 +455,7 @@ int launchSelector(char* pSecretID, strcpy(basicCred->username, claimvalue); basicCred->unLen = strlen(claimvalue); } - else if (!strcmp(claimURI, "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname")) + else if (!strcmp(claimURI, passwordURI)) { strcpy(basicCred->password, claimvalue); basicCred->pwordLen = strlen(claimvalue);