OpenSSL version

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
rickf
Posts: 16
Joined: Wed, 2014-01-08, 16:20

OpenSSL version

#1 Post by rickf »

Hi,

I have build OpenSSL 3.2.1 for windows and installed in a non-default location.

I build Qt 663 with OpenSSL no problems.

When I configure DCMTK and point the WITHOPENSSLINC to the includes path, DCMTK complains that it requires version greater than 1.0.1...

But as far as I can tell it's looking at 3.2.1

How to resolve this?

Thanks

Rick

Michael Onken
DCMTK Developer
Posts: 2051
Joined: Fri, 2004-11-05, 13:47
Location: Oldenburg, Germany
Contact:

Re: OpenSSL version

#2 Post by Michael Onken »

Hi Rick,

are you using a current version (commit) of DCMTK? I think Marco from the team updated OpenSSL support just recently (in February) to support versions 3.1 and 3.2, see this commit.

Best regards,
Michael

Marco Eichelberg
OFFIS DICOM Team
OFFIS DICOM Team
Posts: 1446
Joined: Tue, 2004-11-02, 17:22
Location: Oldenburg, Germany
Contact:

Re: OpenSSL version

#3 Post by Marco Eichelberg »

The CMake variable is named "WITH_OPENSSLINC", not "WITHOPENSSLINC", and it should point to the main directory for OpenSSL, not to the include directory. There should be an "include" subdirectory in the directory to which you point "WITH_OPENSSLINC".

rickf
Posts: 16
Joined: Wed, 2014-01-08, 16:20

Re: OpenSSL version

#4 Post by rickf »

I pulled the updated code from get hub and it now works. Thanks

rickf
Posts: 16
Joined: Wed, 2014-01-08, 16:20

Re: OpenSSL version

#5 Post by rickf »

Hmmm. I'm compiling on a different windows machine and I get
Info: DCMTK OPENSSL support will be disabled: DCMTK requires OpenSSL version 1.0.1 or newer

git status says:

AzureAD+RichardFrank@SXRT2022 MINGW64 /y/dcmtk ((23fd8fc83...))


I tried pointing at the root /
Y:\openssl321.bin
and
Y:\openssl321.bin\include

? Qt built with OpenSSL fine pointing to Y:\openssl321.bin

-DOPENSSL_ROOT_DIR="Y:\openssl321.bin"

How can I further debug this?

rickf
Posts: 16
Joined: Wed, 2014-01-08, 16:20

Re: OpenSSL version

#6 Post by rickf »

On a different machine, same drive setup:

Performing Test OPENSSL_VERSION_CHECK
Performing Test OPENSSL_VERSION_CHECK - Success
Info: DCMTK OPENSSL support will be enabled

I wonder if the check for OpenSSL is picking up another version that is installed on the other machine?

Michael Onken
DCMTK Developer
Posts: 2051
Joined: Fri, 2004-11-05, 13:47
Location: Oldenburg, Germany
Contact:

Re: OpenSSL version

#7 Post by Michael Onken »

Hi,

you can open CMakeCache.txt in the build directory to check value CMake has found for all the OpenSSL library settings (including paths). In my CMakeCache.txt file for example, the following values are found when I use my systems (here: Ubuntus) default installed openssl package:

Code: Select all

//Path to a library.
OPENSSL_CRYPTO_LIBRARY:FILEPATH=/usr/lib/x86_64-linux-gnu/libcrypto.so

//Path to a file.
OPENSSL_INCLUDE_DIR:PATH=/usr/include

//Path to a library.
OPENSSL_SSL_LIBRARY:FILEPATH=/usr/lib/x86_64-linux-gnu/libssl.so
On the same system, I installed openssl under /tmp/openssl_install (and DCMTK source under /tmp/dcmtk). When I start with CMake from scratch and run

Code: Select all

cmake ../dcmtk -DOPENSSL_ROOT_DIR=/tmp/openssl_install
the CMakeCache contains instead:

Code: Select all

//Path to a library.
OPENSSL_CRYPTO_LIBRARY:FILEPATH=/tmp/openssl_install/lib64/libcrypto.so

//Path to a file.
OPENSSL_INCLUDE_DIR:PATH=/tmp/openssl_install/include

//No help, variable specified on the command line.
OPENSSL_ROOT_DIR:UNINITIALIZED=/tmp/openssl_install

//Path to a library.
OPENSSL_SSL_LIBRARY:FILEPATH=/tmp/openssl_install/lib64/libssl.so
i.e. setting OPENSSL_ROOT_DIR should do the trick. Try to provide the OPENSSL_ROOT_DIR via cmake commandline instead of using the GUI in order to to be 100% sure to avoid setting setting OPENSSL_ROOT_DIR only after auto-detection.

Best regards,
Michael

rickf
Posts: 16
Joined: Wed, 2014-01-08, 16:20

Re: OpenSSL version

#8 Post by rickf »

OK I switched over completely to command line:

mkdir dcmtk.bin

cd dcmtk.bin

