function _openid_dh_xorsecret

7.x openid.inc _openid_dh_xorsecret($shared, $secret)
6.x openid.inc _openid_dh_xorsecret($shared, $secret)
1 call to _openid_dh_xorsecret()
openid_association in drupal-6.x/modules/openid/openid.module
Attempt to create a shared secret with the OpenID Provider.

File

drupal-6.x/modules/openid/openid.inc, line 322
OpenID utility functions.

Code

function _openid_dh_xorsecret($shared, $secret) {
  $dh_shared_str = _openid_dh_long_to_binary($shared);
  $sha1_dh_shared = _openid_sha1($dh_shared_str);
  $xsecret = "";
  for ($i = 0; $i < strlen($secret); $i++) {
    $xsecret .= chr(ord($secret[$i]) ^ ord($sha1_dh_shared[$i]));
  }

  return $xsecret;
}