opensshとopensslのバージョンアップ

opensshが4.4に、opensslが0.9.8dにそれぞれバージョンアップしていたので、これをサーバたちに反映。ひとつのサーバでのopensshのconfigureでこんなエラーが発生しました。

$ export CFLAGS=-I/usr/local/ssl/include
$ ./configure --with-ssl-dir=/usr/local/ssl/include
checking whether getpgrp requires zero arguments... yes
checking OpenSSL header version... 90804f (OpenSSL 0.9.8d 28 Sep 2006)
checking OpenSSL library version... 90803f (OpenSSL 0.9.8c 05 Sep 2006)
checking whether OpenSSL's headers match the library... no
configure: error: Your OpenSSL headers do not match your library.
Check config.log for details.
Also see contrib/findssl.sh for help identifying header/library mismatches.

なんだかライブラリとヘッダのバージョンが違うって言っているようです。
それにcontrib/findssl.shでヘッダやライブラリのミスマッチを探してみてねとも。
早速contrib/findssl.shを動かしてみる。実行権くらいつけてくれればいいのに。。

$ sh ./contrib/findssl.sh
Searching for OpenSSL header files.
0x0090804f /usr/local/ssl/include/openssl/opensslv.h
0x0090801fL /home1/hoge/openssl/openssl-0.9.8a/crypto/opensslv.h
0x0090801fL /home1/hoge/openssl/openssl-0.9.8a/include/openssl/opensslv.h
0x0090802fL /home1/hoge/openssl/openssl-0.9.8b/crypto/opensslv.h
0x0090802fL /home1/hoge/openssl/openssl-0.9.8b/include/openssl/opensslv.h
0x0090804f /home1/hoge/openssl/openssl-0.9.8d/crypto/opensslv.h
0x0090804f /home1/hoge/openssl/openssl-0.9.8d/include/openssl/opensslv.h
0x0090705FL /home1/hoge/openssl/openssl-0.9.7e/crypto/opensslv.h
0x0090705FL /home1/hoge/openssl/openssl-0.9.7e/include/openssl/opensslv.h
0x0090803f /home1/hoge/openssl/openssl-0.9.8c/crypto/opensslv.h
0x0090803f /home1/hoge/openssl/openssl-0.9.8c/include/openssl/opensslv.h

Searching for OpenSSL shared library files.
0x0090704fL /usr/local/ssl/lib/libcrypto.so.0
0x0090704fL /usr/local/ssl/lib/libcrypto.so.0.9.7
0x0090803fL /usr/local/ssl/lib/libcrypto.so
0x0090803fL /usr/local/ssl/lib/libcrypto.so.0.9.8
0x0090802fL /home1/hoge/openssl/openssl-0.9.8b/libcrypto.so
0x0090802fL /home1/hoge/openssl/openssl-0.9.8b/libcrypto.so.0.9.8
0x0090803fL /home1/hoge/openssl/openssl-0.9.8c/libcrypto.so
0x0090803fL /home1/hoge/openssl/openssl-0.9.8c/libcrypto.so.0.9.8

Searching for OpenSSL static library files.
0x0090804fL /usr/local/ssl/lib/libcrypto.a
0x0090801fL /home1/hoge/openssl/openssl-0.9.8a/libcrypto.a
0x0090802fL /home1/hoge/openssl/openssl-0.9.8b/libcrypto.a
0x0090804fL /home1/hoge/openssl/openssl-0.9.8d/libcrypto.a
0x0090705fL /home1/hoge/openssl/openssl-0.9.7e/libcrypto.a
0x0090803fL /home1/hoge/openssl/openssl-0.9.8c/libcrypto.a


いまからインストールしようとしている0.9.8dのインクルードファイルがなぜかすでに/usr/local/ssl/includeに入ってるみたい。make installした記憶はないんですが、たくさんのマシンでやってたから間違ってやっちゃったのかもしれないです。この前のバージョンである0.9.8cを再度make,make installして、opensshをconfigure,make。

$ cd ~/openssl/openssl-0.9.8c
$ ./config shared
$ /usr/local/bin/make
# /usr/local/bin/make install

$ cd ~/openssl/openssl-0.9.8d
$ ./config shared
$ /usr/local/bin/make
# /usr/local/bin/make install

$ cd .././openssh/openssh-4.4p1
$ ./configure --with-ssl-dir=/usr/local/ssl
$ /usr/local/bin/make
# /usr/local/bin/make install

OpenSSLをsharedでconfigureしていた環境でstaticなものを上書きすると悪影響がでるよというお話でした。