You are here

function _openid_dh_xorsecret in Drupal 6

Same name and namespace in other branches
  1. 7 modules/openid/openid.inc \_openid_dh_xorsecret()
1 call to _openid_dh_xorsecret()
openid_association in modules/openid/openid.module
Attempt to create a shared secret with the OpenID Provider.

File

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;
}