瀏覽代碼

Replacing hardcode value of sha1 for the Registering Password Encoder

jmontoya 11 年之前
父節點
當前提交
efb108bb64
共有 1 個文件被更改,包括 3 次插入3 次删除
  1. 3 3
      main/inc/services.php

+ 3 - 3
main/inc/services.php

@@ -70,14 +70,14 @@ $app->register(new Silex\Provider\SecurityServiceProvider(), array(
     )
 ));
 
-// Registering Password encoder
-// @todo fix hardcoded sha1 value
+// Registering Password encoder.
+// @todo test with the "none" encrypt method.
 use Symfony\Component\Security\Core\Encoder\MessageDigestPasswordEncoder;
 $app['security.encoder.digest'] = $app->share(function($app) {
     // use the sha1 algorithm
     // don't base64 encode the password
     // use only 1 iteration
-    return new MessageDigestPasswordEncoder('sha1', false, 1);
+    return new MessageDigestPasswordEncoder($app['configuration']['password_encryption'], false, 1);
 });
 
 // What to do when login success?