Building Encryption Libraries

FIS neither encourages nor supports the use of any specific encryption library. In order to be helpful, here is how we created the libraries for testing GT.M in the development environment.

Ubuntu 8.04 LTS (x86_64)

Packages were installed from standard repositories using the package manager.

Red Hat Enterprise Linux 5.4 (x86_64)

All packages except libgpgme were installed from Red Hat Network. libgpgme was built from source after specifying ./configure CC=gcc CFLAGS=-m64

Red Hat Enterprise Linux 5.5 (x86)

Packages were installed from standard repositories using the package manager.

Red Hat Enterprise Linux 5.3 (IA64)

All packages except libgpgme were installed from Red Hat Network. libgpgme was built from source after specifying ./configure CC=gcc

IBM z/OS (zSeries)

Warning: The configure scripts for the GnuPG libraries do not generate shared libraries, only static archive libraries. Owing to this limitation, the archive libraries are unpacked and recompiled back into dynamically linked libraries. The following example uses libgpg-error as the target. FIS suggests that you create a temporary directory for each DLL.

  1. Unpack the archive : ar -x /usr/local/lib/libgpg-error.a

  2. Link the archive objects into a DLL: xlc -qascii -q64 -W l,DLL -o libgpg-error.dll *.o

  3. Copy the DLL and side deck file into the destination (assumed to be /usr/local/lib): cp libgpg-error.dll libgpg-error.x /usr/local/lib

GPG-ERROR

Apply the patch libgpg-error-1.7.patch to libgpg-error sources. Then run the configuration and installation steps.

  1. ./configure CC=xlc CFLAGS="-qchars=signed -qascii -q64 -qlanglvl=extc99 -qexportall -qrent -qnocsect -W l,DLL -D_XOPEN_SOURCE=600 -D_ENHANCED_ASCII_EXT=0xFFFFFFFF -D_IEEEV1_COMPATIBILITY -D_OPEN_MSGQ_EXT" LD=xlc LDFLAGS="-qascii -q64 -W l,DLL" CXX=xlc++ --enable-shared --prefix=/usr/local

  2. make && make check

  3. (as root) make install

Follow the instructions above to turn the archive library into a dynamically linked library.

GCRYPT

Apply the patch libgcrypt-1.4.4.patch to the libgcrypt sources. Before running the configure and installation steps, you need to place some symbolic links in the sources. Compiling libgpgcrypt on z/OS runs afoul of a limitation of the XLC compiler's include header search path and system headers. Issue the following commands, verbatim, to overcome this limitation:

cd mpi 
ln -s ../src/mpi.h . 
ln -s ../src/memory.h . 
cd - 
cd cipher 
ln -s ../src/mpi.h . 
cd - 

Then:

  1. ./configure CC=xlc CFLAGS="-qchars=signed -qascii -q64 -qlanglvl=extc99 -qexportall -qrent -qnocsect -W l,DLL -D_XOPEN_SOURCE=600 -D_ENHANCED_ASCII_EXT=0xFFFFFFFF -D_IEEEV1_COMPATIBILITY

  2. make && make check

  3. (as root) make install

Follow the instructions from above to turn the archive library into a dynamically linked library.

GPGME

Apply the patch gpgme-1.1.8.patch to the gpgme sources. Then run the configuration and installation steps.

  • ./configure CC=xlc CFLAGS="-qchars=signed -qascii -q64 -qlanglvl=extc99 -qexportall -qrent -qnocsect -W l,DLL -D_XOPEN_SOURCE=600 -D_ENHANCED_ASCII_EXT=0xFFFFFFFF -D_IEEEV1_COMPATIBILITY

  • make && make check

  • (as root) make install

Follow the instructions from above to turn the archive library into a dynamically linked library.

GNUPG

Apply the patch gnupg-1.4.9.patch to the GnuPG sources. Before running the configure and isntallation steps, you need to place some symbolic links in the sources. Compiling libgpgcrypt on z/OS runs afoul of a limitation of the XLC compiler's include header search path and system headers. Issue the following commands, verbatim, to overcome this limitation:

cd mpi
ln -s ../include/mpi.h . 
ln -s ../include/memory.h . 
cd -

Then:

  • ./configure CC=xlc CFLAGS="-qchars=signed -qascii -q64 -qlanglvl=extc99 -qexportall -qrent -qnocsect -W l,DLL -D_XOPEN_SOURCE=600 -D_ENHANCED_ASCII_EXT=0xFFFFFFFF -D_IEEEV1_COMPATIBILITY -D_OPEN_MSGQ_EXT" LD=xlc LDFLAGS="-qascii -q64 -W l,DLL" CXX=xlc++ --without-pth --without-libassuan --without-ksba --prefix=/usr/local

  • make && make check

  • (as root) make install

