Remove commented code for BINARY Secrets

This commit is contained in:
Jim Norman 2006-01-03 18:07:30 +00:00
parent c77c27593e
commit ee00b0f0a5
3 changed files with 45 additions and 44 deletions

View File

@ -755,7 +755,6 @@ miCASAOpenSecretStoreCache
/* ############################## CODE STARTS HERE ############################ */ /* ############################## CODE STARTS HERE ############################ */
searchKey.srchKey[0] = NSSCS_ENUM_DELIM; searchKey.srchKey[0] = NSSCS_ENUM_DELIM;
searchKey.srchKeyLen = sscs_Utf8Strlen(searchKey.srchKey) + 1; searchKey.srchKeyLen = sscs_Utf8Strlen(searchKey.srchKey) + 1;
@ -2671,7 +2670,7 @@ miCASAGetCredential
uint32_t ssFlags, // IN uint32_t ssFlags, // IN
SSCS_SECRET_ID_T * appSecretID, // IN SSCS_SECRET_ID_T * appSecretID, // IN
SSCS_SECRET_ID_T * sharedSecretID, // Optional IN SSCS_SECRET_ID_T * sharedSecretID, // Optional IN
int32_t * credentialType, // IN/OUT uint32_t * credentialType, // IN/OUT
void * credential, // OUT void * credential, // OUT
SSCS_EXT_T * ext // Reserved SSCS_EXT_T * ext // Reserved
) )
@ -2709,44 +2708,42 @@ miCASAGetCredential
store.version = 1; store.version = 1;
context = miCASAOpenSecretStoreCache(&store, ssFlags, NULL); context = miCASAOpenSecretStoreCache(&store, ssFlags, NULL);
/*
if (*credentialType == SSCS_CRED_TYPE_BINARY_F) if (*credentialType == SSCS_CRED_TYPE_BINARY_F)
{ {
// first check appSecretID // first check appSecretID
rcode = miCASAReadBinaryKey( rcode = miCASAReadBinaryKey(
context, context,
ssFlags, ssFlags,
&kc, &kc,
appSecretID, appSecretID,
binaryCred->id, binaryCred->id,
binaryCred->idLen, binaryCred->idLen,
binaryCred->data, binaryCred->data,
binaryCred->dataLen, binaryCred->dataLen,
NULL, NULL,
&bytesRequired, &bytesRequired,
ext); ext);
if ((rcode != NSSCS_SUCCESS) && (sharedSecretID != NULL)) if ((rcode != NSSCS_SUCCESS) && (sharedSecretID != NULL))
{ {
// try shared if set // try shared if set
rcode = miCASAReadBinaryKey( rcode = miCASAReadBinaryKey(
context, context,
ssFlags, ssFlags,
&kc, &kc,
sharedSecretID, sharedSecretID,
binaryCred->id, binaryCred->id,
binaryCred->idLen, binaryCred->idLen,
binaryCred->data, binaryCred->data,
binaryCred->dataLen, binaryCred->dataLen,
NULL, NULL,
&bytesRequired, &bytesRequired,
ext); ext);
} }
miCASACloseSecretStoreCache(context, ssFlags, NULL); miCASACloseSecretStoreCache(context, ssFlags, NULL);
return rcode; return rcode;
} }
*/
// create a SHS Handle // create a SHS Handle
secretHandle = miCASA_CreateSHSHandle(); secretHandle = miCASA_CreateSHSHandle();
@ -2905,6 +2902,7 @@ miCASASetCredential
SSCS_BASIC_CREDENTIAL *basicCred; SSCS_BASIC_CREDENTIAL *basicCred;
SSCS_BINARY_CREDENTIAL *binaryCred; SSCS_BINARY_CREDENTIAL *binaryCred;
// check params // check params
if ((appSecretID == NULL) || (credential == NULL)) if ((appSecretID == NULL) || (credential == NULL))
{ {
@ -2927,7 +2925,7 @@ miCASASetCredential
sscs_Utf8Strcpy(kc.keychainID, SSCS_SESSION_KEY_CHAIN_ID); sscs_Utf8Strcpy(kc.keychainID, SSCS_SESSION_KEY_CHAIN_ID);
kc.len = SSCS_S_KC_ID_CHARS; kc.len = SSCS_S_KC_ID_CHARS;
/*
if (credentialType == SSCS_CRED_TYPE_BINARY_F) if (credentialType == SSCS_CRED_TYPE_BINARY_F)
{ {
binaryCred = (SSCS_BINARY_CREDENTIAL *)credential; binaryCred = (SSCS_BINARY_CREDENTIAL *)credential;
@ -2937,23 +2935,23 @@ miCASASetCredential
// set apps binary key // set apps binary key
rcode = miCASAWriteBinaryKey( rcode = miCASAWriteBinaryKey(
context, context,
ssFlags, ssFlags,
&kc, &kc,
appSecretID, appSecretID,
binaryCred->id, binaryCred->id,
binaryCred->idLen, binaryCred->idLen,
binaryCred->data, binaryCred->data,
binaryCred->dataLen, binaryCred->dataLen,
NULL, NULL,
ext); ext);
miCASACloseSecretStoreCache(context, ssFlags, NULL); miCASACloseSecretStoreCache(context, ssFlags, NULL);
return rcode; return rcode;
} }
else else
*/
basicCred = (SSCS_BASIC_CREDENTIAL *)credential; basicCred = (SSCS_BASIC_CREDENTIAL *)credential;

View File

@ -30,8 +30,8 @@ you may find current contact information at www.novell.com.
#include <time.h> #include <time.h>
#include <string.h> #include <string.h>
#include <micasa_mgmd.h>
#include <sscs_utf8.h> #include <sscs_utf8.h>
#include <micasa_mgmd.h>
/////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////
@ -81,6 +81,7 @@ void AddSecret()
sscs_Utf8Strcpy(credential.password, inputPassword); sscs_Utf8Strcpy(credential.password, inputPassword);
credential.pwordLen = sscs_Utf8Strlen(inputPassword) + 1; credential.pwordLen = sscs_Utf8Strlen(inputPassword) + 1;
printf("SAMPLE: Calling miCASASetCredential\r\n");
// sets the credential for this app // sets the credential for this app
rcode = miCASASetCredential( rcode = miCASASetCredential(
0, 0,
@ -104,6 +105,7 @@ void DisplaySecret()
int rcode = 0; int rcode = 0;
char inputID[20]; char inputID[20];
int32_t credtype = SSCS_CRED_TYPE_BASIC_F;
SSCS_BASIC_CREDENTIAL credential = {0}; SSCS_BASIC_CREDENTIAL credential = {0};
SSCS_SECRET_ID_T appSecretId = {0}; SSCS_SECRET_ID_T appSecretId = {0};
@ -127,7 +129,7 @@ void DisplaySecret()
0, 0,
&appSecretId, &appSecretId,
NULL, NULL,
SSCS_CRED_TYPE_BASIC_F, &credtype, //SSCS_CRED_TYPE_BASIC_F,
&credential, &credential,
NULL NULL
); );
@ -193,6 +195,7 @@ void RunTest()
{ {
SSCS_BASIC_CREDENTIAL credential = {0}; SSCS_BASIC_CREDENTIAL credential = {0};
SSCS_SECRET_ID_T appSecretId = {0}; SSCS_SECRET_ID_T appSecretId = {0};
int32_t credtype = SSCS_CRED_TYPE_BASIC_F;
int rcode = 0; int rcode = 0;
int iFlags = 0; int iFlags = 0;
@ -286,7 +289,7 @@ void RunTest()
iFlags, iFlags,
&appSecretId, &appSecretId,
NULL, NULL,
SSCS_CRED_TYPE_BASIC_F, &credtype, //SSCS_CRED_TYPE_BASIC_F,
&credential, &credential,
NULL NULL
); );
@ -328,7 +331,7 @@ void RunTest()
iFlags, iFlags,
&appSecretId, &appSecretId,
NULL, NULL,
SSCS_CRED_TYPE_BASIC_F, &credtype, //SSCS_CRED_TYPE_BASIC_F,
&credential, &credential,
NULL NULL
); );

