Archive for 2004年07月05日 (月)

OpenSSL 0.9.7d

[ korean simplified chinese english ] [2004/07/05 (月)の記事一覧]
$ gzip -cd openssl-0.9.7d.tar.gz | tar -xvf -
$ cd openssl-0.9.7d
$ PATH=/usr/local/bin:/usr/bin:/bin:/usr/ccs/bin
$ export PATH
$ ./Configure solaris64-sparcv9-gcc shared
$ LD_RUN_PATH=/usr/local/ssl/lib:/usr/local/lib/sparcv9 make
(中略)
$ make tests
testing...
(中略)
DONE via BIO pair: TLSv1, cipher TLSv1/SSLv3 DHE-RSA-AES256-SHA, 1024 bit RSA
10 handshakes of 1 bytes done
Approximate total server time:   0.80 s
Approximate total client time:   2.18 s
OpenSSL 0.9.7d 17 Mar 2004
built on: Mon Jul  5 10:44:12 JST 2004
platform: solaris64-sparcv9-gcc
options:  bn(64,64) md2(int) rc4(ptr,char) des(ptr,risc1,16,int) idea(int) blowfish(ptr)
compiler: gcc -DOPENSSL_SYSNAME_ULTRASPARC -fPIC -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -DOPENSSL_NO_KRB5 -m64 -mcpu=ultrasparc -O3 -Wall -DB_ENDIAN -DMD5_ASM
OPENSSLDIR: "/usr/local/ssl"
$

結果

$ su
# cp  libcrypto.so.0.9.7 /usr/local/ssl/lib
# ldd libssl.so.0
        libcrypto.so.0.9.7 =>    /usr/local/ssl/lib/libcrypto.so.0.9.7
        libsocket.so.1 =>        /usr/lib/64/libsocket.so.1
        libnsl.so.1 =>   /usr/lib/64/libnsl.so.1
        libdl.so.1 =>    /usr/lib/64/libdl.so.1
        libc.so.1 =>     /usr/lib/64/libc.so.1
        libgcc_s.so.1 =>         /usr/local/lib/sparcv9/libgcc_s.so.1
        libmp.so.2 =>    /usr/lib/64/libmp.so.2
        /usr/platform/SUNW,UltraAX-i2/lib/sparcv9/libc_psr.so.1
# exit
$

パッケージにする。

$ PATH=$PATH:/usr/sbin:/sbin build-pkg make install

The abbreviation for the package. It follows the following rules
  + All characters must be alphanumeric
  + First character can not be a numeric
  + Maximum of 9 characters long
  + Can not be the words "new", "install" or "all"

It is customary to make the first four letters unique to the
organisation building the package.

**
** There is a length limit on this question; please keep answer inside
** the "|"'s below.
** 

              |.........|
Package name ? HUopenssl

+++ Package of that name already exists!
+++ HUopenssl - OpenSSL

Still use this name [Y/N] ? [Y] y

****************************************

The machine architechture the package is built for.
Note that the architecture "ALL" || "all" is a synomyn for "sparc,i386"

Architecture ? [sparc] sparcv9

****************************************