cmake ../dcmtk -DOPENSSL_ROOT_DIR=Y:/openssl321.bin -DDCMTK_WITH_OPENSSL=ON -DWITH_OPENSSLINC=Y:/openssl321.bin -DCMAKE_INSTALL_PREFIX=Y:/dcmtk.ins -DDCMTK_WIDE_CHAR_FILE_IO_FUNCTIONS=ON -DDCMTK_WITH_ICU=ON -DICU_DATA_LIBRARY_RELEASE=Y:/icu72.1.0.3/icu/lib64/icudt.lib -DICU_DERB_EXECUTABLE=Y:/icu72.1.0.3/icu/bin64/derb.exe -DICU_GENBRK_EXECUTABLE=Y:/icu72.1.0.3/icu/bin64/genbrk.exe -DICU_GENCCODE_EXECUTABLE=Y:/icu72.1.0.3/icu/bin64/genccode.exe -DICU_GENCFU_EXECUTABLE=Y:/icu72.1.0.3/icu/bin64/gencfu.exe -DICU_GENCMN_EXECUTABLE=Y:/icu72.1.0.3/icu/bin64/gencmn.exe -DICU_GENCNVAL_EXECUTABLE=Y:/icu72.1.0.3/icu/bin64/gencnval.exe -DICU_GENDICT_EXECUTABLE=Y:/icu72.1.0.3/icu/bin64/gendict.exe -DICU_GENNORM2_EXECUTABLE=Y:/icu72.1.0.3/icu/bin64/gennorm2.exe -DICU_GENRB_EXECUTABLE=Y:/icu72.1.0.3/icu/bin64/genrb.exe -DICU_GENSPREP_EXECUTABLE=Y:/icu72.1.0.3/icu/bin64/genrb.exe -DICU_ICUINFO_EXECUTABLE=Y:/icu72.1.0.3/icu/bin64/icuinfo.exe -DICU_ICUPKG_EXECUTABLE=Y:/icu72.1.0.3/icu/bin64/icupkg.exe -DICU_INCLUDE_DIR=Y:/icu72.1.0.3/icu/include -DICU_MAKECONV_EXECUTABLE=Y:/icu72.1.0.3/icu/bin64/makeconv.exe -DICU_PKGDATA_EXECUTABLE=Y:/icu72.1.0.3/icu/bin64/pkgdata.exe -DICU_UCONV_EXECUTABLE=Y:/icu72.1.0.3/icu/bin64/uconv.exe -DICU_UC_LIBRARY_RELEASE=Y:/icu72.1.0.3/icu/lib64/icuuc.lib



This configures. But I get failures which seem to be centered around:

17>Y:\openssl321.bin\include\openssl\types.h(107,30): error C2371: 'EVP_MD_CTX': redefinition; different basic types
17>(compiling source file '../../../dcmtk/dcmsign/libsrc/dcsignat.cc')
17>Y:\dcmtk\dcmsign\include\dcmtk\dcmsign\simdmac.h(39,30):
17>see declaration of 'EVP_MD_CTX'

this is found in Y:\openssl321.bin\include\openssl\types.h


and simdmac.h
----------------------



#ifndef HAVE_OPENSSL_DECLARATION_NEW_EVP_MD_CTX
struct env_md_ctx_st;
typedef struct env_md_ctx_st EVP_MD_CTX;
#else
struct evp_md_ctx_st;
typedef struct evp_md_ctx_st EVP_MD_CTX;
#endif

------------------------------


It's not clear what this does because it seems that the else case is the same?

rickf
Posts: 16
Joined: Wed, 2014-01-08, 16:20

Re: OpenSSL version

#9 Post by rickf »

I modified the code

BEGIN_EXTERN_C
#include <openssl/opensslv.h>
#include <openssl/types.h> ///////////////////////// ADD THIS

END_EXTERN_C
#if 0 ///////////// REMOVE THIS
#ifndef HAVE_OPENSSL_DECLARATION_NEW_EVP_MD_CTX
struct env_md_ctx_st;

typedef struct env_md_ctx_st EVP_MD_CTX;

#else
struct evp_md_ctx_st;
typedef struct evp_md_ctx_st EVP_MD_CTX;
#endif
#endif



But I get
46>LINK : fatal error LNK1104: cannot open file 'Y:\openssl321.bin\lib\dcmtkssl_o.lib'

This seems wrong - it shouldn't be writing back to the openssl lib folder(?)? On my medical device that might be read only.....




?

Thanks

Rick

rickf
Posts: 16
Joined: Wed, 2014-01-08, 16:20

Re: OpenSSL version

#10 Post by rickf »

OK I undid that and added

cmake ../dcmtk -DHAVE_OPENSSL_DECLARATION_NEW_EVP_MD_CTX=1 ....


to my command line.


Seems like now the only thing I see is


Error LNK1104 cannot open file 'Y:\openssl321.bin\lib\dcmtkssl_o.lib' dcmtls Y:\dcmtk.bin\dcmtls\libsrc\LINK 1

rickf
Posts: 16
Joined: Wed, 2014-01-08, 16:20

Re: OpenSSL version

#11 Post by rickf »

Oy

https://forum.dcmtk.org/viewtopic.php?t=4744


OK now it seems to build ok.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 1 guest