enforceFIPSPolicy配置密钥设置是否与Web应用程序/服务不兼容?

时间:2014-09-17 18:36:08

标签: wcf asp.net-mvc-4 .net-4.5 fips

是enforceFIPSPolicy配置密钥,如here所述仅适用于Windows应用程序?

在我的开发机器(Windows 7)上,我启用了FIPS,然后如果我创建了一个简单的控制台应用程序,如下所示:

static void Main(string[] args)
{
    var algorithm = new RijndaelManaged();
    Console.WriteLine("Algorithm created!");
}

当我运行它时,我收到FIPS错误:

System.InvalidOperationException: This implementation is not part of the Windows 
Platform FIPS validated cryptographic algorithms.

然后,如果我在configuration文件中的app.config元素下添加以下内容:

<runtime>
  <enforceFIPSPolicy enabled="false"/>
</runtime>

应用程序成功执行。

现在,如果我在Web应用程序(ASP.NET MVC 4)中做同样的事情:

public ActionResult Index()
{
    var alg = new RijndaelManaged();
    return View();
}

即使我在应用程序web.config文件中添加了相同的配置部分,代码也会失败。

我还能够在WCF Web服务中观察到相同的行为。

我认为这与Web应用程序和Web服务托管在IIS中的事实有关(尽管我也使用Cassini重现了相同的行为)。

有没有办法让网络应用程序“退出”FIPS检查,就像我们可以为Windows应用程序做的那样?是否有人成功地做到了这一点?

0 个答案:

没有答案