Text which specifies the  current version associated with the package. It
follows the following rules:
  + Maximum of 256 characters
  + First character can not be a (

Version ? 0.9.7d

****************************************

The pathname to the base directory for the installation. Note
that BASEDIR in the pkginfo file is always set to / this is just
used for internal purposes.

Base directory ? [/usr/local] /usr/local/ssl

****************************************

Text which specifies the package name. Use this parameter
as the foundation for describing the functionality and
purpose of the package. It has a maximum length of 256
characters

Name ? OpenSSL

****************************************

A comma separated list of categories under which a package
must be displayed. A package must at least belong to the system
or the application category. Each category may only contain
alphanumerics and has a maximum length of 16 characters.

Category ? application

****************************************

Text which describes the package and which builds on the
information given in the package name. It has a maximum
length of 256 characters.

Description ? OpenSSL for 64 bit Sparc

****************************************

Used to identify the vendor

Vendor ? [unknown] KTROAD

****************************************

Contact details for package creator. If blank this is not
placed within the package.

EMail address ? hijiri@ktroad.jp

****************************************

A space separated list of classes defined for a package

Classes ? [none]
(中略)
chroot-install: Cleaning up after CreateDir()
chroot-install: Removing empty project root directories
## Building pkgmap from package prototype file.
ERROR in /home/hijiri/openssl-0.9.7d/InstallPackage/prototype:
    garbled entry
    - pathname: /usr/local/ssl/man/man7/Modes
    - problem: missing or invalid link specification
pkgmk: ERROR: unable to build pkgmap from prototype file
## Packaging was not successful.
/usr/local/bin/build-pkg: Non-zero exit code [256] from /usr/bin/pkgmk -o -r / -d /home/hijiri/openssl-0.9.7d/InstallPackage -f /home/hijiri/openssl-0.9.7d/InstallPackage/prototype
$

なぜか、エラー。
ふつうにインストールしてみる。

$ su
Password:
# . ../.profile
# echo $PATH
/opt/sfw/bin:/usr/sfw/bin:/usr/dt/bin:/usr/openwin/bin:/opt/SUNWppro/bin:/usr/sbin:/usr/bin:/usr/ccs/bin:/usr/local/bin:/usr/sadm/bin
# export PATH
# make install
(中略)
installing libcrypto.so.0.9.7
installing libssl.so.0.9.7
+ rm -f libcrypto.so.0
+ ln -s libcrypto.so.0.9.7 libcrypto.so.0
+ rm -f libcrypto.so
+ ln -s libcrypto.so.0 libcrypto.so
+ rm -f libssl.so.0
+ ln -s libssl.so.0.9.7 libssl.so.0
+ rm -f libssl.so
+ ln -s libssl.so.0 libssl.so
OpenSSL shared libraries have been installed in:
  /usr/local/ssl

If this directory is not in a standard system path for dynamic/shared
libraries, then you will have problems linking and executing
applications that use OpenSSL libraries UNLESS:

* you link with static (archive) libraries.  If you are truly
  paranoid about security, you should use static libraries.
* you use the GNU libtool code during linking
  (http://www.gnu.org/software/libtool/libtool.html)
* you use pkg-config during linking (this requires that
  PKG_CONFIG_PATH includes the path to the OpenSSL shared
  library directory), and make use of -R or -rpath.
  (http://www.freedesktop.org/software/pkgconfig/)
* you specify the system-wide link path via a command such
  as crle(1) on Solaris systems.
* you add the OpenSSL shared library directory to /etc/ld.so.conf
  and run ldconfig(8) on Linux systems.
* you define the LD_LIBRARY_PATH, LIBPATH, SHLIB_PATH (HP),
  DYLD_LIBRARY_PATH (MacOS X) or PATH (Cygwin and DJGPP)
  environment variable and add the OpenSSL shared library
  directory to it.

One common tool to check the dynamic dependencies of an executable
or dynamic library is ldd(1) on most UNIX systems.

See any operating system documentation and manpages about shared
libraries for your version of UNIX.  The following manpages may be
helpful: ld(1), ld.so(1), ld.so.1(1) [Solaris], dld.sl(1) [HP],
ldd(1), crle(1) [Solaris], pldd(1) [Solaris], ldconfig(8) [Linux],
chatr(1) [HP].
cp openssl.pc /usr/local/ssl/lib/pkgconfig
chmod 644 /usr/local/ssl/lib/pkgconfig/openssl.pc
#

パッケージにする。

# cd /usr/local/ssl
# ls -l
total 30
drwxr-xr-x   2 root     bin          512 Jul  5 11:16 bin
drwxr-xr-x   2 root     bin          512 Apr  7  2003 certs
drwxr-xr-x   3 root     bin          512 Apr  7  2003 include
drwxr-xr-x   3 root     bin          512 Jul  5 11:17 lib
drwxr-xr-x   6 root     bin          512 Apr  7  2003 man
drwxr-xr-x   2 root     bin          512 Jul  5 11:16 misc
-rw-r--r--   1 root     other       7782 Jul  5 11:16 openssl.cnf
drwxr-xr-x   2 root     bin          512 Apr  7  2003 private
# find . -print |pkgproto > prototype

“prototype”を修正 先頭の行に”i pkginfo=./pkginfo”を追加.
pkginfoを作成。

# cat pkginfo
PKG="UHopenssl"
NAME="OpenSSL"
ARCH="sparcv9"
CATEGORY="application"
VERSION="0.9.7d"
VENDOR="KTROAD"
BASEDIR="/usr/local/ssl"
CLASSES="none"
EMAIL="hijiri@ktroad.jp"
PSTAMP="Hijiri Umemoto"
#

pkgmkでのエラーの原因は、これだった。

/usr/local/ssl/man/man7/Modes of DES.7 -> des_modes.7

エスケープも括弧でくくることもできなかったので、この部分のprotptypeをコメントアウト。

###s none man/man7/Modes of DES.7=des_modes.7
# pkgmk -r `pwd`
# cd  /var/spool/pkg
# pkgtrans -s `pwd` /export/home/hijiri/openssl-0.9.7d-sparcv9-solaris-local.pkg

OpenLDAP

[ korean simplified chinese english ] [2004/07/05 (月)の記事一覧]
$ gzip -cd openldap-stable-20040614.tgz |tar -xvf -
$ cd openldap-2.2.13
$ env CPPFLAGS="-I/usr/local/include -I/usr/local/BerkeleyDB.4.2/include" \
LDFLAGS="-L/usr/local/lib -L/usr/local/BerkeleyDB.4.2/lib" \
./configure --enable-ldbm
(中略)
checking Cyrus SASL library version... no
configure: error: Cyrus SASL library located but is incompatible

・・・ということで、Cyrus SASLをいれることに。中断。

Cyrus SASL

[ korean simplified chinese english ] [2004/07/05 (月)の記事一覧]

*ダウンロード(ftp://ftp.andrew.cmu.edu/pub/cyrus-mail/cyrus-sasl-2.1.18.tar.gz)なんどやっても、configureに失敗する理由は、OpenSSLを64ビットELFでつくったためだった。そこで、gccのオプションに-m64をつけることに。

$ gzip -cd cyrus-sasl-2.1.18.tar.gz | tar -xvf -
$ cd  cyrus-sasl-2.1.18
$ make distclean
$ rm config.cache
$ CC="gcc -m64" MAKE=gmake LD_LIBRARY_PATH=/usr/local/ssl/lib \
 LIBS="-lssl -lcrypto" \
 LD_RUN_PATH=/usr/local/ssl/lib \
 LDFLAGS="-L/usr/local/ssl/lib -R/usr/local/ssl/lib "
$ export CC MAKE LIBS LD_LIBRARY_PATH LD_RUN_PATH LDFLAGS
$ ./configure --enable-login --enable-anon=no \
 --enable-plain --with-ldap=/usr/local --enable-cram=yes \
 --enable-gssapi=no --disable-krb4 \
 --with-openssl=/usr/local/ssl \
 --with-dblib=berkeley --with-bdb-libdir=/usr/local/BerkeleyDB.4.2/lib \
 --with-bdb-incdir=DIR/usr/local/BerkeleyDB.4.2/include
$ gmake