You should rebuild using libgmp >= 5 to avoid timing attack vulnerability.", PowmInsecureWarning

su -s /bin/sh -c "glance-manage db_sync" glance
/usr/lib64/python2.6/site-packages/Crypto/Util/number.py:57: PowmInsecureWarning                                                                             : Not using mpz_powm_sec.  You should rebuild using libgmp >= 5 to avoid timing                                                                              attack vulnerability.
  _warn("Not using mpz_powm_sec.  You should rebuild using libgmp >= 5 to avoid                                                                              timing attack vulnerability.", PowmInsecureWarning)
[root@controller ~]# rpm -ivh libgmp
error: open of libgmp failed: No such file or directory

  undefined symbol: rpl_malloc

export ac_cv_func_malloc_0_nonnull=yes

CentOS 编译安装 PyCrypto

 
 

来自:http://bugcharmer.blogspot.com/2012/07/building-pycrypto-on-amazon-ec2.html

Step 1 - Install gcc/make

$ sudo yum install gcc$ sudo yum install make

That was easy.

Step 2 - Install the GNU MP Arithmetic Library

$ wget ftp://ftp.gmplib.org/pub/gmp-5.0.5/gmp-5.0.5.tar.bz2$ bunzip2 gmp-5.0.5.tar.bz2$ cd gmp-5.0.5$ sudo ./configure$ sudo make$ sudo make check$ sudo make install$ cd 

Still not too bad.

Step 3 - Install MPIR

$ wget http://www.mpir.org/mpir-2.5.1.tar.bz2$ bunzip mpir-2.5.1.tar.bz2$ cd mpir-2.5.1$ sudo ./configure$ sudo make$ sudo make check$ sudo make install $ cd

Everything worked up through here.

Intermission

There are two problems you’ll run into if you try to build PyCrypto at this point: errors from missing header files and, once you resolve those, runtime errors complaining about an undefined symbol for rpl_malloc. Let’s fix that.

Step 4 - Install the Python development headers

$ sudo yum install python-devel

Easy fix.

Step 5 - Download PyCrypto

$ wget http://ftp.dlitz.net/pub/dlitz/crypto/pycrypto/pycrypto-2.6.tar.gz $ tar xzvf pycrypto-2.6.tar.gz$ cd pycrypto-2.6

Step 6 - Edit the configure script

$ [favorite editor] configure

Find the this section of the script (I added line numbers):

:   if test $ac_cv_func_malloc_0_nonnull = yes; then::  :   $as_echo "#define HAVE MALLOC 1" >> confdefs.h:  :   else:       $as_echo "define HAVE_MALLOC 0" >> confdefs.h: :   case " $LIBOBJS " in:   *" malloc.$ac_objext "* ) ;;:   *) LIBOBJS = "$LIBOBJS malloc.$ac_objext":  ;;:  esac:; :  $as_echo "define malloc rpl_malloc" >>confdefs.h::  fi

Keep line 3867, but comment out the rest. Save and exit.

or

$ export ac_cv_func_malloc_0_nonnull=yes

The problem is that when you try to build PyCrypto, autotools thinks that we’re using rpl_malloc instead of malloc. I’m not sure how to fix this problem the right way, but this hack will get rid of the check and just have it use malloc. If someone knows the right way to fix this, please say something in the comments and I’ll update this post.

否则会有如下错误:

ImportError: /usr/local/lib/python2.6/dist-packages/pycrypto-2.6-py2.6-linux-x86_64.egg/Crypto/Cipher/_AES.so: undefined symbol: rpl_malloc

Step 7 - Build PyCrypto

$ python setup.py build$ sudo python.setup.py install

Step 8 - Test PyCrypto

$ python>>> from Crypto.Cipher import AES

If this works, you should be good to go.

If it fails, you did something wrong. You can either rm -r pycrypto-2.6 and re-extract the archive or just rm -r the build folder then grep for anything that says “rpl_malloc” and comment it out. Also edit config.status and change ‘D[“HAVE_MALLOC”]=” 0”’ to say ‘=” 1”’. This is what I did the first time, but when I decided to write this up I started over to try to get it right from the start.

