1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 13:27:35 +00:00

Everywhere: Run clang-format

This commit is contained in:
Idan Horowitz 2022-04-01 20:58:27 +03:00 committed by Linus Groh
parent 0376c127f6
commit 086969277e
1665 changed files with 8479 additions and 8479 deletions

View file

@ -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()));