Merge changes Id261ab16,I0aca81b9

* changes:
  Make GetMaxNumberOfSessions and GetNumberOfOpenSessions security level aware
  Add test for OEMCrypto_ERROR_TOO_MANY_SESSIONS
This commit is contained in:
KongQun Yang
2015-03-18 23:53:27 +00:00
committed by Android (Google) Code Review
6 changed files with 66 additions and 23 deletions

View File

@@ -993,7 +993,8 @@ bool CryptoSession::GetNumberOfOpenSessions(size_t* count) {
}
size_t sessions_count;
OEMCryptoResult status = OEMCrypto_GetNumberOfOpenSessions(&sessions_count);
OEMCryptoResult status = OEMCrypto_GetNumberOfOpenSessions(
requested_security_level_, &sessions_count);
if (OEMCrypto_SUCCESS != status) {
LOGW("OEMCrypto_GetNumberOfOpenSessions fails with %d", status);
return false;
@@ -1011,7 +1012,8 @@ bool CryptoSession::GetMaxNumberOfSessions(size_t* max) {
}
size_t max_sessions;
OEMCryptoResult status = OEMCrypto_GetMaxNumberOfSessions(&max_sessions);
OEMCryptoResult status = OEMCrypto_GetMaxNumberOfSessions(
requested_security_level_, &max_sessions);
if (OEMCrypto_SUCCESS != status) {
LOGW("OEMCrypto_GetMaxNumberOfSessions fails with %d", status);
return false;