如果在Windows中啓用「在FIPS中使用FIPS兼容算法進行加密,散列和簽名」安全策略選項,則嘗試在.NET Framework中使用許多加密類將導致InvalidOperationException。默認情況下,ASP.NET使用AES來加密ViewState blob,因此失敗。您可以解決此通過增加這樣一個關鍵的web.config:可以使ASP.NET ScriptManager與Windows FIPS安全策略一起使用嗎?
<machineKey validationKey="AutoGenerate,IsolateApps" decryptionKey="AutoGenerate,IsolateApps" validation="3DES" decryption="3DES"/>
以及覆蓋你基本ASP.NET使用。我的問題是:我有大量複雜的ASP.NET Web應用程序,它們大量使用ScriptManager(ASP.NET AJAX的基礎),並且需要由必須啓用FIPS策略設置的政府客戶部署。上面有一個ScriptManager任何ASP.NET頁面拋出此異常:
[InvalidOperationException: This implementation is not part of the Windows Platform FIPS validated cryptographic algorithms.]
System.Security.Cryptography.SHA1Managed..ctor() +3607454
System.Security.Policy.Hash.get_SHA1() +45
System.Web.Handlers.ScriptResourceHandler.GetAssemblyInfoInternal(Assembly assembly) +85
System.Web.Handlers.ScriptResourceHandler.GetAssemblyInfo(Assembly assembly) +99
System.Web.Handlers.RuntimeScriptResourceHandler.GetScriptResourceUrlImpl(List`1 assemblyResourceLists, Boolean zip, Boolean notifyScriptLoaded) +525
System.Web.Handlers.RuntimeScriptResourceHandler.System.Web.Handlers.IScriptResourceHandler.GetScriptResourceUrl(List`1 assemblyResourceLists, Boolean zip, Boolean notifyScriptLoaded) +910
System.Web.Handlers.RuntimeScriptResourceHandler.System.Web.Handlers.IScriptResourceHandler.GetScriptResourceUrl(Assembly assembly, String resourceName, CultureInfo culture, Boolean zip, Boolean notifyScriptLoaded) +193
System.Web.UI.ScriptReference.GetUrlFromName(ScriptManager scriptManager, IControl scriptManagerControl, Boolean zip) +306
System.Web.UI.ScriptManager.RegisterUniqueScripts(List`1 uniqueScripts) +169
System.Web.UI.ScriptManager.RegisterScripts() +407
System.Web.UI.ScriptManager.OnPagePreRenderComplete(Object sender, EventArgs e) +200
System.Web.UI.Page.OnPreRenderComplete(EventArgs e) +11041982
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3672
即使添加了<enforceFIPSPolicy enabled="false"/>
元素的web.config不能解決例外。
有什麼辦法可以配置ASP.NET,使ScriptManager可以與Windows FIPS安全策略一起使用?從微軟