From 662046f50f04924d9f00e3341beccb929cbad224 Mon Sep 17 00:00:00 2001 From: Retro_Guy Date: Fri, 11 Jun 2021 07:50:54 +0000 Subject: [PATCH] Authenticate email login using changing keys --- Rocksolid_Light/rocksolid/mail.php | 7 ++++-- Rocksolid_Light/rslight/scripts/cron.php | 27 ++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/Rocksolid_Light/rocksolid/mail.php b/Rocksolid_Light/rocksolid/mail.php index 72bc44e..fb5281d 100644 --- a/Rocksolid_Light/rocksolid/mail.php +++ b/Rocksolid_Light/rocksolid/mail.php @@ -10,6 +10,9 @@ include "newsportal.php"; $offset=$CONFIG['timezone']; } +$keyfile = $spooldir.'/keys.dat'; +$keys = unserialize(file_get_contents($keyfile)); + include "head.inc"; // How long should cookie allow user to stay logged in? @@ -20,11 +23,11 @@ include "head.inc"; $_POST['username'] = $_COOKIE['mail_name']; } $name = $_POST['username']; - if(password_verify($_POST['username'].get_user_config($_POST['username'],'encryptionkey'), $_COOKIE['auth'])) { + if((password_verify($_POST['username'].$keys[0].get_user_config($_POST['username'],'encryptionkey'), $_COOKIE['auth'])) || (password_verify($_POST['username'].$keys[1].get_user_config($_POST['username'],'encryptionkey'), $_COOKIE['auth']))) { $logged_in = true; } else { if(check_bbs_auth($_POST['username'], $_POST['password'])) { - $authkey = password_hash($_POST['username'].get_user_config($_POST['username'],'encryptionkey'), PASSWORD_DEFAULT); + $authkey = password_hash($_POST['username'].$keys[0].get_user_config($_POST['username'],'encryptionkey'), PASSWORD_DEFAULT); ?>