problems with RijndaelManagedTransform.DecryptData

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

problems with RijndaelManagedTransform.DecryptData

chris
Hi!

I'm using NeatUpload in a DNN module and from time to time people telling me that the upload doesn't work. Unfortunately, I can't reproduce the error for myself but DNN logs the following problem:

AssemblyVersion: 5.2.3
PortalID: -1
PortalName:
UserID: -1
UserName:
ActiveTabID: -1
ActiveTabName:
RawURL: /NeatUpload/MultiRequestUploadHandler.ashx?NeatUpload_PostBackID=168534AA53D5ECA1122199B13C04F02312723985817391&NeatUpload_MultiRequestControlID=dnn%24ctr419%24ViewContactForm%24MultiFile1&NeatUpload_ArmoredCookies=FJMbGQx5fGUtgIqvCWft4eeqy9A4EL0EntflCbAdlEK2GWtNA6xcMJswqQ%2FEwgDAJ%2FIdnPbi
AbsoluteURL: /NeatUpload/MultiRequestUploadHandler.ashx
UserAgent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; InfoPath.2; OfficeLiveConnector.1.3; OfficeLivePatch.0.0; .NET CLR 3.5.30729; .NET CLR 3.0.30618)
DefaultDataProvider: DotNetNuke.Data.SqlDataProvider, DotNetNuke.SqlDataProvider
ExceptionGUID: ba0f5a1a-0986-48f3-b71b-03d7fe0bf5d0
InnerException: Unhandled Error:
FileName:
FileLineNumber: 0
FileColumnNumber: 0
Method: System.Security.Cryptography.RijndaelManagedTransform.DecryptData
StackTrace:
Message: System.Exception: Unhandled Error: ---> System.Security.Cryptography.CryptographicException: Padding is invalid and cannot be removed. 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.Security.Cryptography.CryptoStream.Dispose(Boolean disposing) at System.IO.Stream.Close() at Brettle.Web.NeatUpload.ObjectProtector.Unprotect(String secureString, Byte[] encryptionKey, Byte[] unused, String encryptionAlgorithm, String validationAlgorithm, Deserializer deserializer, SignatureChecker sigChecker) at Brettle.Web.NeatUpload.ObjectProtector.Unprotect(String secureString, Byte[] encryptionKey, Byte[] validationKey, String encryptionAlgorithm, String validationAlgorithm) at Brettle.Web.NeatUpload.ObjectProtector.Unprotect(String secureString) at Brettle.Web.NeatUpload.UploadHttpModule.GetCookiesFromQueryString(String qs) at Brettle.Web.NeatUpload.UploadHttpModule.Application_BeginRequest(Object sender, EventArgs e) at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) --- End of inner exception stack trace ---

Is there anything I can do to avoid this?

FYI, the server is IIS7 running on Windows Server 2008 x64...

chris
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: problems with RijndaelManagedTransform.DecryptData

chris
Just a thought: Might it have something to do with the machineKey?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: problems with RijndaelManagedTransform.DecryptData

Dean Brettle
Administrator
I believe this error would occur if the application instance that receives a Flash-based upload is a different instance from the one that rendered the page.  That could happen if either your application is occasionally restarting or you are using a web garden/farm.  In either case, to fix the problem specify the same random 32-hex-digit decryptionKey attribute in the <neatUpload> section of each server's Web.config. That key allows NeatUpload to securely communicate the state of uploads across all application instances.
Loading...