IBM AIX 5.3 (pSeries)

GPG-ERROR

./configure CC=cc CFLAGS=-q64 ($OBJECT_MODE=64)

CRYPTO (From OpenSSL)

These instructions build OpenSSL which provides libcrypto.

./Configure aix64-cc shared # Note: it is an upper case C 
.make 
(as root) make install 

GPGME

GPGME requires a source level fix to use the proper malloc() that requires an include for stdlib.h in the include section of version.c. Then:

./configure CC="xlc -q64" --disable-asm ($OBJECT_MODE=64)/ or CC=cc CFLAGS=-q64 

GNUPG

GPG on AIX requires the setuid bit to be set. This can be done via chmod u+s /path/to/gpg. Please see http://www.gnupg.org/documentation/faqs.en.html#q6.1

./configure CC="xlc -q64" --disable-asm ($OBJECT_MODE=64) or CC=cc CFLAGS=-q64 

Solaris 9 and 10 (SPARC)

Set $LD_LIBRARY_PATH to include /usr/lib/sparcv9 AND /usr/ucblib/sparcv9 for both Solaris 9 and 10. Solaris seems to default to the 32-bit version of ucblib at runtime, unless the 64-bit path is ahead of the 32-bit in $LD_LIBRARY_PATH. However, using -R/usr/lib/sparcv9 -R/usr/ucblib/sparcv9/ as a CFLAG at build time hard-codes the path into the library, removing the need for $LD_LIBRARY_PATH.

GPG-ERROR

./configure CC=/opt/SUNWspro/bin/cc CFLAGS="-m64 -R/usr/lib/sparcv9 -R/usr/ucblib/sparcv9/" 

GCRYPT

./configure CC=/opt/SUNWspro/bin/cc CFLAGS="-m64 -R/usr/lib/sparcv9 -R/usr/ucblib/sparcv9/" --disable-asm --with-gpg-error-prefix=/usr/local 

GPGME

GPGME requires a source level fix to use the proper malloc() that requires an include for stdlib.h in the include section of version.c.

./configure CC=/opt/SUNWspro/bin/cc CFLAGS="-m64 -R/usr/lib/sparcv9 -R/usr/ucblib/sparcv9/" --disable-asm --with-gpg-error-prefix=/usr/local

GNUPG

./configure CC=/opt/SUNWspro/bin/cc CFLAGS="-m64 -R/usr/lib/sparcv9 -R/usr/ucblib/sparcv9/" --disable-asm

HP-UX 11.31 (IA64)

Depending on which user runs the configure command, you may or may not have to specify the --with-gpg-error-prefix flag.

GPG-ERROR

./configure CC=/usr/bin/cc CFLAGS=+DD64

GCRYPT

./configure CC=/usr/bin/cc CFLAGS=+DD64 --with-gpg-error-prefix=/usr/local

GPGME

GPGME requires a source level fix to use the proper malloc() that requires an include for stdlib.h in the include section of version.c.

./configure CC=/usr/bin/cc CFLAGS=+DD64 --with-gpg-error-prefix=/usr/local

GNUPG

./configure CC=/usr/bin/cc CFLAGS=+DD64 --with-gpg-error-prefix=/usr/local

SUSE Linux Enterprise Server 11 (x86_64)

Packages were installed from standard repositories using the package manager. The libgcrypt packages have been upgraded using openSUSE 11.2 packages.

SUSE Linux Enterprise Server 11 (s390x)

Packages were installed from standard repositories using the package manager.

SUSE Linux Enterprise Server 10 (s390x)

Packages were installed from standard repositories using the package manager.

To uprade the GPG package using the source RPM version 1.4.9-6.1 from openSUSE 11:

  1. Download and install gpg-1.4.9-6.1 src

    rpm.wget ftp://ftp.pbone.net/mirror/ftp5.gwdg.de/pub/opensuse/repositories/home%3A/keutterling/openSUSE_11.0/src/gpg-1.4.9-6.1.src.rpm
    sudo rpm -i gpg-1.4.9-6.1.src.rpm 
  2. Install the required dependencies for building GPG. You can get those from the official SLES 10 CDs/DVD.

    sudo rpm -i db42-4.2.52-20.2.s390x.rpm openssl-devel-0.9.8a-18.36.s390x.rpm cyrus-sasl-devel-2.1.21-18.11.41.s390x.rpm 
    openldap2-2.3.32-0.35.23.s390x.rpm openldap2-devel-2.3.32-0.35.23.s390x.rpm 
  3. Build GPG 1.4.9 RPM.

    rpmbuild -bb /usr/src/packages/SPECS/gpg1.spec 
  4. Upgrade to the new GPG RPM.

    sudo rpm -U /usr/src/packages/RPMS/s390x/gpg-1.4.9-6.1.s390x.rpm