Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUGFIX: Login with and actually decrypt the master encryption key #891

Merged
merged 1 commit into from
Feb 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 11 additions & 10 deletions login.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,11 +186,11 @@
$_SESSION['logged'] = true;

// Setup encryption session key
if (is_null($user_encryption_ciphertext) && $user_role > 1) {
if (isset($user_encryption_ciphertext) && $user_role > 1) {
$site_encryption_master_key = decryptUserSpecificKey($user_encryption_ciphertext, $password);
generateUserSessionKey($site_encryption_master_key);

// Setup extension
// Setup extension - currently unused
if (is_null($user_extension_key)) {
// Extension cookie
// Note: Browsers don't accept cookies with SameSite None if they are not HTTPS.
Expand All @@ -200,6 +200,7 @@
$user_php_session = session_id();
mysqli_query($mysqli, "UPDATE users SET user_php_session = '$user_php_session' WHERE user_id = $user_id");
}

}

header("Location: $config_start_page");
Expand Down Expand Up @@ -282,14 +283,14 @@
<!-- Font Awesome -->
<link rel="stylesheet" href="plugins/fontawesome-free/css/all.min.css">

<!--
<!--
Favicon
If Fav Icon exists else use the default one
If Fav Icon exists else use the default one
-->
<?php if(file_exists('uploads/favicon.ico')) { ?>
<link rel="icon" type="image/x-icon" href="/uploads/favicon.ico">
<?php } ?>

<!-- Theme style -->
<link rel="stylesheet" href="dist/css/adminlte.min.css">
<!-- Google Font: Source Sans Pro -->
Expand All @@ -313,7 +314,7 @@
<?php if(!empty($config_login_message)){ ?>
<p class="login-box-msg px-0"><?php echo nl2br($config_login_message); ?></p>
<?php } ?>

<?php if (isset($response)) { ?>
<p><?php echo $response; ?></p>
<?php } ?>
Expand All @@ -337,8 +338,8 @@
</div>
</div>

<?php
if (isset($token_field)) {
<?php
if (isset($token_field)) {

echo $token_field;
?>
Expand All @@ -351,10 +352,10 @@
</div>

<?php

}

?>
?>

<button type="submit" class="btn btn-primary btn-block mb-3" name="login">Sign In</button>

Expand Down
Loading