Closed ondergormez closed 3 years ago
The EncryptUpdateErrors
test case checks error behaviour for the C_EncryptUpdate
operation. PKCS#11 states (in both v2.2 and v2.4):
A call to C_EncryptUpdate which results in an error other than CKR_BUFFER_TOO_SMALL terminates the current encryption operation.
So the EncryptUpdateErrors
case looks OK to me.
Ah, looking at the pull request I think you maybe meant the DecryptUpdateErrors test case, not the EncryptUpdateErrors case?
This is my fault :)
This should be related with the DecryptUpdateErrors test case
I changed the pull request with the correct one.
Thanks for the fix – well spotted.
You are welcome
According to the latest PKCS#11 Standard;
In the implementation on SoftHSMv2
C_EncryptUpdate
call doesn't finish the encryption operation. SoC_EncryptFinal
must be called for a further cryptographic operation.Instead of this, the
C_Encrypt
method can be used in the DecryptUpdateErrors test case. And this solves the problem.