Jelajahi Sumber

Kernel: Move Random.{h,cpp} code to Security subdirectory

Liav A 2 tahun lalu
induk
melakukan
490856453d
36 mengubah file dengan 35 tambahan dan 35 penghapusan
  1. 1 1
      Kernel/Arch/aarch64/PageDirectory.cpp
  2. 1 1
      Kernel/Arch/aarch64/Processor.cpp
  3. 1 1
      Kernel/Arch/init.cpp
  4. 1 1
      Kernel/Arch/x86_64/ISABus/HID/PS2KeyboardDevice.h
  5. 1 1
      Kernel/Arch/x86_64/ISABus/HID/PS2MouseDevice.h
  6. 1 1
      Kernel/Arch/x86_64/ISABus/HID/VMWareMouseDevice.h
  7. 1 1
      Kernel/Arch/x86_64/Interrupts.cpp
  8. 1 1
      Kernel/Arch/x86_64/PageDirectory.cpp
  9. 1 1
      Kernel/Arch/x86_64/Processor.cpp
  10. 1 1
      Kernel/Bus/VirtIO/RNG.h
  11. 1 1
      Kernel/CMakeLists.txt
  12. 1 1
      Kernel/Devices/Audio/Channel.cpp
  13. 1 1
      Kernel/Devices/Audio/Controller.h
  14. 1 1
      Kernel/Devices/Generic/RandomDevice.cpp
  15. 1 1
      Kernel/Devices/HID/Device.h
  16. 1 1
      Kernel/Devices/HID/KeyboardDevice.h
  17. 1 1
      Kernel/Devices/HID/MouseDevice.h
  18. 1 1
      Kernel/Devices/Storage/ATA/AHCI/InterruptHandler.h
  19. 1 1
      Kernel/Devices/Storage/ATA/AHCI/Port.h
  20. 1 1
      Kernel/Devices/Storage/ATA/GenericIDE/Channel.h
  21. 1 1
      Kernel/Devices/Storage/StorageController.h
  22. 1 1
      Kernel/Graphics/VirtIOGPU/DisplayConnector.cpp
  23. 1 1
      Kernel/Graphics/VirtIOGPU/GPU3DDevice.cpp
  24. 1 1
      Kernel/Memory/AddressSpace.cpp
  25. 1 1
      Kernel/Memory/PhysicalRegion.cpp
  26. 1 1
      Kernel/Memory/RegionTree.cpp
  27. 1 1
      Kernel/Net/Intel/E1000ENetworkAdapter.h
  28. 1 1
      Kernel/Net/Intel/E1000NetworkAdapter.h
  29. 1 1
      Kernel/Net/Realtek/RTL8168NetworkAdapter.h
  30. 1 1
      Kernel/Net/TCPSocket.cpp
  31. 1 1
      Kernel/Net/UDPSocket.cpp
  32. 1 1
      Kernel/Security/Random.cpp
  33. 0 0
      Kernel/Security/Random.h
  34. 1 1
      Kernel/Syscalls/execve.cpp
  35. 1 1
      Kernel/Syscalls/getrandom.cpp
  36. 1 1
      Userland/Libraries/LibCrypto/Cipher/Mode/CTR.h

+ 1 - 1
Kernel/Arch/aarch64/PageDirectory.cpp

@@ -12,8 +12,8 @@
 #include <Kernel/InterruptDisabler.h>
 #include <Kernel/Memory/MemoryManager.h>
 #include <Kernel/Prekernel/Prekernel.h>
-#include <Kernel/Random.h>
 #include <Kernel/Sections.h>
+#include <Kernel/Security/Random.h>
 #include <Kernel/Tasks/Process.h>
 #include <Kernel/Tasks/Thread.h>
 

+ 1 - 1
Kernel/Arch/aarch64/Processor.cpp

@@ -14,7 +14,7 @@
 #include <Kernel/Arch/aarch64/CPU.h>
 #include <Kernel/Arch/aarch64/CPUID.h>
 #include <Kernel/InterruptDisabler.h>
