64) { $key = pack("H*",md5($key)); } $k_ipad = $key ^ str_repeat(chr(0x36), 64) ; $k_opad = $key ^ str_repeat(chr(0x5c), 64) ; /* Heh, let's get recursive. */ $hmac=hmac_md5($k_opad . pack("H*",md5($k_ipad . $data)) ); return $hmac; } /** * Reads and decodes stored user password information * * Direct access to password information is deprecated. * @return string password in plain text * @since 1.4.11 */ function sqauth_read_password() { sqgetGlobalVar('key', $key, SQ_COOKIE); sqgetGlobalVar('onetimepad', $onetimepad,SQ_SESSION); return OneTimePadDecrypt($key, $onetimepad); } /** * Fillin user and password based on SMTP auth settings. * * @param string $user Reference to SMTP username * @param string $pass Reference to SMTP password (unencrypted) * @since 1.4.11 */ function get_smtp_user(&$user, &$pass) { global $username, $smtp_auth_mech, $smtp_sitewide_user, $smtp_sitewide_pass; if ($smtp_auth_mech == 'none') { $user = ''; $pass = ''; } elseif ( isset($smtp_sitewide_user) && isset($smtp_sitewide_pass) && !empty($smtp_sitewide_user)) { $user = $smtp_sitewide_user; $pass = $smtp_sitewide_pass; } else { $user = $username; $pass = sqauth_read_password(); } // plugin authors note: override $user or $pass by // returning an array where the new username is the // first array value and the new password is the // second array value e.g., return array($myuser, $mypass); // $ret = do_hook_function('smtp_auth', array($user, $pass)); if (!empty($ret[0])) $user = $ret[0]; if (!empty($ret[1])) $pass = $ret[1]; }