Ticket #74 (closed defect: fixed)

Opened 10 months ago

Last modified 10 months ago

test-id.net crashes with System.ArgumentNullException on my OpenID

Reported by: http://anders.kaseorg.com/ Owned by: http://blog.nerdbank.net/
Priority: trivial Milestone: v3.0.3
Component: OpenID Version: v2.5.4.9045
Keywords: rp Cc:

Description

When I try to use any of the OP tests on  http://test-id.net/ with my OpenID  http://anders.kaseorg.com/, I get this traceback:

2009-05-31 09:29:55,482 (GMT-7) [6] INFO  DotNetOpenAuth.Messaging.Channel - Scanning incoming request for messages: http://test-id.net/OP/Sreg.aspx
2009-05-31 09:29:55,482 (GMT-7) [6] DEBUG DotNetOpenAuth.Messaging.Channel - Incoming HTTP request: http://test-id.net/OP/Sreg.aspx
2009-05-31 09:30:01,372 (GMT-7) [6] DEBUG DotNetOpenAuth.Http - HTTP GET http://anders.kaseorg.com/
2009-05-31 09:30:01,513 (GMT-7) [6] ERROR Global - An unhandled exception was raised. Details follow: System.Web.HttpUnhandledException: Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.ArgumentNullException: Value cannot be null.
Parameter name: input
   at System.Text.RegularExpressions.Regex.IsMatch(String input)
   at System.Text.RegularExpressions.Regex.IsMatch(String input, String pattern, RegexOptions options)
   at DotNetOpenAuth.OpenId.UriIdentifier.<>c__DisplayClass8.<DiscoverFromHtml>b__4(HtmlLink tag) in c:\git\dotnetopenid\src\DotNetOpenAuth\OpenId\UriIdentifier.cs:line 327
   at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source, Func`2 predicate)
   at DotNetOpenAuth.OpenId.UriIdentifier.<DiscoverFromHtml>d__a.MoveNext() in c:\git\dotnetopenid\src\DotNetOpenAuth\OpenId\UriIdentifier.cs:line 327
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at DotNetOpenAuth.OpenId.UriIdentifier.Discover(IDirectWebRequestHandler requestHandler) in c:\git\dotnetopenid\src\DotNetOpenAuth\OpenId\UriIdentifier.cs:line 230
   at DotNetOpenAuth.OpenId.RelyingParty.AuthenticationRequest.Create(Identifier userSuppliedIdentifier, OpenIdRelyingParty relyingParty, Realm realm, Uri returnToUrl, Boolean createNewAssociationsAsNeeded) in c:\git\dotnetopenid\src\DotNetOpenAuth\OpenId\RelyingParty\AuthenticationRequest.cs:line 280
   at DotNetOpenAuth.OpenId.RelyingParty.OpenIdRelyingParty.CreateRequests(Identifier userSuppliedIdentifier, Realm realm, Uri returnToUrl) in c:\git\dotnetopenid\src\DotNetOpenAuth\OpenId\RelyingParty\OpenIdRelyingParty.cs:line 435
   at DotNetOpenAuth.OpenId.RelyingParty.OpenIdRelyingParty.CreateRequests(Identifier userSuppliedIdentifier, Realm realm) in c:\git\dotnetopenid\src\DotNetOpenAuth\OpenId\RelyingParty\OpenIdRelyingParty.cs:line 484
   at DotNetOpenAuth.OpenId.RelyingParty.OpenIdRelyingParty.CreateRequest(Identifier userSuppliedIdentifier, Realm realm) in c:\git\dotnetopenid\src\DotNetOpenAuth\OpenId\RelyingParty\OpenIdRelyingParty.cs:line 291
   at DotNetOpenAuth.OpenId.RelyingParty.OpenIdTextBox.CreateRequest() in c:\git\dotnetopenid\src\DotNetOpenAuth\OpenId\RelyingParty\OpenIdTextBox.cs:line 930
   at DotNetOpenAuth.OpenId.RelyingParty.OpenIdLogin.OnLoggingIn() in c:\git\dotnetopenid\src\DotNetOpenAuth\OpenId\RelyingParty\OpenIdLogin.cs:line 748
   at DotNetOpenAuth.OpenId.RelyingParty.OpenIdLogin.LoginButton_Click(Object sender, EventArgs e) in c:\git\dotnetopenid\src\DotNetOpenAuth\OpenId\RelyingParty\OpenIdLogin.cs:line 802
   at System.Web.UI.WebControls.Button.OnClick(EventArgs e)
   at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
   at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
   at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
   at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
   --- End of inner exception stack trace ---
   at System.Web.UI.Page.HandleError(Exception e)
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
   at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
   at System.Web.UI.Page.ProcessRequest()
   at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context)
   at System.Web.UI.Page.ProcessRequest(HttpContext context)
   at ASP.op_sreg_aspx.ProcessRequest(HttpContext context) in c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\c6ef2140\21de890b\App_Web_f24o5pts.1.cs:line 0
   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

I think this is what prevents me from logging in to stackoverflow.com, as well.

Change History

Changed 10 months ago by http://blog.nerdbank.net/

  • keywords rp added
  • status changed from new to accepted

This repros on the latest builds of DotNetOpenAuth?. Thanks for your report.

Changed 10 months ago by http://blog.nerdbank.net/

  • priority changed from major to trivial
  • milestone set to v3.0.3

The problematic bit in the repro is this element in your HTML page:

<link href="mailto:%22Anders%20Kaseorg%22%20%3Canders%40kaseorg.com%3E" rev="made" /> 

The HTML discovery code incorrectly assumes that all LINK tags have rel attributes, which this one doesn't, which causes null to be passed to the regex test. The fix should be simple.

Changed 10 months ago by http://blog.nerdbank.net/

I also found that if the content-type in the response is application/xhtml+xml, we don't parse the HTML for an XRDS file. So I'm fixing that as well.

Here's another observation for you, Anders:

<link rel="openid.server" href="https://login.launchpad.net/+openid" /> 
<link rel="openid.delegate" href="https://launchpad.net/~anders-kaseorg" /> 
<link rel="openid2.provider" href="https://login.launchpad.net/+openid" /> 
<link rel="openid2.local_id" href="https://launchpad.net/~anders-kaseorg" /> 

Your local_id and delegate values here are wrong. Your XRDS file is correct, but these HTML values are different, and when these values are used Launchpad.net reports an error that the user doesn't exist.

Changed 10 months ago by http://blog.nerdbank.net/

  • status changed from accepted to closed
  • version set to v2.5.4.9045
  • resolution set to fixed

Fixes applied:

v3.0
cd52abdd3f714ba18e9fbfea0d0fec323fbca873
87a97431206bba406daa344e3ddf70411c776588

v2.5
4f2d1b1b5787ce5de85509617c3fac0858992b7a
cae604660eeec8dd8a284332bdcb7fd815291495

Note: See TracTickets for help on using tickets.