-#include <Kernel/Random.h>
+#include <Kernel/Security/Random.h>
 #include <Kernel/Tasks/Process.h>
 #include <Kernel/Tasks/Scheduler.h>
 #include <Kernel/Tasks/Thread.h>

+ 1 - 1
Kernel/Arch/init.cpp

@@ -43,8 +43,8 @@
 #include <Kernel/Net/NetworkingManagement.h>
 #include <Kernel/Panic.h>
 #include <Kernel/Prekernel/Prekernel.h>
-#include <Kernel/Random.h>
 #include <Kernel/Sections.h>
+#include <Kernel/Security/Random.h>
 #include <Kernel/TTY/ConsoleManagement.h>
 #include <Kernel/TTY/PTYMultiplexer.h>
 #include <Kernel/TTY/VirtualConsole.h>

+ 1 - 1
Kernel/Arch/x86_64/ISABus/HID/PS2KeyboardDevice.h

@@ -11,7 +11,7 @@
 #include <Kernel/API/KeyCode.h>
 #include <Kernel/Arch/x86_64/ISABus/I8042Controller.h>
 #include <Kernel/Interrupts/IRQHandler.h>
-#include <Kernel/Random.h>
+#include <Kernel/Security/Random.h>
 
 namespace Kernel {
 

+ 1 - 1
Kernel/Arch/x86_64/ISABus/HID/PS2MouseDevice.h

@@ -10,7 +10,7 @@
 #include <Kernel/API/MousePacket.h>
 #include <Kernel/Arch/x86_64/ISABus/I8042Controller.h>
 #include <Kernel/Interrupts/IRQHandler.h>
-#include <Kernel/Random.h>
+#include <Kernel/Security/Random.h>
 
 namespace Kernel {
 class PS2MouseDevice : public IRQHandler

+ 1 - 1
Kernel/Arch/x86_64/ISABus/HID/VMWareMouseDevice.h

@@ -11,7 +11,7 @@
 #include <Kernel/Arch/x86_64/ISABus/HID/PS2MouseDevice.h>
 #include <Kernel/Arch/x86_64/ISABus/I8042Controller.h>
 #include <Kernel/Interrupts/IRQHandler.h>
-#include <Kernel/Random.h>
+#include <Kernel/Security/Random.h>
 
 namespace Kernel {
 

+ 1 - 1
Kernel/Arch/x86_64/Interrupts.cpp

@@ -17,8 +17,8 @@
 #include <Kernel/Interrupts/UnhandledInterruptHandler.h>
 #include <Kernel/Panic.h>
 #include <Kernel/PerformanceManager.h>
-#include <Kernel/Random.h>
 #include <Kernel/Sections.h>
+#include <Kernel/Security/Random.h>
 #include <Kernel/Tasks/Process.h>
 #include <Kernel/Tasks/Scheduler.h>
 #include <Kernel/Tasks/Thread.h>

+ 1 - 1
Kernel/Arch/x86_64/PageDirectory.cpp

@@ -11,8 +11,8 @@
 #include <Kernel/InterruptDisabler.h>
 #include <Kernel/Memory/MemoryManager.h>
 #include <Kernel/Prekernel/Prekernel.h>
-#include <Kernel/Random.h>
 #include <Kernel/Sections.h>
+#include <Kernel/Security/Random.h>
 #include <Kernel/Tasks/Process.h>
 #include <Kernel/Tasks/Thread.h>
 

+ 1 - 1
Kernel/Arch/x86_64/Processor.cpp

@@ -14,8 +14,8 @@
 
 #include <Kernel/Arch/x86_64/Interrupts/APIC.h>
 #include <Kernel/InterruptDisabler.h>
-#include <Kernel/Random.h>
 #include <Kernel/Sections.h>
+#include <Kernel/Security/Random.h>
 #include <Kernel/StdLib.h>
 #include <Kernel/Tasks/Process.h>
 #include <Kernel/Tasks/Scheduler.h>

+ 1 - 1
Kernel/Bus/VirtIO/RNG.h

@@ -9,7 +9,7 @@
 #include <AK/AtomicRefCounted.h>
 #include <Kernel/Bus/VirtIO/Device.h>
 #include <Kernel/Devices/CharacterDevice.h>
-#include <Kernel/Random.h>
+#include <Kernel/Security/Random.h>
 
 namespace Kernel::VirtIO {
 

+ 1 - 1
Kernel/CMakeLists.txt

@@ -260,10 +260,10 @@ set(KERNEL_SOURCES
     Net/UDPSocket.cpp
     Panic.cpp
     PerformanceEventBuffer.cpp
-    Random.cpp
     ScopedCritical.cpp
     StdLib.cpp
     Syscall.cpp
+    Security/Random.cpp
     Security/Jail.cpp
     Syscalls/anon_create.cpp
     Syscalls/alarm.cpp

+ 1 - 1
Kernel/Devices/Audio/Channel.cpp

@@ -8,8 +8,8 @@
 #include <Kernel/Devices/Audio/Management.h>
 #include <Kernel/Devices/DeviceManagement.h>
 #include <Kernel/Devices/Generic/RandomDevice.h>
-#include <Kernel/Random.h>
 #include <Kernel/Sections.h>
+#include <Kernel/Security/Random.h>
 
 namespace Kernel {
 

+ 1 - 1
Kernel/Devices/Audio/Controller.h

@@ -17,7 +17,7 @@
 #include <Kernel/Locking/Mutex.h>
 #include <Kernel/Memory/PhysicalPage.h>
 #include <Kernel/PhysicalAddress.h>
-#include <Kernel/Random.h>
+#include <Kernel/Security/Random.h>
 
 namespace Kernel {
 

+ 1 - 1
Kernel/Devices/Generic/RandomDevice.cpp

@@ -6,8 +6,8 @@
 
 #include <Kernel/Devices/DeviceManagement.h>
 #include <Kernel/Devices/Generic/RandomDevice.h>
-#include <Kernel/Random.h>
 #include <Kernel/Sections.h>
+#include <Kernel/Security/Random.h>
 
 namespace Kernel {
 

+ 1 - 1
Kernel/Devices/HID/Device.h

@@ -7,7 +7,7 @@
 #pragma once
 
 #include <Kernel/Devices/CharacterDevice.h>
-#include <Kernel/Random.h>
+#include <Kernel/Security/Random.h>
 
 namespace Kernel {
 

+ 1 - 1
Kernel/Devices/HID/KeyboardDevice.h

@@ -14,7 +14,7 @@
 #include <Kernel/Devices/HID/Device.h>
 #include <Kernel/Devices/HID/ScanCodeEvent.h>
 #include <Kernel/Interrupts/IRQHandler.h>
-#include <Kernel/Random.h>
+#include <Kernel/Security/Random.h>
 
 namespace Kernel {
 

+ 1 - 1
Kernel/Devices/HID/MouseDevice.h

@@ -13,7 +13,7 @@
 #include <Kernel/Devices/CharacterDevice.h>
 #include <Kernel/Devices/HID/Device.h>
 #include <Kernel/Interrupts/IRQHandler.h>
-#include <Kernel/Random.h>
+#include <Kernel/Security/Random.h>
 
 namespace Kernel {
 

+ 1 - 1
Kernel/Devices/Storage/ATA/AHCI/InterruptHandler.h

@@ -15,8 +15,8 @@
 #include <Kernel/Locking/Mutex.h>
 #include <Kernel/Memory/PhysicalPage.h>
 #include <Kernel/PhysicalAddress.h>
-#include <Kernel/Random.h>
 #include <Kernel/Sections.h>
+#include <Kernel/Security/Random.h>
 #include <Kernel/Tasks/WaitQueue.h>
 
 namespace Kernel {

+ 1 - 1
Kernel/Devices/Storage/ATA/AHCI/Port.h

@@ -22,8 +22,8 @@
 #include <Kernel/Memory/PhysicalPage.h>
 #include <Kernel/Memory/ScatterGatherList.h>
 #include <Kernel/PhysicalAddress.h>
-#include <Kernel/Random.h>
 #include <Kernel/Sections.h>
+#include <Kernel/Security/Random.h>
 #include <Kernel/Tasks/WaitQueue.h>
 
 namespace Kernel {

+ 1 - 1
Kernel/Devices/Storage/ATA/GenericIDE/Channel.h

@@ -28,7 +28,7 @@
 #include <Kernel/Locking/Mutex.h>
 #include <Kernel/Memory/PhysicalPage.h>
 #include <Kernel/PhysicalAddress.h>
-#include <Kernel/Random.h>
+#include <Kernel/Security/Random.h>
 #include <Kernel/Tasks/WaitQueue.h>
 
 namespace Kernel {

+ 1 - 1
Kernel/Devices/Storage/StorageController.h

@@ -14,7 +14,7 @@
 #include <Kernel/Locking/Mutex.h>
 #include <Kernel/Memory/PhysicalPage.h>
 #include <Kernel/PhysicalAddress.h>
-#include <Kernel/Random.h>
+#include <Kernel/Security/Random.h>
 #include <Kernel/Tasks/WaitQueue.h>
 
 namespace Kernel {

+ 1 - 1
Kernel/Graphics/VirtIOGPU/DisplayConnector.cpp

@@ -11,7 +11,7 @@
 #include <Kernel/Graphics/VirtIOGPU/DisplayConnector.h>
 #include <Kernel/Graphics/VirtIOGPU/GraphicsAdapter.h>
 #include <Kernel/Graphics/VirtIOGPU/Protocol.h>
-#include <Kernel/Random.h>
+#include <Kernel/Security/Random.h>
 
 namespace Kernel {
 

+ 1 - 1
Kernel/Graphics/VirtIOGPU/GPU3DDevice.cpp

@@ -11,7 +11,7 @@
 #include <Kernel/Graphics/VirtIOGPU/GPU3DDevice.h>
 #include <Kernel/Graphics/VirtIOGPU/GraphicsAdapter.h>
 #include <Kernel/Graphics/VirtIOGPU/Protocol.h>
-#include <Kernel/Random.h>
+#include <Kernel/Security/Random.h>
 
 namespace Kernel {
 

+ 1 - 1
Kernel/Memory/AddressSpace.cpp

@@ -13,7 +13,7 @@
 #include <Kernel/Memory/InodeVMObject.h>
 #include <Kernel/Memory/MemoryManager.h>
 #include <Kernel/PerformanceManager.h>
-#include <Kernel/Random.h>
+#include <Kernel/Security/Random.h>
 #include <Kernel/Tasks/Process.h>
 #include <Kernel/Tasks/Scheduler.h>
 

+ 1 - 1
Kernel/Memory/PhysicalRegion.cpp

@@ -9,7 +9,7 @@
 #include <Kernel/Memory/MemoryManager.h>
 #include <Kernel/Memory/PhysicalRegion.h>
 #include <Kernel/Memory/PhysicalZone.h>
-#include <Kernel/Random.h>
+#include <Kernel/Security/Random.h>
 
 namespace Kernel::Memory {
 

+ 1 - 1
Kernel/Memory/RegionTree.cpp

@@ -8,7 +8,7 @@
 #include <Kernel/Memory/AnonymousVMObject.h>
 #include <Kernel/Memory/MemoryManager.h>
 #include <Kernel/Memory/RegionTree.h>
-#include <Kernel/Random.h>
+#include <Kernel/Security/Random.h>
 
 namespace Kernel::Memory {
 

+ 1 - 1
Kernel/Net/Intel/E1000ENetworkAdapter.h

@@ -13,7 +13,7 @@
 #include <Kernel/Interrupts/IRQHandler.h>
 #include <Kernel/Net/Intel/E1000NetworkAdapter.h>
 #include <Kernel/Net/NetworkAdapter.h>
-#include <Kernel/Random.h>
+#include <Kernel/Security/Random.h>
 
 namespace Kernel {
 

+ 1 - 1
Kernel/Net/Intel/E1000NetworkAdapter.h

@@ -12,7 +12,7 @@
 #include <Kernel/IOWindow.h>
 #include <Kernel/Interrupts/IRQHandler.h>
 #include <Kernel/Net/NetworkAdapter.h>
-#include <Kernel/Random.h>
+#include <Kernel/Security/Random.h>
 
 namespace Kernel {
 

+ 1 - 1
Kernel/Net/Realtek/RTL8168NetworkAdapter.h

@@ -12,7 +12,7 @@
 #include <Kernel/IOWindow.h>
 #include <Kernel/Interrupts/IRQHandler.h>
 #include <Kernel/Net/NetworkAdapter.h>
-#include <Kernel/Random.h>
+#include <Kernel/Security/Random.h>
 
 namespace Kernel {
 

+ 1 - 1
Kernel/Net/TCPSocket.cpp

@@ -17,7 +17,7 @@
 #include <Kernel/Net/Routing.h>
 #include <Kernel/Net/TCP.h>
 #include <Kernel/Net/TCPSocket.h>
-#include <Kernel/Random.h>
+#include <Kernel/Security/Random.h>
 #include <Kernel/Tasks/Process.h>
 
 namespace Kernel {

+ 1 - 1
Kernel/Net/UDPSocket.cpp

@@ -10,7 +10,7 @@
 #include <Kernel/Net/Routing.h>
 #include <Kernel/Net/UDP.h>
 #include <Kernel/Net/UDPSocket.h>
-#include <Kernel/Random.h>
+#include <Kernel/Security/Random.h>
 #include <Kernel/Tasks/Process.h>
 
 namespace Kernel {

+ 1 - 1
Kernel/Random.cpp → Kernel/Security/Random.cpp

@@ -14,8 +14,8 @@
 #    include <Kernel/Arch/aarch64/ASM_wrapper.h>
 #endif
 #include <Kernel/Devices/Generic/RandomDevice.h>
-#include <Kernel/Random.h>
 #include <Kernel/Sections.h>
+#include <Kernel/Security/Random.h>
 #include <Kernel/Time/TimeManagement.h>
 
 namespace Kernel {

+ 0 - 0
Kernel/Random.h → Kernel/Security/Random.h


+ 1 - 1
Kernel/Syscalls/execve.cpp

@@ -17,7 +17,7 @@
 #include <Kernel/Memory/SharedInodeVMObject.h>
 #include <Kernel/Panic.h>
 #include <Kernel/PerformanceManager.h>
-#include <Kernel/Random.h>
+#include <Kernel/Security/Random.h>
 #include <Kernel/Tasks/Process.h>
 #include <Kernel/Tasks/Scheduler.h>
 #include <Kernel/Time/TimeManagement.h>

+ 1 - 1
Kernel/Syscalls/getrandom.cpp

@@ -4,7 +4,7 @@
  * SPDX-License-Identifier: BSD-2-Clause
  */
 
-#include <Kernel/Random.h>
+#include <Kernel/Security/Random.h>
 #include <Kernel/Tasks/Process.h>
 #include <Kernel/UserOrKernelBuffer.h>
 

+ 1 - 1
Userland/Libraries/LibCrypto/Cipher/Mode/CTR.h

@@ -97,7 +97,7 @@ public:
     // Encryption, even when decrypting AES-CTR.
     // TODO: How to deal with ciphers that take different arguments?
     // FIXME: Add back the default intent parameter once clang-11 is the default in GitHub Actions.
-    //        Once added back, remove the parameter where it's constructed in get_random_bytes in Kernel/Random.h.
+    //        Once added back, remove the parameter where it's constructed in get_random_bytes in Kernel/Security/Random.h.
     template<typename KeyType, typename... Args>
     explicit constexpr CTR(KeyType const& user_key, size_t key_bits, Intent, Args... args)
         : Mode<T>(user_key, key_bits, Intent::Encryption, args...)