chaps: Prevent interspersal of incremental and one-shot operations.
PKCS#11 spec has variants of the following (from C_Encrypt):
"C_Encrypt can not be user to terminate a multi-part operation, and
must be called after C_EncryptInit without intervening
C_EncryptUpdate calls."
So track whether a one-shot or multi-part operation has been started, and
reject the other style if so.
BUG=None
TEST=Chaps unit tests (with ASAN) plus PKCS11 tests
Change-Id: I484dca635a12246a30c461e6ea7113697e085d26
Reviewed-on: https://chromium-review.googlesource.com/221937
Reviewed-by: Darren Krahn <dkrahn@chromium.org>
Commit-Queue: David Drysdale <drysdale@google.com>
Tested-by: David Drysdale <drysdale@google.com>
3 files changed