View File

@ -381,7 +381,7 @@ typedef struct _sscs_ext_t
uint32_t ssFlags, // IN uint32_t ssFlags, // IN
SSCS_SECRET_ID_T * appSecretID, // IN SSCS_SECRET_ID_T * appSecretID, // IN
SSCS_SECRET_ID_T * sharedSecretID, // Optional IN SSCS_SECRET_ID_T * sharedSecretID, // Optional IN
int32_t * credentialType, // IN/OUT uint32_t * credentialType, // IN/OUT
void * credential, // OUT void * credential, // OUT
SSCS_EXT_T * ext // Reserved SSCS_EXT_T * ext // Reserved
); );
@ -392,7 +392,7 @@ typedef struct _sscs_ext_t
uint32_t ssFlags, // IN uint32_t ssFlags, // IN
SSCS_SECRET_ID_T * appSecretID, // IN SSCS_SECRET_ID_T * appSecretID, // IN
SSCS_SECRET_ID_T * sharedSecretID, // Optional IN SSCS_SECRET_ID_T * sharedSecretID, // Optional IN
int32_t credentialType, // IN uint32_t credentialType, // IN
void * credential, // IN void * credential, // IN
SSCS_EXT_T * ext // Reserved SSCS_EXT_T * ext // Reserved
); );