Projet

Général

Profil

Révision be58a50c

Ajouté par Assos Assos il y a environ 7 ans

Weekly update of contrib modules

Voir les différences:

drupal7/sites/all/modules/ldap/ldap_servers/ldap_servers.encryption.inc
173 173
        $key = substr($key, 0, $key_length);
174 174
        // Determine the algorithm IV.
175 175
        $ivsize = mcrypt_enc_get_iv_size($td);
176
        // Split apart IV and text.
177
        $iv = substr($cipher_txt, 0, $ivsize);
178
        $cipher_txt = substr($cipher_txt, $ivsize);
179
        // If the IV exists, decrypt the text.
180
        if ($iv) {
181
          mcrypt_generic_init($td, $key, $iv);
182
          $clear_txt = mdecrypt_generic($td, $cipher_txt);
183
          mcrypt_generic_deinit($td);
176
        // Process if the decoded cipher text is sufficient.
177
        if (strlen($cipher_txt) > $ivsize) {
178
          // Split apart IV and text.
179
          $iv = substr($cipher_txt, 0, $ivsize);
180
          $cipher_txt = substr($cipher_txt, $ivsize);
181
          // If the IV exists, decrypt the text.
182
          if ($iv) {
183
            mcrypt_generic_init($td, $key, $iv);
184
            $clear_txt = mdecrypt_generic($td, $cipher_txt);
185
            mcrypt_generic_deinit($td);
186
          }
184 187
        }
185 188
        // Close the module.
186 189
        mcrypt_module_close($td);

Formats disponibles : Unified diff