[BUGFIX] Implement availability checks for rsaauth
authorHelmut Hummel <helmut.hummel@typo3.org>
Sun, 18 Sep 2011 20:16:10 +0000 (22:16 +0200)
committerXavier Perseguers <xavier@typo3.org>
Mon, 10 Oct 2011 22:35:47 +0000 (00:35 +0200)
The 123 Installer now checks if openssl is configured properly
before enabling saltedpasswords and rsaauth.

Resolves: #28275
Releases: 4.6

Change-Id: I1d6c5ce6e3dfedfac85349baa01c88118bb348f8
Reviewed-on: http://review.typo3.org/5657
Reviewed-by: Georg Ringer
Tested-by: Georg Ringer
Reviewed-by: Dmitry Dulepov
Reviewed-by: Steffen Gebert
Tested-by: Steffen Gebert
Reviewed-by: Xavier Perseguers
Tested-by: Xavier Perseguers
typo3/sysext/saltedpasswords/classes/class.tx_saltedpasswords_autoloader.php

index 9ed4aff..421dced 100644 (file)
@@ -52,13 +52,24 @@ class tx_saltedpasswords_autoloader {
        }
 
        /**
-        * Returns TRUE if PHP modules to run saltedpasswords are loaded and working.
+        * Returns TRUE if PHP modules to run saltedpasswords and rsaauth are loaded and working.
+        * The only known requirement is a working openssl extension which is required by rsaauth.
         *
         * @return boolean
+        * @see tx_rsaauth_php_backend
         */
        protected function isSaltedPasswordsSupported() {
-                       //FIXME: needs to be implemented!
-               return TRUE;
+               $isSupported = FALSE;
+
+               if (is_callable('openssl_pkey_new')) {
+                       $testKey = @openssl_pkey_new();
+                       if (is_resource($testKey)) {
+                               openssl_free_key($testKey);
+                               $isSupported = TRUE;
+                       }
+               }
+
+               return $isSupported;
        }
 
        /**