Hash/Salt password with mysql

Moataz Elmasry zaza1851983ml at googlemail.com
Sun Aug 9 20:17:30 CEST 2015


Hi all,

I'm trying to configure freeradius with mysql authentication. Specifically
I'm trying to use a somehow longer hash. I came upon the thread
http://lists.freeradius.org/pipermail/freeradius-users/2015-January/075505.html

Which explains using update control to query hash and salt from the
database. It goes something like this:



update control {
	Tmp-String-0 := "%{sql:SELECT hash FROM <table> WHERE <clause>}"
	Tmp-String-1 := "%{sql:SELECT salt FROM <table> WHERE <clause>}"
}

update control {
	SSHA2-512-Password := "0x%{control:Tmp-String-0}%{control:Tmp-String-1}"
}

This is probably a beginners question, but I don't know what to put in the
where clause as I don't know which parameters are available at the time of
calling this, ideally the statement will look like this:

Assume table: users(id, username, hash, salt)

update control {
	Tmp-String-0 := "%{sql:SELECT hash FROM users WHERE
<USERNAME_CONNECTING = username>}"
	Tmp-String-1 := "%{sql:SELECT salt FROM users WHERE
<USERNAME_CONNECTING = username>}"

}


Any idea how to achieve that? Sepcifically how to get the username the
user is currently submitting


More information about the Freeradius-Users mailing list