Enable md5 support for python 2.5.1 on AIX 5.3

Discussion in 'Python' started by Hajo Ehlers, Jan 16, 2008.

  1. Hajo Ehlers

    Hajo Ehlers Guest

    Given
    AIX 5.3 ML07 including
    openssh.base.4.5.0.5301.I
    openssl.base.0.9.8.4.I

    Latest RPM packages from the AIX Toolbox 11/2007 including
    - openssl-0.9.7l-2.aix5.1.ppc.rpm

    Python 2.5.1

    Problem:
    $python
    >>> import md5

    Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    File "/usr/local/lib/python2.5/md5.py", line 6, in <module>
    from hashlib import md5
    File "/usr/local/lib/python2.5/hashlib.py", line 133, in <module>
    md5 = __get_builtin_constructor('md5')
    File "/usr/local/lib/python2.5/hashlib.py", line 60, in
    __get_builtin_constructor
    import _md5

    Remarks:
    python 2.5.1 requires openssl
    openssl libraries are provided from:
    - openssl.base 0.9.8.4 from IBM in installp format for the latest
    openssh version and goes to /usr/lib
    - openssl-0.9.7l-2 from the AIX toolbox and goes to /opt/freeware/lib

    Analyse:
    $ dump -Hv /usr/local/lib/python2.5/lib-dynload/_hashlib.so
    /usr/local/lib/python2.5/lib-dynload/_hashlib.so:
    INDEX PATH BASE MEMBER
    0 /opt/freeware/lib:/usr/local/lib:/usr/vac/lib:/usr/lib/threads:/
    usr/lib:/lib
    1 libcrypto.a libcrypto.so.
    0.9.7
    2 .

    $ ls -l /usr/local/lib/python2.5/lib-dynload/ | grep md5

    Build environment
    export LDFLAGS=" -L/opt/freeware/lib "
    export CPPFLAGS=" -I/opt/freeware/include"
    export OPT="-O2 -qmaxmem=-1 $CFLAGS"

    ../configure CC=cc_r CXX=xlC_r \
    --without-gcc \
    --with-gcc=cc_r \
    --disable-shared \
    --with-thread \
    --disable-ipv6 \
    --mandir=/usr/local/man \
    --infodir=/usr/local/info

    Thus the build has been done with the openssl version from the Toolbox
    which can be seen as well from the build environment and no md5.so or
    _md5.so file exist.

    Solution:
    For people using openssl v0.9.7 they should unmark _md5 in ./Modules/
    Setup after 'configure' and before 'make'
    $ perl -p -i -e 's/^#_md5/_md5/' ./Modules/Setup

    For people using the openssl v0.9.8 from the openssl.base fileset
    should use the following settings: ( /usr/lib is in front )
    export LDFLAGS="-L/usr/lib -L/opt/freeware/lib "
    export CPPFLAGS="-I/usr/include/openssl -I/opt/freeware/include"

    or apply the workaround of openssl v0.9.7

    hth
    Hajo
    Hajo Ehlers, Jan 16, 2008
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Patrick
    Replies:
    1
    Views:
    653
  2. Replies:
    9
    Views:
    17,094
    John Salerno
    May 8, 2006
  3. ClownPleco

    putenv for AIX and ifdef for AIX

    ClownPleco, Aug 22, 2007, in forum: C Programming
    Replies:
    5
    Views:
    1,134
    Thomas Dickey
    Aug 24, 2007
  4. Replies:
    5
    Views:
    202
    Philippe Lucas
    Jul 8, 2005
  5. Peter Woodsky

    create a md5 / md5 passwd with a salt

    Peter Woodsky, Nov 20, 2008, in forum: Ruby
    Replies:
    6
    Views:
    213
    Brian Candler
    Nov 21, 2008
Loading...

Share This Page