summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibCrypt/crypt.cpp
diff options
context:
space:
mode:
authorIdan Horowitz <idan.horowitz@gmail.com>2022-04-01 20:58:27 +0300
committerLinus Groh <mail@linusgroh.de>2022-04-01 21:24:45 +0100
commit086969277e74d8ba065bf8145d3aeb0dec0bfee5 (patch)
tree02b3699a66735ef806d9b46353491f18f8e4e7b4 /Userland/Libraries/LibCrypt/crypt.cpp
parent0376c127f6e98e03607700d0b3f5154b7014b2f8 (diff)
downloadserenity-086969277e74d8ba065bf8145d3aeb0dec0bfee5.zip
Everywhere: Run clang-format
Diffstat (limited to 'Userland/Libraries/LibCrypt/crypt.cpp')
-rw-r--r--Userland/Libraries/LibCrypt/crypt.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/Userland/Libraries/LibCrypt/crypt.cpp b/Userland/Libraries/LibCrypt/crypt.cpp
index c952a74d07..9823ef980e 100644
--- a/Userland/Libraries/LibCrypt/crypt.cpp
+++ b/Userland/Libraries/LibCrypt/crypt.cpp
@@ -15,7 +15,7 @@ extern "C" {
static struct crypt_data crypt_data;
-char* crypt(const char* key, const char* salt)
+char* crypt(char const* key, char const* salt)
{
crypt_data.initialized = true;
return crypt_r(key, salt, &crypt_data);
@@ -24,7 +24,7 @@ char* crypt(const char* key, const char* salt)
static constexpr size_t crypt_salt_max = 16;
static constexpr size_t sha_string_length = 44;
-char* crypt_r(const char* key, const char* salt, struct crypt_data* data)
+char* crypt_r(char const* key, char const* salt, struct crypt_data* data)
{
if (!data->initialized) {
errno = EINVAL;
@@ -33,7 +33,7 @@ char* crypt_r(const char* key, const char* salt, struct crypt_data* data)
if (salt[0] == '$') {
if (salt[1] == '5') {
- const char* salt_value = salt + 3;
+ char const* salt_value = salt + 3;
size_t salt_len = min(strcspn(salt_value, "$"), crypt_salt_max);
size_t header_len = salt_len + 3;
@@ -46,7 +46,7 @@ char* crypt_r(const char* key, const char* salt, struct crypt_data* data)
Crypto::Hash::SHA256 sha;
sha.update(key);
- sha.update((const u8*)salt_value, salt_len);
+ sha.update((u8 const*)salt_value, salt_len);
auto digest = sha.digest();
auto string = encode_base64(ReadonlyBytes(digest.immutable_data(), digest.data_length()));