Redhat Enterprise does not have mcrypt ...

Hi all!

I just ran into a very stupid one. I went to install an application on a customer server. He’s allowing RH5 Enterprise only, and no other repositories than the RH Network. And here, you will not find mcrypt at all; not only the php extension is missing - all the libraries are not included in the distribution. I am not using RH at all, but I tested and build packages on CentOS for him. And here of course mcrypt is included.

Of course, the app has a login feature and using CSecurityManager.

I am thinking about writing an implementation that is eliminating the mcrypt requirement. But I guess there are good reasons why it has been used in the first place and before doing that - has anyone come across this before and found a smart solution? What would I have to think of if I replace the current Security manager?

Thanks for any help!

Extend CSecurityManager and override encrypt and decrypt methods wherein you use other crypt function than mcrypt.

Which functions you can use depends on redhat.

You could implement them like:




class BaseSecurityManager extends CSecurityManager {

public function encrypt($data)

{

 if (extension_loaded('mcrypt')) {

  return parent::encrypt($data);

 }

 //enrypt the data with another method.

}




public function decrypt($data)

{

 if (extension_loaded('mcrypt')) {

  return parent::decrypt($data);

 }

 //decrypt the data with another method.

}

}



Thanks Dave! I was moving into the same direction :)