旧版openssl在win7下部分函数存在效率问题

在一次QA的测试中,发现win7系统下我们的程序运行的特别慢,通过排查,发现在在win7下,openssl库中部分函数执行,或第一次执行,效率很低。

如BN_rand()/DH_generate_key(),耗时长达十几秒到数十秒

之后我去google了下相关信息,解释是这个

 

RAND_poll can be incredibly slow on Windows7 due to Heap32Next

http://rt.openssl.org/Ticket/Display.html?id=2100&user=guest&pass=guest


Expected behavior: RAND_poll needs to be limited to taking only a few seconds while still gathering enough entropy. Suggested remedies: A) find an alternate method of heap list traversal or B) find an alternate source of entropy

The cause is the usage of Heap32Next: my testing shows that performance of Heap32Next is linear w/r/t the number of heap entries in the first heap list. Each invocation of Heap32Next (on Win7, contrasted with XP and Vista) can easily take more than 1 second - graphs of the performance of Heap32Next are here: http://thenewjamesbaker.blogspot.com/2009/11/performance-of-heap32next-on-64-bit.html

This report springs from this openssl-users thread: http://groups.google.com/group/mailing.openssl.users/browse_thread/thread/b38d72135da93951/d3cf46fe6311ddbb

 

去openssl的主页下载了最新的版本编译,将openssl版本从原先的0.9.8g升到了目前最新的1.0.0e,问题就得到了解决

 

顺带附上编译vs6编译openssl的两篇参考文章

http://www.cnblogs.com/gleam/archive/2008/05/07/1187154.html

http://hi.baidu.com/yinco/blog/item/79e7b63876c373d4d4622517.html


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值