Thread: pgsql: Use BIO functions to avoid passing FILE * pointers to OpenSSL

pgsql: Use BIO functions to avoid passing FILE * pointers to OpenSSL

From
mha@postgresql.org (Magnus Hagander)
Date:
Log Message:
-----------
Use BIO functions to avoid passing FILE * pointers to OpenSSL functions.
This fixes potential crashes on old versions of OpenSSL and the requirement on
"Applink" in new versions when building with MSVC and using different
runtimes.

Dave Page with fixes from me.

Modified Files:
--------------
    pgsql/src/interfaces/libpq:
        fe-secure.c (r1.94 -> r1.95)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/interfaces/libpq/fe-secure.c?r1=1.94&r2=1.95)

Re: pgsql: Use BIO functions to avoid passing FILE * pointers to OpenSSL

From
Gregory Stark
Date:
"Magnus Hagander" <mha@postgresql.org> writes:

> Log Message:
> -----------
> Use BIO functions to avoid passing FILE * pointers to OpenSSL functions.
> This fixes potential crashes on old versions of OpenSSL and the requirement on
> "Applink" in new versions when building with MSVC and using different
> runtimes.


Several buildfarm machines are failing:


ccache gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Winline -Wdeclaration-after-statement -Wendif-labels
-fno-strict-aliasing-g -I../../../src/interfaces/libpq -I../../../src/include -D_GNU_SOURCE  -I/usr/include/et  -c -o
initdb.oinitdb.c 
ccache gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Winline -Wdeclaration-after-statement -Wendif-labels
-fno-strict-aliasing-g initdb.o  -L../../../src/port -lpgport -L../../../src/interfaces/libpq -lpq -L../../../src/port
-Wl,-rpath,'/home/gevik/pgfarmbuild/build/HEAD/inst/lib'-lpgport -lssl -lcrypto -lkrb5 -lz -lreadline -ltermcap -lcrypt
-ldl-lm  -o initdb 
../../../src/interfaces/libpq/libpq.so: undefined reference to `ERR_set_mark'
../../../src/interfaces/libpq/libpq.so: undefined reference to `ERR_pop_to_mark'
collect2: ld returned 1 exit status


--
  Gregory Stark
  EnterpriseDB          http://www.enterprisedb.com

Re: pgsql: Use BIO functions to avoid passing FILE * pointers to OpenSSL

From
Tom Lane
Date:
Gregory Stark <stark@enterprisedb.com> writes:
> "Magnus Hagander" <mha@postgresql.org> writes:
>> Use BIO functions to avoid passing FILE * pointers to OpenSSL functions.

> Several buildfarm machines are failing:

http://www.openssl.org/docs/crypto/ERR_set_mark.html
says
ERR_set_mark() and ERR_pop_to_mark() were added in OpenSSL 0.9.8.

Ooops.  Back to the drawing board.

            regards, tom lane