[PATCH] selftests/vDSO: don't #include sodium header in chacha test

Jason A. Donenfeld posted 1 patch 1 year, 6 months ago
tools/testing/selftests/vDSO/vdso_test_chacha.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] selftests/vDSO: don't #include sodium header in chacha test
Posted by Jason A. Donenfeld 1 year, 6 months ago
With changes in various kernel headers, there's a clash if we include
the libsodium header. This is especially hard to fix with build flags,
because we're compiling the assembly together with the C file, for
testing. Instead, just add the single library prototype we're using in
the file and don't bother including the real header.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
---
 tools/testing/selftests/vDSO/vdso_test_chacha.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/vDSO/vdso_test_chacha.c b/tools/testing/selftests/vDSO/vdso_test_chacha.c
index e38f44e5f803..ade9897535a1 100644
--- a/tools/testing/selftests/vDSO/vdso_test_chacha.c
+++ b/tools/testing/selftests/vDSO/vdso_test_chacha.c
@@ -3,13 +3,13 @@
  * Copyright (C) 2022-2024 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved.
  */
 
-#include <sodium/crypto_stream_chacha20.h>
 #include <sys/random.h>
 #include <string.h>
 #include <stdint.h>
 #include "../kselftest.h"
 
 extern void __arch_chacha20_blocks_nostack(uint8_t *dst_bytes, const uint8_t *key, uint32_t *counter, size_t nblocks);
+extern int crypto_stream_chacha20(uint8_t *dst_bytes, uint64_t dst_len, const uint8_t *nonce, const uint8_t *key);
 
 int main(int argc, char *argv[])
 {
-- 
2.45.2