Opened 12 years ago

Last modified 8 years ago

#704 closed defect (Fixed)

Name collusion between Windows and OpenSSL

Reported by: sjmurdoch Owned by:
Priority: Low Milestone:
Component: Core Tor/Tor Version:
Severity: Keywords:
Cc: sjmurdoch, nickm, arma Actual Points:
Parent ID: Points:
Reviewer: Sponsor:


When trying to build Tor, the following error is produced:

gcc -DHAVE_CONFIG_H -I. -I../.. -I../common -I/usr/local/include -I/usr/local/ssl/include -I/usr/local/include -g -O2 -Wall -g -O2 -MT crypto.o -MD -MP -MF . deps/crypto.Tpo -c -o crypto.o crypto.c
In file included from C:/msys/1.0/local/ssl/include/openssl/err.h:69,

from crypto.c:26:

C:/msys/1.0/local/ssl/include/openssl/ossl_typ.h:176: error: syntax error before numeric constant

This is because OCSP_RESPONSE is used in /local/ssl/include/openssl/ossl_typ.h but as well as being defined in OpenSSL, it is defined in /mingw/include/wincrypt.h

[Automatically added by flyspray2trac: Operating System: Windows 2k/XP]

Child Tickets

Change History (6)

comment:1 Changed 12 years ago by nickm

Hm. It always worked before. Do you suppose that OpenSSL just started to define OCSP_RESPONSE, or that wincrypt.h
just started to define it? And does it work to simply #undef it between including wincrypt.h and including the
OpenSSL headers?

comment:3 Changed 12 years ago by sjmurdoch

I can't be sure what introduced the problem, since I updated MinGW32, Tor and OpenSSL at the same time. However I think it most likely that the change was between OpenSSL 0.9.8g and 0.9.8h, since the Windows headers are quite old.

In OpenSSL 0.9.8g the offending file crypto/ossl_typ.h has no mention of OCSP. In 0.9.8h it defines OCSP_RESPONSE.

Adding "#undef OCSP_RESPONSE" in src/common/crypto.c, between "#include <wincrypt.h>" and "#endif" fixed the problem for me.

comment:4 Changed 12 years ago by nickm

Okay, applied the fix for 0.2.0 and 0.2.1. thanks!

comment:5 Changed 12 years ago by nickm

flyspray2trac: bug closed.

comment:6 Changed 8 years ago by nickm

Component: Tor ClientTor
Note: See TracTickets for help on using tickets.