【发布时间】:2011-07-04 19:11:12
【问题描述】:
我最近在我的产品日志中经常看到这个错误。我已经在网上搜索过这个错误。我看到了一些注释,例如 this、this 或 this。所有这些的底线是我应该设置 machineKey。但是我已经设置了 machineKey! 像这样:
<machineKey decryption="AES"
validation="SHA1"
decryptionKey="64 hex key"
validationKey="other 64 hex key"/>
我也在网络场服务器上,我的应用程序在 asp.net 3.5 上。
我对这个问题很绝望=\我该如何解决这个问题?
谢谢。
编辑:
这是完整的日志:
Time: 04/07/2011 19:52:25
MESSAGE: Padding is invalid and cannot be removed.
HTTP_REFERER:
SOURCE: mscorlib
FORM:
QUERYSTRING: d=iAY45pNWTDkOra20F86mL9NBCe-wjxevTFjlNNxafjqLF0Aug2JmvB-c_8JQN4XnDIU1UJTmY2MC1xuySMKscg2&t=633851453303086250
TARGETSITE: Int32 DecryptData(Byte[], Int32, Int32, Byte[] ByRef, Int32, System.Security.Cryptography.PaddingMode, Boolean)
STACKTRACE: at System.Security.Cryptography.RijndaelManagedTransform.DecryptData(Byte[] inputBuffer, Int32 inputOffset, Int32 inputCount, Byte[]& outputBuffer, Int32 outputOffset, PaddingMode paddingMode, Boolean fLast)
at System.Security.Cryptography.RijndaelManagedTransform.TransformFinalBlock(Byte[] inputBuffer, Int32 inputOffset, Int32 inputCount)
at System.Security.Cryptography.CryptoStream.FlushFinalBlock()
at System.Web.Configuration.MachineKeySection.EncryptOrDecryptData(Boolean fEncrypt, Byte[] buf, Byte[] modifier, Int32 start, Int32 length, IVType ivType, Boolean useValidationSymAlgo)
at System.Web.UI.Page.DecryptStringWithIV(String s, IVType ivType)
at System.Web.Handlers.AssemblyResourceLoader.System.Web.IHttpHandler.ProcessRequest(HttpContext context)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
【问题讨论】:
-
我在那里看到了一件事 - “一个机器人获取页面并将链接上的所有字符都设为小写”,我可以将我的应用程序中的键更改为小写吗?我还看到 QueryString 以大写和小写形式返回 - 所以它可能与我无关?
-
我真的不知道怎么回答。但这是真的,一个机器人让它们都是小写的。但这并不重要——机器人需要读取主页而不是资源,主页没有问题,因为机器人不会回发。但是资源在 url 上保留了这个键,这就是我看到这条消息的重点。
-
在你的日志中你没有提到你在哪个页面得到错误?是在资源上还是在简单页面上?然而,查询字符串不是小写的。总有一些人试图入侵您的网站,或者只是玩弄它。
-
你看到我看到的,它应该显示一些我熟悉的功能或 HTTP_REFERER,所以我知道它来自哪个页面.. 这条消息不断出现,我不知道如何解决它=\
标签: asp.net machinekey