]> sipb.mit.edu Git - ikiwiki.git/commitdiff
* Fix openid signin secret generation code. This fixes the bug that made
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Tue, 30 Jan 2007 07:21:06 +0000 (07:21 +0000)
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Tue, 30 Jan 2007 07:21:06 +0000 (07:21 +0000)
  all openid signins fail the first time, and then succeed the second
  time.

IkiWiki/Plugin/openid.pm
debian/changelog
doc/bugs/Error:_OpenID_failure:_time_bad_sig:.mdwn

index f43c4db7ffc8806f1ba09e79c6d09757f6aa8484..4a7255069928c7d2b3bafb23730f7ef4783462c1 100644 (file)
@@ -140,13 +140,14 @@ sub getobj ($$) { #{{{
        # Store the secret in the session.
        my $secret=$session->param("openid_secret");
        if (! defined $secret) {
        # Store the secret in the session.
        my $secret=$session->param("openid_secret");
        if (! defined $secret) {
-               $secret=$session->param(openid_secret => time);
+               $secret=rand;
+               $session->param(openid_secret => $secret);
        }
 
        return Net::OpenID::Consumer->new(
                ua => $ua,
                args => $q,
        }
 
        return Net::OpenID::Consumer->new(
                ua => $ua,
                args => $q,
-               consumer_secret => $secret,
+               consumer_secret => sub { return shift()+$secret },
                required_root => $config{cgiurl},
        );
 } #}}}
                required_root => $config{cgiurl},
        );
 } #}}}
index f590d9e39285fa40867247ed0f9f8dab7f2ffdb6..ddf209bdcea168b5f333bcda45704f5b2faf9d8a 100644 (file)
@@ -19,8 +19,11 @@ ikiwiki (1.41) UNRELEASED; urgency=low
     which links to the correct remote page, but is displayed nicely.
   * When building the doc wiki, build with LANG=C.
   * More gettext fun.
     which links to the correct remote page, but is displayed nicely.
   * When building the doc wiki, build with LANG=C.
   * More gettext fun.
+  * Fix openid signin secret generation code. This fixes the bug that made
+    all openid signins fail the first time, and then succeed the second
+    time.
 
 
- -- Joey Hess <joeyh@debian.org>  Sat, 27 Jan 2007 21:16:33 -0500
+ -- Joey Hess <joeyh@debian.org>  Tue, 30 Jan 2007 02:15:33 -0500
 
 ikiwiki (1.40) unstable; urgency=low
 
 
 ikiwiki (1.40) unstable; urgency=low
 
index 8b011c22a42b43676e70e21173487217f701b7c0..f65b572fc23cad9bec0ab81e53fbd2adb831271f 100644 (file)
@@ -25,7 +25,7 @@ ikiwiki or my OpenID servers. --Pawel
                my ($sig_time, $sig) = split(/\-/, $self->args("oic.time") || "");
                # complain if more than an hour since we sent them off
                return $self->_fail("time_expired")   if $sig_time < $now - 3600;
                my ($sig_time, $sig) = split(/\-/, $self->args("oic.time") || "");
                # complain if more than an hour since we sent them off
                return $self->_fail("time_expired")   if $sig_time < $now - 3600;
-               # also complain if the signature is from the future by more than 30 seconds,
+                also complain if the signature is from the future by more than 30 seconds,
                # which compensates for potential clock drift between nodes in a web farm.
                return $self->_fail("time_in_future") if $sig_time - 30 > $now;
                # and check that the time isn't faked
                # which compensates for potential clock drift between nodes in a web farm.
                return $self->_fail("time_in_future") if $sig_time - 30 > $now;
                # and check that the time isn't faked
@@ -40,4 +40,7 @@ ikiwiki or my OpenID servers. --Pawel
 I've had this problem too, but with my track record of reporting OpenID bugs 
 I thought it best if I held my tongue. I usually experience this the first
 time I sign in on any ikiwiki installation of {ikiwiki.kitenet, ikidev, 
 I've had this problem too, but with my track record of reporting OpenID bugs 
 I thought it best if I held my tongue. I usually experience this the first
 time I sign in on any ikiwiki installation of {ikiwiki.kitenet, ikidev, 
-betacantrips}, and I think re-logging in always works. --Ethan
\ No newline at end of file
+betacantrips}, and I think re-logging in always works. --Ethan
+
+> Does seem easier to repro than I thought.
+> Ok, fixed it.. [[bugs/done]] --[[Joey]]