How to calculate CUI manually

Fekete Tamás fektom at gmail.com
Wed Jan 16 14:52:09 CET 2019


Hello!

I use Freeradius 3.0.13 and to be able to search back any peoples identity
who made anything illegal, I would like to make a script which creates CUI
for all of the usernames exisiting in the DB and compare it with the user
who is suspicious made something bad.

For this, I found the algorithm which calculates the CUI for users in
/etc/raddb/policy.d/cui

Chargeable-User-Identity :=
"%{sha1:${policy.cui_hash_key}%{tolower:%{User-Name}%{%{outer.request:Operator-Name}:-}}}"

Than, I put the strings after each other with no space on my debian linux
and gave it to sha1sum, but the CUI calculated by Freeradius and calculated
with sha1sum seems quite different.

My command was:
echo "<mystringwhichisnotrevealed>" | sha1sum

Code with sha1sum: baf4d4546ed4665e4d5e141bc9e8e728a7a934ab
Code with Freeradius:
0x38393465333261356361356239306362353834323337323435363634373735386531393266613933

Can you help me fixing my calculation or process?


More information about the Freeradius-Users mailing list