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

Setting md5crypt does not work #824

Closed
klodner opened this issue Apr 23, 2024 · 3 comments
Closed

Setting md5crypt does not work #824

klodner opened this issue Apr 23, 2024 · 3 comments

Comments

@klodner
Copy link

klodner commented Apr 23, 2024

When going from 3.2 to current code, setting

$CONF['encrypt'] = 'md5crypt';

no longer works, starting generating different hashes.

The function
function pacrypt

in functions.inc.php does not call md5crypt() as before and goes to some other hash type.

@DavidGoodwin
Copy link
Member

the output should look like :

{MD5-CRYPT}$1$AIjpWveQ$2s3eEAbZiqkJhMYUIVR240

or

$1$AIjpWveQ$2s3eEAbZiqkJhMYUIVR240

what sort of format are you seeing?

the {MD5-CRYPT} prefix will just help the caller figure out the hashing mechanism and as far as I know, shouldn't break anything....

@klodner
Copy link
Author

klodner commented Apr 25, 2024

It was (and should be) generating hash of type

$1$XDeIMRiw$ahktHJEoR8n/DGRpeeInv1

which my Dovecot and Postfix uses

In v. 3.2 the code called md5crypt() in such case:

    switch ($CONF['encrypt']) {
        case 'md5crypt':
            return _pacrypt_md5crypt($pw, $pw_db);

But in current code it calls something different and hash looks like

$2y$10$ba327511ee789d79269dbeIOyPHy7PLu3eWHG9e1Z7XRPpjYSJejK

and I don't know what kind of hash it is, I had to fix the code to call md5crypt() in case of "md5crypt" setting.

@DavidGoodwin
Copy link
Member

i think the $2 is a crypt style one (perhaps using sha1?)

are you sure your $CONF setting for pacrypt is correct - and isn't being overridden by some other file ?

perhaps do a var_dump($mechanism); somewhere around this line to make sure ? https://github.com/postfixadmin/postfixadmin/blob/master/functions.inc.php#L1337

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

No branches or pull requests

2 participants