Menu

#4 patch for login->logout->login

open
nobody
None
5
2001-08-07
2001-08-07
netfun
No

login->logout->login, the private object presend twice.
patch in function Logout:
/* {{{ CI_Ceay_Logout */
CK_DECLARE_FUNCTION(CK_RV, CI_Ceay_Logout)(
CK_I_SESSION_DATA_PTR session_data /* the session's
handle */
)
{
CK_I_HASH_ITERATOR_PTR pIter;
CK_ULONG key;
CK_I_OBJ_PTR val;
CK_RV rv = CKR_OK;

#ifndef NO_LOGGING
CI_LogEntry("CI_Ceay_Logout", "starting...", rv, 0);
#endif

if (session_data->slot_data->token_data->object_list
== NULL_PTR) {
#ifndef NO_LOGGING
CI_LogEntry("CI_Ceay_Logout", "application object
list missing ", CKR_GENERAL_ERROR, 0);
#endif
return CKR_GENERAL_ERROR;
}

if (session_data->object_list == NULL_PTR) {
#ifndef NO_LOGGING
CI_LogEntry("CI_Ceay_Logout", "session object list
missing ", CKR_GENERAL_ERROR, 0);
#endif
return CKR_GENERAL_ERROR;
}

for (CI_HashIterateInit(session_data->slot_data-
>token_data->object_list, &pIter); CI_HashIterValid
(pIter); ) {
rv = CI_HashIterateDeRef(pIter, &key,
(CK_VOID_PTR_PTR)&val);
if (rv != CKR_OK) {
#ifndef NO_LOGGING
CI_LogEntry("CI_Ceay_Logout", "failed to deref
iter on token object_list", rv, 0);
#endif
CI_HashIterateDelete(pIter);
return rv;
}
CI_HashIterateInc(pIter);
if (val->session != session_data)
continue;
if ((CI_ObjLookup(val, CK_IA_PRIVATE) != NULL_PTR)
&& (*((CK_BBOOL CK_PTR)CI_ObjLookup(val,CK_IA_PRIVATE)-
>pValue) == TRUE)) {
#ifndef NO_LOGGING
CI_VarLogEntry
("CI_Ceay_Logout", "ContainerDelObj (object = %u)",
rv, 0, key);
#endif
rv = CI_ContainerDelObj(session_data-
>object_list, key);
if (rv != CKR_OK) {
#ifndef NO_LOGGING
CI_LogEntry("CI_Ceay_Logout", "failed to del
object from session object_list", rv, 0);
#endif
CI_HashIterateDelete(pIter);
return rv;
}

rv = CI_ContainerDelObj(session_data->slot_data-
>token_data->object_list, key);
if (rv != CKR_OK) {
#ifndef NO_LOGGING
CI_LogEntry("CI_Ceay_Logout", "failed to del
object from token object_list 2", rv, 0);
#endif
CI_HashIterateDelete(pIter);
return rv;
}

/* remove from temporary storages */
rv = CI_ContainerDelObj(IMPL_DATA
(persistent_cache), key);
#ifndef NO_LOGGING
if (rv != CKR_OK) {
CI_LogEntry("CI_Ceay_Logout", "could not
delete object from persistent cache", rv, 0);
}
#endif
}
}

CI_HashIterateDelete(pIter);

#ifndef NO_LOGGING
CI_LogEntry("CI_Ceay_Logout", "complete...", rv, 0);
#endif
return CKR_OK;
}
/* }}} */

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.