Closed (fixed)
Project:
OpenID
Version:
4.7.x-2.x-dev
Component:
OpenID Client
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
18 Feb 2007 at 23:34 UTC
Updated:
9 Mar 2007 at 00:05 UTC
I get "division by zero" errors in bcpowmod() when I try to login with an openid.
Using the nightly development snapshot:
Nightly development snapshot from DRUPAL-4-7--2
Download: openid-4.7.x-2.x-dev.tar.gz
Size: 20.68 KB
md5_file hash: ceb708cfde00b9820e2cfb78c3ed8d4d
First released: January 13, 2007 - 08:14
Last updated: February 17, 2007 - 14:07
The function openid_association() in openid.module seems to contain an error:
<?php
function openid_association($claimed_id, $idp_endpoint) {
// Remove Old Associations:
db_query("DELETE FROM {openid_association} WHERE created + expires_in < %d", time());
// Check to see if we have an association for this IdP already
$assoc_handle = db_result(db_query("SELECT assoc_handle FROM {openid_association} WHERE idp_endpoint_uri = '%s'", $idp_endpoint));
if (empty($assoc_handle)) {
$r = _openid_dh_rand(OPENID_DH_DEFAULT_MOD);
$private = bcadd($r, 1);
$public = bcpowmod($gen, $private, $mod);
...
?>
Both $gen and $mod are not defined in this function; but they are used in the call to bcpowmod(), causing a division by zero.
Am I missing something ?
Comments
Comment #1
walkah commentedsloppy re-factor my bad. committed fix.
Comment #2
Jo Wouters commentedThank you!
No more 'division by zero's
Comment #3
(not verified) commented