Merge pull request #38 from denisenkom/patch-1

Return CKR_SESSION_READ_ONLY_EXISTS only when trying to log in SO.
This commit is contained in:
Alessio Di Mauro
2015-12-03 09:43:02 -08:00
+2 -2
View File
@@ -731,8 +731,8 @@ CK_DEFINE_FUNCTION(CK_RV, C_Login)(
return CKR_SESSION_HANDLE_INVALID;
}
if ((session.info.flags & CKF_RW_SESSION) == 0) { // TODO: make macros for these?
DBG("Tried to log-in to a read-only session");
if (userType == CKU_SO && (session.info.flags & CKF_RW_SESSION) == 0) { // TODO: make macros for these?
DBG("Tried to log-in SO user to a read-only session");
return CKR_SESSION_READ_ONLY_EXISTS;
}