[Mono-list] Getting Method Not Found

Rolando Martinez rolandomartinezg at gmail.com
Sat Feb 23 14:13:28 EST 2008


Hi Again,

  I saw the code between the versions (5.1.4, 5.1.5 and 5.2) for  the call to
*HashAlgorithmType property *in the method *EncodePassword
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://MySql.Web:5.1.5.0:c5687fc88969c44d/MySql.Web.Security.MySQLMembershipProvider/EncodePassword%28String,String,System.Web.Security.MembershipPasswordFormat%29:String>
* <http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://MySql.Web:5.1.5.0:c5687fc88969c44d/MySql.Web.Security.MySQLMembershipProvider/EncodePassword%28String,String,System.Web.Security.MembershipPasswordFormat%29:String>
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://MySql.Web:5.1.5.0:c5687fc88969c44d/MySql.Web.Security.MySQLMembershipProvider/EncodePassword%28String,String,System.Web.Security.MembershipPasswordFormat%29:String>was
changed.

Method EncodePasswod (version 5.1.5 of Mysql.Web of assembly):

   Return Convert
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Convert>.ToBase64String
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Convert/ToBase64String%28Byte%5b%5d%29:String>(HashAlgorithm
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Security.Cryptography.HashAlgorithm>.Create
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Security.Cryptography.HashAlgorithm/Create%28String%29:System.Security.Cryptography.HashAlgorithm>(Membership
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web:2.0.0.0:b03f5f7f11d50a3a/System.Web.Security.Membership>.get_HashAlgorithmType
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web:2.0.0.0:b03f5f7f11d50a3a/System.Web.Security.Membership/get_HashAlgorithmType%28%29:String>).ComputeHash
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Security.Cryptography.HashAlgorithm/ComputeHash%28Byte%5b%5d%29:Byte%5b%5d>(destinationArray))

And Method EncodePasswod (version 5.2 of Mysql.Web of assembly):
 private string EncodePassword(string password, string passwordKey,
            MembershipPasswordFormat format)
        {
            if (password == null)
                return null;
            if (format == MembershipPasswordFormat.Clear)
                return password;

            byte[] passwordBytes = Encoding.Unicode.GetBytes(password);
            byte[] keyBytes = Convert.FromBase64String(passwordKey);
            byte[] keyedBytes = new byte[passwordBytes.Length +
keyBytes.Length];
            Array.Copy(keyBytes, keyedBytes, keyBytes.Length);
            Array.Copy(passwordBytes, 0, keyedBytes, keyBytes.Length,
passwordBytes.Length);

            if (format == MembershipPasswordFormat.Encrypted)
            {
                byte[] encryptedBytes = EncryptPassword(keyedBytes);
                return Convert.ToBase64String(encryptedBytes);
            }
            else if (format == MembershipPasswordFormat.Hashed)
            {
                HashAlgorithm hash =
HashAlgorithm.Create(Membership.HashAlgorithmType);
                return Convert.ToBase64String(hash.ComputeHash(keyedBytes));
            }
            else
            {
                throw new ProviderException("Unsupported password format.");
            }
        }


As you can see the code for this method was change and with the last
version of MySql Conector you could be ok.


Actually, I another problem with the installation of the
mysqlmembership class, I think that I'll send a case to msyql-list.

Best Regards,
Rolando
-------------------------
Hi guys,
Actually, I have the same problem. What is the suggestion about of this?
Change the call to *get_HashAlgorithmType *in provider of mysql or
wait for the implementation of
*System.Web.Security.Membership.get_HashAlgorithmType *?


Best Regards,
Rolando.

I didn't compile anything, I'm just starting xsp2 from the command line...



On 10/30/07, Vasili Sviridov <vsviridov at exceede.com
<http://lists.ximian.com/mailman/listinfo/mono-list>> wrote:


>*
*>* According to reflector there's only 1 place in MySql.Web.dll where that
*>* method (get_HashAlgorithmType) is called.
*>* And if password format is set to encrypted - it should never get there.


*>* I'm not sure you can fix it otherwise.
*>*
*>* Btw, is this a compile-time error or runtime error?
*>*
*>* V.
*>*
*>* J.S. Martin wrote:


*>* > I changed that information, but it still throws the error...
*>* >
*>* >
*>* >
*>* > On 10/30/07, *Vasili Sviridov* <vsviridov at exceede.com
<http://lists.ximian.com/mailman/listinfo/mono-list>


*>* > <mailto:vsviridov at exceede.com
<http://lists.ximian.com/mailman/listinfo/mono-list>>> wrote:
*>* >

*>* >     Yes
*>* >
*>* >     V.

*>* >
*>* >
*>* >     J.S. Martin wrote:
*>* >>     Do you mean like setting the passwordFormat to "Encrypted"

*>* >>     instead of "Hashed"?

*>* >>
*>* >>     On 10/30/07, *Vasili Sviridov* < vsviridov at exceede.com
<http://lists.ximian.com/mailman/listinfo/mono-list>

*>* >>     <mailto:vsviridov at exceede.com
<http://lists.ximian.com/mailman/listinfo/mono-list>>> wrote:

*>* >>

*>* >>         If you can override the membership setting to have the password
*>* >>         Encrypted and not hashed - it should bypass that exception.
*>* >>

*>* >>         J.S. Martin wrote:

*>* >>         > Well, it throws this error when I try to create a user with
*>* >>         a "just
*>* >>         > plain" normal create user wizard.


*>* >>         >
*>* >>         >
*>* >>         >
*>* >>         >
*>* >>         > On 10/30/07, *Vasili Sviridov* <vsviridov at
exceede.com <http://lists.ximian.com/mailman/listinfo/mono-list>


*>* >>         <mailto:vsviridov at exceede.com
<http://lists.ximian.com/mailman/listinfo/mono-list>>
*>* >>         > <mailto:vsviridov at exceede.com
<http://lists.ximian.com/mailman/listinfo/mono-list>


*>* >>         <mailto:vsviridov at exceede.com
<http://lists.ximian.com/mailman/listinfo/mono-list>>>> wrote:

*>* >>         >
*>* >>         >     J.S. Martin wrote:

*>* >>         >
*>* >>         >     What membership method are you using when it throws this

*>* >>         exception?
*>* >>         >
*>* >>         >     That method is still not implemented in mono, but that

*>* >>         could be

*>* >>         >     bypassed.
*>* >>         >
*>* >>         >     V.
*>* >>         >     > I've switched over to the MySQL Connector/Net


*>* membership
*>* >>         >     provider - it
*>* >>         >     > works on .NET, but on Mono I'm getting this error...
*>* >>         >     >


*>* >>         >     >
*>* >>         >     >     //Method not found:
*>* >>         >     >
*>* >>         'System.Web.Security.Membership.get_HashAlgorithmType './


*>* >>
*>* >
*>* >
*>* >
*>* > --
*>* > _________________________________
*>* >
*>* > Joshua S. Martin

*>*

*>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-list/attachments/20080223/ba3be771/attachment-0001.html 


More information about the Mono-list mailing list