summaryrefslogtreecommitdiffhomepage
path: root/dev/kernel/KernelKit
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2025-05-16 13:35:50 +0200
committerAmlal El Mahrouss <amlal@nekernel.org>2025-05-16 13:35:50 +0200
commitc589f92ed0f6e462a976c64d533c1d8a21b2a3ba (patch)
treed08e2dffd0baff10d2660091decbb36064e16c56 /dev/kernel/KernelKit
parent85c3784b85e701389adfc43e7c222cc90bed953d (diff)
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 <amlal@nekernel.org>
Diffstat (limited to 'dev/kernel/KernelKit')
-rw-r--r--dev/kernel/KernelKit/User.h10
1 files changed, 5 insertions, 5 deletions
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