Skip to contentSkip to conversation

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

PATCH New Jason A. Donenfeld 1 participant 1 message Jul 29, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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

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.

---
 tools/testing/selftests/vDSO/vdso_test_chacha.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/vDSO/vdso_test_chacha.c +1 -1
index e38f44e5f803..ade9897535a1 100644
@@ -3,13 +3,13 @@
  * Copyright (C) 2022-2024 Jason A. Donenfeld <[email protected]>. 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[])
 {
Signature · 1 line
2.45.2