aspsqlprovider does not work with encrypted passwords and mono 2.4 (Bug #18)


Added by Piotr Walat almost 4 years ago. Updated over 3 years ago.


Status:Closed Start date:
Priority:Normal Due date:
Assignee:Daniel Nauck % Done:

0%

Category:Membership Spent time: -
Target version:2.0

Description

PasswordFormat is set to "Encrypted" - when trying to login using asp.net running on mono 2.4 the following exception is thrown:


Bad PKCS7 padding. Invalid length XXX

Description: HTTP 500. Error processing request.

Stack Trace:

System.Security.Cryptography.CryptographicException: Bad PKCS7 padding. Invalid length 190.
  at Mono.Security.Cryptography.SymmetricTransform.ThrowBadPaddingException (PaddingMode padding, Int32 length, Int32 position) [0x0005c] in /var/tmp/portage/dev-lang/mono-2.4.2/work/mono-2.4.2/mcs/class/corlib/Mono.Security.Cryptography/SymmetricTransform.cs:363 
  at Mono.Security.Cryptography.SymmetricTransform.FinalDecrypt (System.Byte[] inputBuffer, Int32 inputOffset, Int32 inputCount) [0x001a3] in /var/tmp/portage/dev-lang/mono-2.4.2/work/mono-2.4.2/mcs/class/corlib/Mono.Security.Cryptography/SymmetricTransform.cs:515 
  at Mono.Security.Cryptography.SymmetricTransform.TransformFinalBlock (System.Byte[] inputBuffer, Int32 inputOffset, Int32 inputCount) [0x00034] in /var/tmp/portage/dev-lang/mono-2.4.2/work/mono-2.4.2/mcs/class/corlib/Mono.Security.Cryptography/SymmetricTransform.cs:554 
  at System.Security.Cryptography.RijndaelManagedTransform.TransformFinalBlock (System.Byte[] inputBuffer, Int32 inputOffset, Int32 inputCount) [0x00000] in /var/tmp/portage/dev-lang/mono-2.4.2/work/mono-2.4.2/mcs/class/corlib/System.Security.Cryptography/RijndaelManagedTransform.cs:94 
  at System.Web.Security.MembershipProvider.DecryptPassword (System.Byte[] encodedPassword) [0x00017] in /var/tmp/portage/dev-lang/mono-2.4.2/work/mono-2.4.2/mcs/class/System.Web/System.Web.Security/MembershipProvider.cs:123 
  at [[NauckIT]].PostgreSQLProvider.PgMembershipProvider.UnEncodePassword (System.String encodedPassword) [0x00025] in /home/pwalat/Projects/poligon/AspSQLProvider/src/NauckIT.PostgreSQLProvider/PgMembershipProvider.cs:1429 
  at [[NauckIT]].PostgreSQLProvider.PgMembershipProvider.CheckPassword (System.String password, System.String dbpassword) [0x0001e] in /home/pwalat/Projects/poligon/AspSQLProvider/src/NauckIT.PostgreSQLProvider/PgMembershipProvider.cs:1363 
  at [[NauckIT]].PostgreSQLProvider.PgMembershipProvider.ValidateUser (System.String username, System.String password) [0x00149] in /home/pwalat/Projects/poligon/AspSQLProvider/src/NauckIT.PostgreSQLProvider/PgMembershipProvider.cs:1238 
  at System.Web.UI.WebControls.CreateUserWizard.Login () [0x00000] in /var/tmp/portage/dev-lang/mono-2.4.2/work/mono-2.4.2/mcs/class/System.Web/System.Web.UI.WebControls/CreateUserWizard.cs:1619 
  at System.Web.UI.WebControls.CreateUserWizard.OnNextButtonClick (System.Web.UI.WebControls.WizardNavigationEventArgs e) [0x00035] in /var/tmp/portage/dev-lang/mono-2.4.2/work/mono-2.4.2/mcs/class/System.Web/System.Web.UI.WebControls/CreateUserWizard.cs:1337 
  at System.Web.UI.WebControls.Wizard.ProcessEvent (System.String commandName, System.String commandArg) [0x001c3] in /var/tmp/portage/dev-lang/mono-2.4.2/work/mono-2.4.2/mcs/class/System.Web/System.Web.UI.WebControls/Wizard.cs:1366 
  at System.Web.UI.WebControls.Wizard.OnBubbleEvent (System.Object source, System.EventArgs e) [0x0000d] in /var/tmp/portage/dev-lang/mono-2.4.2/work/mono-2.4.2/mcs/class/System.Web/System.Web.UI.WebControls/Wizard.cs:1321 
  at System.Web.UI.WebControls.CreateUserWizard.OnBubbleEvent (System.Object source, System.EventArgs e) [0x0002a] in /var/tmp/portage/dev-lang/mono-2.4.2/work/mono-2.4.2/mcs/class/System.Web/System.Web.UI.WebControls/CreateUserWizard.cs:1286 
  at System.Web.UI.Control.RaiseBubbleEvent (System.Object source, System.EventArgs args) [0x0000c] in /var/tmp/portage/dev-lang/mono-2.4.2/work/mono-2.4.2/mcs/class/System.Web/System.Web.UI/Control.cs:1093 
  at System.Web.UI.WebControls.Button.OnCommand (System.Web.UI.WebControls.CommandEventArgs e) [0x0002f] in /var/tmp/portage/dev-lang/mono-2.4.2/work/mono-2.4.2/mcs/class/System.Web/System.Web.UI.WebControls/Button.cs:260 
  at System.Web.UI.WebControls.Button.RaisePostBackEvent (System.String eventArgument) [0x00034] in /var/tmp/portage/dev-lang/mono-2.4.2/work/mono-2.4.2/mcs/class/System.Web/System.Web.UI.WebControls/Button.cs:279 
  at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent (System.String eventArgument) [0x00000] in /var/tmp/portage/dev-lang/mono-2.4.2/work/mono-2.4.2/mcs/class/System.Web/System.Web.UI.WebControls/Button.cs:240 
  at System.Web.UI.Page.RaisePostBackEvent (IPostBackEventHandler sourceControl, System.String eventArgument) [0x00000] in /var/tmp/portage/dev-lang/mono-2.4.2/work/mono-2.4.2/mcs/class/System.Web/System.Web.UI/Page.cs:1767 
  at System.Web.UI.Page.RaisePostBackEvents () [0x00024] in /var/tmp/portage/dev-lang/mono-2.4.2/work/mono-2.4.2/mcs/class/System.Web/System.Web.UI/Page.cs:1722 
  at System.Web.UI.Page.ProcessRaiseEvents () [0x0005b] in /var/tmp/portage/dev-lang/mono-2.4.2/work/mono-2.4.2/mcs/class/System.Web/System.Web.UI/Page.cs:1614 
  at System.Web.UI.Page.InternalProcessRequest () [0x001c5] in /var/tmp/portage/dev-lang/mono-2.4.2/work/mono-2.4.2/mcs/class/System.Web/System.Web.UI/Page.cs:1535 
  at System.Web.UI.Page.ProcessRequest (System.Web.HttpContext context) [0x0005b] in /var/tmp/portage/dev-lang/mono-2.4.2/work/mono-2.4.2/mcs/class/System.Web/System.Web.UI/Page.cs:1353 

Version information: Mono Version: 2.0.50727.1433; ASP.NET Version: 2.0.50727.1433

History

Updated by Daniel Nauck almost 4 years ago

Can you please post your "<machineKey ... />" section from your web.config?

Updated by Piotr Walat almost 4 years ago

Machine key

<machineKey validationKey="518A9D0E650ACE4CB22A35DA4563315098A96D0BB8E357531C7065D032099214A11D1CA074B6D66FF0836B35CEAAD0E7EEEFAED772754832E0A5F94EF8522222"
decryptionKey="DB5660C109E9EC70F044BA1FED99DE0C5922321C5125E84C23A1B5CA0E426909"
validation="SHA1" decryption="AES" />

Updated by Daniel Nauck almost 4 years ago

Please try to generate a new Key with the GenerateMashineKey tool, attached to this blogpost: http://www.leastprivilege.com/MSDNUSWebCastAuthenticationAndAuthorizationWithASPNET20.aspx

Updated by Piotr Walat over 3 years ago

Well, i tried regenerating the key but with no result. Actually i've tried to run this application under windows (visual studio 2008) and it worked well.. so it is very likely to be a bug in mono

Updated by Daniel Nauck over 3 years ago

Looks very much like a Mono Bug. Can you please report the Bug to the Mono Project?

Url: http://www.mono-project.com/Bugs

Please post the link to the Bug here so we can also track it.

Thanks.

Updated by Daniel Nauck over 3 years ago

  • Priority changed from High to Normal
  • Status changed from New to Feedback
  • Target version set to 2.0

Updated by Daniel Nauck over 3 years ago

Fixed in Mono's SVN r142414.

  • Status changed from Feedback to Closed

Also available in: Atom PDF