From c589f92ed0f6e462a976c64d533c1d8a21b2a3ba Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Fri, 16 May 2025 13:35:50 +0200 Subject: feat(kernel): User doesn't store the password directly anymore, it is hashed under a 64-bit FNV algorithm. why? - Better security, so that we're sure that no one else knows about the password. also: - Rename super to MGMT (Management), as it manages a NeKernel machine. - Added a copy of cxxdrv in the nekernel source tree. - Working on the custom manual parser for NeKernel. (PoC) Signed-off-by: Amlal El Mahrouss --- dev/kernel/KernelKit/User.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'dev/kernel/KernelKit') diff --git a/dev/kernel/KernelKit/User.h b/dev/kernel/KernelKit/User.h index 250b1dfc..2a12e41e 100644 --- a/dev/kernel/KernelKit/User.h +++ b/dev/kernel/KernelKit/User.h @@ -22,11 +22,11 @@ ///! We got the Super, Standard (%s format) and Guest user, ///! all are used to make authorization operations on the OS. -#define kSuperUser "OS AUTHORITY/SUPER/%s" +#define kSuperUser "OS AUTHORITY/MGMT/%s" #define kGuestUser "OS AUTHORITY/GUEST/%s" #define kStdUser "OS AUTHORITY/STD/%s" -#define kUsersDir "/user/" +#define kUsersDir "/users/" #define kMaxUserNameLen (256U) #define kMaxUserTokenLen (256U) @@ -45,7 +45,7 @@ enum class UserRingKind { typedef Char* UserPublicKey; typedef Char UserPublicKeyType; -/// @brief User class. +/// @brief System User class. class User final { public: User() = delete; @@ -80,12 +80,12 @@ class User final { /// @brief Checks if a password matches the **password**. /// @param password the password to check. - Bool Matches(const UserPublicKey password) noexcept; + Bool Login(const UserPublicKey password) noexcept; private: UserRingKind mUserRing{UserRingKind::kRingStdUser}; Char mUserName[kMaxUserNameLen] = {0}; - Char mUserKey[kMaxUserTokenLen] = {0}; + UInt64 mUserFNV{0UL}; }; } // namespace Kernel -- cgit v1.2.3