update() of CMAC was not throwing an exception after digest was computed

This commit is contained in:
Helder Eijs 2018-11-19 13:58:27 +01:00
parent 4b138584f9
commit 072b54a9be
3 changed files with 28 additions and 4 deletions

View file

@ -116,6 +116,9 @@ class CMAC(object):
data (byte string/byte array/memoryview): The next chunk of data
"""
if self._mac_tag is not None:
raise TypeError("update() cannot be called after digest() or verify()")
self._data_size += len(msg)
bs = self._block_size