Have fun.

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
<properties> <hudson.security.AuthorizationMatrixProperty> <inheritanceStrategy class="org.jenkinsci.plugins.matrixauth.inheritance.InheritParentStrategy"/> <permission>USER:hudson.model.Item.Read:anonymous</permission> </hudson.security.AuthorizationMatrixProperty> <jenkins.model.BuildDiscarderProperty> <strategy class="hudson.tasks.LogRotator"> <daysToKeep>90</daysToKeep> <numToKeep>-1</numToKeep> <artifactDaysToKeep>30</artifactDaysToKeep> <artifactNumToKeep>-1</artifactNumToKeep> </strategy> </jenkins.model.BuildDiscarderProperty> <com.dabsquared.gitlabjenkins.connection.GitLabConnectionProperty plugin="gitlab-plugin@1.7.7"> <gitLabConnection>src.ift.run</gitLabConnection> <jobCredentialId/> <useAlternativeCredential>false</useAlternativeCredential> </com.dabsquared.gitlabjenkins.connection.GitLabConnectionProperty> <com.sonyericsson.rebuild.RebuildSettings plugin="rebuild@1.34"> <autoRebuild>false</autoRebuild> <rebuildDisabled>false</rebuildDisabled> </com.sonyericsson.rebuild.RebuildSettings> <hudson.plugins.throttleconcurrents.ThrottleJobProperty plugin="throttle-concurrents@2.11"> <maxConcurrentPerNode>3</maxConcurrentPerNode> <maxConcurrentTotal>0</maxConcurrentTotal> <categories class="java.util.concurrent.CopyOnWriteArrayList"/> <throttleEnabled>true</throttleEnabled> <throttleOption>project</throttleOption> <limitOneJobWithMatchingParams>false</limitOneJobWithMatchingParams> <paramsToUseForLimit/> <configVersion>1</configVersion> </hudson.plugins.throttleconcurrents.ThrottleJobProperty> <jenkins.branch.RateLimitBranchProperty_-JobPropertyImpl plugin="branch-api@2.1071.v1a_188a_562481"> <durationName>hour</durationName> <count>40</count> <userBoost>true</userBoost> </jenkins.branch.RateLimitBranchProperty_-JobPropertyImpl> </properties> 请解释这一段jenkins配置
最新发布
07-14
这是一个Jenkins的配置文件,其中包含了一些插件和属性的设置。让我逐个解释每个部分的含义: 1. `<hudson.security.AuthorizationMatrixProperty>`:这个属性定义了Jenkins的授权矩阵,用于管理用户对项目的权限。在这个例子中,允许匿名用户对项目进行读取操作。 2. `<jenkins.model.BuildDiscarderProperty>`:这个属性定义了构建丢弃策略,用于控制构建历史的保存和删除。在这个例子中,使用了一个`hudson.tasks.LogRotator`策略,该策略会保留最近90天的构建日志,并且不限制保存的构建数量。 3. `<com.dabsquared.gitlabjenkins.connection.GitLabConnectionProperty>`:这个属性是GitLab插件的设置,用于与GitLab服务器建立连接。在这个例子中,指定了GitLab服务器的地址为`src.ift.run`,并且没有指定作业凭据。 4. `<com.sonyericsson.rebuild.RebuildSettings>`:这个属性是重新构建插件的设置,用于控制是否启用自动重新构建功能。在这个例子中,禁用了自动重新构建功能。 5. `<hudson.plugins.throttleconcurrents.ThrottleJobProperty>`:这个属性是限制并发作业插件的设置,用于控制并发作业的数量。在这个例子中,限制每个节点同时运行的作业数量为3个,并且禁止全局并发限制。 6. `<jenkins.branch.RateLimitBranchProperty_-JobPropertyImpl>`:这个属性是分支限制插件的设置,用于控制并发构建分支的数量。在这个例子中,限制每小时只能构建40个分支,并且允许用户提高并发限制。 这些配置属性可以根据需求进行修改,以满足特定的Jenkins项目需求。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值