Answer the question
In order to leave comments, you need to log in
How to teach basic_db_auth to understand passwords whose hash starts with $apr1$?
Good afternoon.
Debian 8 system, squid3
I decided to move squid users to mysql database, and faced the following problem:
Passwords were generated by htpasswd , and now hash of some passwords starts with $apr1$
I transferred logins and hashes to mysql database. However, passwords whose hashes begin with $apr1$ are not checked by the basic_db_auth script (from the standard distribution). There are no problems with the rest.
Since the script is written in Perl, then for sure, there is an opportunity to "overcome" this problem. The whole question is how?
I just would like to make the transition as transparent as possible for users...
Answer the question
In order to leave comments, you need to log in
The fact that this is a special format combined with salt is what I found. The whole problem is that I can only more or less (rather less) understand perl, but I am not able to change it ....
Therefore, they are interested in ways to solve this problem.
In general, the problem is solved, almost head-on.
It was done:
1. installed module for perl Crypt::PasswdMD5;
The basic_db_auth file has been changed as follows:
added: added
after the line
:return 1 if $md5 && md5_hex($password) eq $key;
Everything is working.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question