Skip to content

Commit

Permalink
Issue #142: Add a TODO to track the counter for overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
bellgrim committed May 31, 2017
1 parent b69183c commit dff45d7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/lib/SoftHSM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2073,6 +2073,8 @@ CK_RV SoftHSM::SymEncryptInit(CK_SESSION_HANDLE hSession, CK_MECHANISM_PTR pMech
DEBUG_MSG("Invalid ulCounterBits");
return CKR_MECHANISM_PARAM_INVALID;
}
// TODO: Make sure that we do not cause an overflow of the counter
// block’s counter bits.

iv.resize(16);
memcpy(&iv[0], CK_AES_CTR_PARAMS_PTR(pMechanism->pParameter)->cb, 16);
Expand Down Expand Up @@ -2714,6 +2716,8 @@ CK_RV SoftHSM::SymDecryptInit(CK_SESSION_HANDLE hSession, CK_MECHANISM_PTR pMech
DEBUG_MSG("Invalid ulCounterBits");
return CKR_MECHANISM_PARAM_INVALID;
}
// TODO: Make sure that we do not cause an overflow of the counter
// block’s counter bits.

iv.resize(16);
memcpy(&iv[0], CK_AES_CTR_PARAMS_PTR(pMechanism->pParameter)->cb, 16);
Expand Down

0 comments on commit dff45d7

Please sign in to comment.