RADIUS plugin problem

RADIUS plugin problem

by anh pham -
Number of replies: 4

I get the problem with RADIUS plugin, when I enable it and try to login with a username/password in Domain controller. It gives me an error

"PHP Fatal error:  Call to undefined function mhash() in /var/www/html/moodle/lib/pear/Crypt/CHAP.php on line 447"

Line 447:

"return substr(mhash(MHASH_SHA1, $this->peerChallenge . $this->authChallenge . $this->username), 0, 8);"

I have hash enable in PHP module. I'm using CentOS.

Any help is appreciate.

Average of ratings: -
In reply to anh pham

Re: RADIUS plugin problem

by Iñaki Arenaza -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
You need to either compile PHP with the mhash option enabled (note that this is different from hash option/module) or compile mhash extension as a module (and then make sure you load the module).

Saludos.
Iñaki.
In reply to Iñaki Arenaza

Re: RADIUS plugin problem

by anh pham -

Thanks so much!

We install php by 'yum'. Could you please show me where to get 'mhash extension'?

In reply to anh pham

Re: RADIUS plugin problem

by Iñaki Arenaza -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
It should be available in the usual CentOS repositories (but I don't use CentOS, so I'm not sure if it's there or not).

If you don't find it there, as a last resort you can edit lib/pear/Crypt/CHAP.php and change all the instances of 'mhash' to 'hash'

Saludos.
Iñaki.
In reply to anh pham

Re: RADIUS plugin problem

by Justin Filip -

I know this was an old discussion but I've just submitted a patch to update the PEAR library that the RADIUS auth plug-in uses to address this problem.

MDL-37625

Average of ratings: Useful (1)