nvme-auth: common: add KUnit tests for TLS key derivationUnit-test the sequence of function calls that derive tls_psk, so that wecan be more confident that changes in the implementation don't brea
nvme-auth: common: add KUnit tests for TLS key derivationUnit-test the sequence of function calls that derive tls_psk, so that wecan be more confident that changes in the implementation don't break it.Since the NVMe specification doesn't seem to include any test vectorsfor this (nor does its description of the algorithm seem to match whatwas actually implemented, for that matter), I just set the expectedvalues to the values that the code currently produces. In the caseof SHA-512, nvme_auth_generate_digest() currently returns -EINVAL, sofor now the test tests for that too. If it is later determined thatsome other behavior is needed, the test can be updated accordingly.Tested with: tools/testing/kunit/kunit.py run --kunitconfig drivers/nvme/common/Acked-by: Ard Biesheuvel <ardb@kernel.org>Acked-by: Christoph Hellwig <hch@lst.de>Signed-off-by: Eric Biggers <ebiggers@kernel.org>Signed-off-by: Keith Busch <kbusch@kernel.org>
show more ...