]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
test/sys/opencrypto: Fix NIST KAT parser iterator
authorKornel Dulęba <kd@FreeBSD.org>
Thu, 6 Oct 2022 14:20:58 +0000 (16:20 +0200)
committerKornel Dulęba <kd@FreeBSD.org>
Thu, 6 Oct 2022 14:42:31 +0000 (16:42 +0200)
commitfdbd0ba75d99f1909b13a9f9ece5e8c576bd8977
tree79b09b93e477d7fe6ae4fa5979c2b0977ede7dd7
parentdc39a3346e7d492114e94ddec7049e720579d6f3
test/sys/opencrypto: Fix NIST KAT parser iterator

When yield a.k.a "generator" iterator is used we need to return all
data using "yield", before returning from the function.
Because of that only encryption tests were run for AES-CBC, other modes
were affected as well.
Add one more loop to the iterator "next" routine to fix that.
This unveiled a problem in the GCM AEAD parser logic, which didn't
correctly handle tests cases with empty plaintext, i.e. AAD only.
Include the fix in this patch as it's a rather trivial one.

Obtained from: Semihalf
Differential Revision: https://reviews.freebsd.org/D36861
tests/sys/opencrypto/cryptodev.py