Fix build with openssl-0.9.8.

PR:		85309
Submitted by:	Daniel Roethlisberger <daniel@roe.ch>
This commit is contained in:
Dmitry Sivachenko 2005-09-06 06:06:15 +00:00
parent 054a978854
commit 0a7ff81632
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=142052
3 changed files with 51 additions and 12 deletions

View file

@ -19,10 +19,12 @@ BUILD_DEPENDS= qmake:${PORTSDIR}/devel/qmake
HAS_CONFIGURE= yes
USE_X_PREFIX= yes
USE_BZIP2= yes
USE_OPENSSL= yes
USE_QT_VER= 3
QT_NONSTANDARD= yes
CONFIGURE_ENV= QMAKESPEC=${LOCALBASE}/share/qt/mkspecs/freebsd-g++
CONFIGURE_ARGS= --qtdir=${X11BASE}
CONFIGURE_ARGS= --qtdir=${X11BASE} \
--with-openssl-inc=${OPENSSLINC} --with-openssl-lib=${OPENSSLLIB}
MAKE_ARGS+= QTDIR=${X11BASE} \
QMAKESPEC=${LOCALBASE}/share/qt/mkspecs/freebsd-g++

View file

@ -1,5 +1,5 @@
--- configure.orig Wed Dec 17 23:54:50 2003
+++ configure Tue Nov 16 12:33:52 2004
+++ configure Fri Aug 26 11:59:28 2005
@@ -20,17 +20,17 @@
while [ $# -gt 0 ]; do
case "$1" in
@ -21,15 +21,6 @@
shift
;;
@@ -43,6 +43,8 @@
esac
done
+QC_WITH_OPENSSL_INC=/usr/include
+QC_WITH_OPENSSL_LIB=/usr/lib
echo "Configuring qca-tls ..."
@@ -84,7 +86,7 @@
echo Warning: qmake not in \$QTDIR/bin/qmake
echo trying to find it in \$PATH
@ -48,7 +39,27 @@
lib = s;
}
else {
@@ -570,13 +570,6 @@
@@ -175,6 +175,19 @@
if(ret == 0)
conf->addDefine("OSSL_097");
+ // is it at least openssl 0.9.8?
+ str =
+ "#include<openssl/opensslv.h>\n"
+ "int main()\n"
+ "{\n"
+ " unsigned long x = OPENSSL_VERSION_NUMBER;\n"
+ " if(x >= 0x00908000) return 0; else return 1;\n"
+ "}\n";
+ if(!conf->doCompileAndLink(str, ext, &ret))
+ return false;
+ if(ret == 0)
+ conf->addDefine("OSSL_098");
+
if(!inc.isEmpty())
conf->addIncludePath(inc);
if(kb)
@@ -570,13 +583,6 @@
echo
exit 1;
fi

View file

@ -0,0 +1,26 @@
--- qca-tls.cpp.orig Fri Aug 26 10:47:35 2005
+++ qca-tls.cpp Fri Aug 26 10:51:07 2005
@@ -454,7 +454,11 @@
if(!r) {
// try this other public function, for whatever reason
p = (void *)in;
+#ifdef OSSL_098
+ r = d2i_RSA_PUBKEY(NULL, (const unsigned char **)&p, len);
+#else
r = d2i_RSA_PUBKEY(NULL, (unsigned char **)&p, len);
+#endif
}
if(r) {
if(pub) {
@@ -799,7 +803,11 @@
bool createFromDER(const char *in, unsigned int len)
{
unsigned char *p = (unsigned char *)in;
+#ifdef OSSL_098
+ X509 *t = d2i_X509(NULL, (const unsigned char**)&p, len);
+#else
X509 *t = d2i_X509(NULL, &p, len);
+#endif
if(!t)
return false;
fromX509(t);