Fix #19096 - A 64-char hex string should be allowed for the blowfish_secret config directive by sk8kai · Pull Request #19436 · phpmyadmin/phpmyadmin · GitHub
Skip to content

Fix #19096 - A 64-char hex string should be allowed for the blowfish_secret config directive#19436

Open
sk8kai wants to merge 1 commit intophpmyadmin:masterfrom
sk8kai:kai/test_pull_request
Open

Fix #19096 - A 64-char hex string should be allowed for the blowfish_secret config directive#19436
sk8kai wants to merge 1 commit intophpmyadmin:masterfrom
sk8kai:kai/test_pull_request

Conversation

@sk8kai
Copy link
Copy Markdown

@sk8kai sk8kai commented Dec 9, 2024

Enhance blowfish_secret Configuration to Accept 64-Character Hexadecimal Strings

Description:

  • Extended blowfish_secret Validation: Updated the configuration handling to accept 64-character hexadecimal strings for the blowfish_secret directive. This enhancement allows users to specify the encryption key in a more flexible format.
  • Hexadecimal String Conversion: Implemented a check to determine if the provided blowfish_secret is a 64-character hexadecimal string. If true, the string is converted to a 32-byte binary key using the hex2bin() function, ensuring compatibility with encryption requirements.
  • Maintained Backward Compatibility: If the blowfish_secret does not meet the new criteria, the existing validation process remains unchanged, preserving current functionality.

Changes enacted within HomeController.php lines 320-340

@kamil-tekiela
Copy link
Copy Markdown
Contributor

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this magic number 64? Could you maybe make a constant with descriptive name?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants