Skip to content

Using higher-level wrapper of OpenSSL SHA1 hash function in civetweb#10380

Merged
linev merged 2 commits intoroot-project:masterfrom
guitargeek:civetweb_1
Jun 29, 2022
Merged

Using higher-level wrapper of OpenSSL SHA1 hash function in civetweb#10380
linev merged 2 commits intoroot-project:masterfrom
guitargeek:civetweb_1

Conversation

@guitargeek
Copy link
Copy Markdown
Contributor

@guitargeek guitargeek commented Apr 11, 2022

This is to get rid of deprecation warninigs when building on Ubuntu
22.04.

Should cause no backwards compatibility poblems, as the functions that
are used now are around at least since OpenSSL 1.0.2:
https://www.openssl.org/docs/man1.0.2/man3/EVP_DigestInit_ex.html

This patch was already applied to upstream civet:
civetweb/civetweb#1072

@guitargeek guitargeek self-assigned this Apr 11, 2022
@guitargeek guitargeek requested a review from linev as a code owner April 11, 2022 16:18
@phsft-bot
Copy link
Copy Markdown

Starting build on ROOT-debian10-i386/cxx14, ROOT-performance-centos8-multicore/default, ROOT-ubuntu16/nortcxxmod, ROOT-ubuntu2004/soversion, mac1015/python3, mac11/cxx17, windows10/cxx14
How to customize builds

@phsft-bot
Copy link
Copy Markdown

Build failed on windows10/cxx14.
Running on null:C:\build\workspace\root-pullrequests-build
See console output.

Errors:

  • [2022-04-11T16:52:04.680Z] c1xx : fatal error C1060: compiler is out of heap space [C:\build\workspace\root-pullrequests-build\build\interpreter\llvm\src\lib\CodeGen\LLVMCodeGen.vcxproj]
  • [2022-04-11T16:52:04.680Z] C:\build\workspace\root-pullrequests-build\root\interpreter\llvm\src\tools\clang\include\clang/AST/DeclObjC.h(1699,1): fatal error C1060: compiler is out of heap space (compiling source file C:\build\workspace\root-pullrequests-build\root\interpreter\llvm\src\tools\clang\lib\AST\Expr.cpp) [C:\build\workspace\root-pullrequests-build\build\interpreter\llvm\src\tools\clang\lib\AST\obj.clangAST.vcxproj]
  • [2022-04-11T16:52:04.680Z] C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\memory(3194,1): fatal error C1060: compiler is out of heap space (compiling source file C:\build\workspace\root-pullrequests-build\root\interpreter\llvm\src\tools\clang\lib\AST\Decl.cpp) [C:\build\workspace\root-pullrequests-build\build\interpreter\llvm\src\tools\clang\lib\AST\obj.clangAST.vcxproj]
  • [2022-04-11T16:52:05.553Z] C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\sal.h(1224,1): fatal error C1060: compiler is out of heap space (compiling source file C:\build\workspace\root-pullrequests-build\root\interpreter\llvm\src\tools\clang\lib\AST\NestedNameSpecifier.cpp) [C:\build\workspace\root-pullrequests-build\build\interpreter\llvm\src\tools\clang\lib\AST\obj.clangAST.vcxproj]
  • [2022-04-11T16:52:05.553Z] C:\build\workspace\root-pullrequests-build\root\interpreter\llvm\src\include\llvm/ADT/FoldingSet.h(225,1): fatal error C1060: compiler is out of heap space (compiling source file C:\build\workspace\root-pullrequests-build\root\interpreter\llvm\src\tools\clang\lib\AST\DeclObjC.cpp) [C:\build\workspace\root-pullrequests-build\build\interpreter\llvm\src\tools\clang\lib\AST\obj.clangAST.vcxproj]
  • [2022-04-11T16:52:05.553Z] C:\build\workspace\root-pullrequests-build\root\interpreter\llvm\src\include\llvm/ADT/STLExtras.h(161,22): fatal error C1060: compiler is out of heap space (compiling source file C:\build\workspace\root-pullrequests-build\root\interpreter\llvm\src\tools\clang\lib\AST\MicrosoftCXXABI.cpp) [C:\build\workspace\root-pullrequests-build\build\interpreter\llvm\src\tools\clang\lib\AST\obj.clangAST.vcxproj]
  • [2022-04-11T16:52:05.553Z] C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\vector(467,88): fatal error C1060: compiler is out of heap space (compiling source file C:\build\workspace\root-pullrequests-build\root\interpreter\llvm\src\tools\clang\lib\AST\Mangle.cpp) [C:\build\workspace\root-pullrequests-build\build\interpreter\llvm\src\tools\clang\lib\AST\obj.clangAST.vcxproj]
  • [2022-04-11T16:52:05.553Z] C:\build\workspace\root-pullrequests-build\root\interpreter\llvm\src\tools\clang\include\clang/AST/Expr.h(2773,1): fatal error C1060: compiler is out of heap space (compiling source file C:\build\workspace\root-pullrequests-build\root\interpreter\llvm\src\tools\clang\lib\AST\ExternalASTSource.cpp) [C:\build\workspace\root-pullrequests-build\build\interpreter\llvm\src\tools\clang\lib\AST\obj.clangAST.vcxproj]
  • [2022-04-11T16:52:05.553Z] c1xx : fatal error C1060: compiler is out of heap space [C:\build\workspace\root-pullrequests-build\build\interpreter\llvm\src\tools\clang\lib\Parse\obj.clangParse.vcxproj]
  • [2022-04-11T16:52:06.004Z] C:\build\workspace\root-pullrequests-build\root\interpreter\llvm\src\include\llvm/ADT/APFloat.h(1100,1): fatal error C1060: compiler is out of heap space (compiling source file C:\build\workspace\root-pullrequests-build\root\interpreter\llvm\src\tools\clang\lib\Frontend\DependencyFile.cpp) [C:\build\workspace\root-pullrequests-build\build\interpreter\llvm\src\tools\clang\lib\Frontend\obj.clangFrontend.vcxproj]

And 313 more

@guitargeek
Copy link
Copy Markdown
Contributor Author

Closing this PR because it has been superseeded by PR in upstream civetweb:
civetweb/civetweb#1072

@guitargeek guitargeek closed this Apr 12, 2022
@linev
Copy link
Copy Markdown
Member

linev commented Apr 21, 2022

Jonas,
we can merge this PR and do not wait for civetweb 1.16 release

@guitargeek guitargeek reopened this May 5, 2022
@phsft-bot
Copy link
Copy Markdown

Starting build on ROOT-debian10-i386/cxx14, ROOT-performance-centos8-multicore/default, ROOT-ubuntu16/nortcxxmod, ROOT-ubuntu2004/soversion, mac1015/python3, mac11/cxx17, windows10/cxx14
How to customize builds

This is to get rid of deprecation warninigs when building on Ubuntu
22.04.

Should cause no backwards compatibility poblems, as the functions that
are used now are around at least since OpenSSL 1.0.2:
https://www.openssl.org/docs/man1.0.2/man3/EVP_DigestInit_ex.html

This patch was already applied to upstream civet:
civetweb/civetweb#1072
@phsft-bot
Copy link
Copy Markdown

Starting build on ROOT-debian10-i386/cxx14, ROOT-performance-centos8-multicore/default, ROOT-ubuntu16/nortcxxmod, ROOT-ubuntu2004/soversion, mac1015/python3, mac11/cxx17, windows10/cxx14
How to customize builds

@guitargeek guitargeek linked an issue May 5, 2022 that may be closed by this pull request
@phsft-bot
Copy link
Copy Markdown

Build failed on windows10/cxx14.
Running on null:C:\build\workspace\root-pullrequests-build
See console output.

Errors:

  • [2022-05-05T12:44:07.950Z] C:\build\workspace\root-pullrequests-build\build\bin\libRHTTP.dll : fatal error LNK1120: 2 unresolved externals [C:\build\workspace\root-pullrequests-build\build\net\http\RHTTP.vcxproj]

@linev
Copy link
Copy Markdown
Member

linev commented May 5, 2022

@guitargeek Something wrong with Windows build?

@Axel-Naumann
Copy link
Copy Markdown
Member

@phsft-bot build just on windows10/cxx14

@phsft-bot
Copy link
Copy Markdown

Starting build on windows10/cxx14
How to customize builds

@phsft-bot
Copy link
Copy Markdown

Build failed on windows10/cxx14.
Running on null:C:\build\workspace\root-pullrequests-build
See console output.

Errors:

  • [2022-05-20T14:11:32.535Z] c1xx : fatal error C1356: unable to find mspdbcore.dll [C:\build\workspace\root-pullrequests-build\build\interpreter\llvm\src\tools\clang\lib\Basic\obj.clangBasic.vcxproj]
  • [2022-05-20T14:11:44.332Z] c1xx : fatal error C1356: unable to find mspdbcore.dll [C:\build\workspace\root-pullrequests-build\build\interpreter\llvm\src\tools\clang\lib\Driver\obj.clangDriver.vcxproj]
  • [2022-05-20T14:11:44.332Z] c1xx : fatal error C1356: unable to find mspdbcore.dll [C:\build\workspace\root-pullrequests-build\build\interpreter\llvm\src\lib\Object\LLVMObject.vcxproj]
  • [2022-05-20T14:11:44.332Z] c1xx : fatal error C1356: unable to find mspdbcore.dll [C:\build\workspace\root-pullrequests-build\build\interpreter\llvm\src\lib\LTO\LLVMLTO.vcxproj]
  • [2022-05-20T14:11:44.332Z] c1xx : fatal error C1356: unable to find mspdbcore.dll [C:\build\workspace\root-pullrequests-build\build\interpreter\llvm\src\lib\Object\LLVMObject.vcxproj]
  • [2022-05-20T14:11:44.332Z] c1xx : fatal error C1356: unable to find mspdbcore.dll [C:\build\workspace\root-pullrequests-build\build\interpreter\llvm\src\tools\clang\lib\Basic\obj.clangBasic.vcxproj]
  • [2022-05-20T14:11:44.332Z] c1xx : fatal error C1356: unable to find mspdbcore.dll [C:\build\workspace\root-pullrequests-build\build\interpreter\llvm\src\tools\clang\lib\Driver\obj.clangDriver.vcxproj]
  • [2022-05-20T14:11:44.332Z] c1xx : fatal error C1356: unable to find mspdbcore.dll [C:\build\workspace\root-pullrequests-build\build\interpreter\llvm\src\lib\LTO\LLVMLTO.vcxproj]
  • [2022-05-20T14:11:44.332Z] c1xx : fatal error C1356: unable to find mspdbcore.dll [C:\build\workspace\root-pullrequests-build\build\interpreter\llvm\src\lib\Object\LLVMObject.vcxproj]
  • [2022-05-20T14:11:44.332Z] c1xx : fatal error C1356: unable to find mspdbcore.dll [C:\build\workspace\root-pullrequests-build\build\interpreter\llvm\src\tools\clang\lib\Driver\obj.clangDriver.vcxproj]

And 163 more

@Axel-Naumann
Copy link
Copy Markdown
Member

@phsft-bot build just on windows10/cxx14

@phsft-bot
Copy link
Copy Markdown

Starting build on windows10/cxx14
How to customize builds

@phsft-bot
Copy link
Copy Markdown

Build failed on windows10/cxx14.
Running on null:C:\build\workspace\root-pullrequests-build
See console output.

Errors:

  • [2022-05-20T15:28:35.977Z] C:\build\workspace\root-pullrequests-build\build\bin\libRHTTP.dll : fatal error LNK1120: 2 unresolved externals [C:\build\workspace\root-pullrequests-build\build\net\http\RHTTP.vcxproj]

@linev
Copy link
Copy Markdown
Member

linev commented May 21, 2022

@bellenot
Failure is:

civetweb.obj : error LNK2019: unresolved external symbol _EVP_Digest referenced in function _send_websocket_handshake [C:\build\workspace\root-pullrequests-build\build\net\http\RHTTP.vcxproj]
civetweb.obj : error LNK2019: unresolved external symbol _EVP_get_digestbyname referenced in function _send_websocket_handshake [C:\build\workspace\root-pullrequests-build\build\net\http\RHTTP.vcxproj]
C:\build\workspace\root-pullrequests-build\build\bin\libRHTTP.dll : fatal error LNK1120: 2 unresolved externals [C:\build\workspace\root-pullrequests-build\build\net\http\RHTTP.vcxproj]

Some extra ssl library is necessary for windows?

@bellenot
Copy link
Copy Markdown
Member

@linev well, I don't know, We don't enable OpenSSL in ROOT on Windows. How does it works now? What changed between the previous version and this one?

@linev
Copy link
Copy Markdown
Member

linev commented May 23, 2022

But then this PR will not work on Windows.
Moreover, next civetweb version will require OpenSSL - which is not very good.

Old code was using SHA1_Init, SHA1_Update, SHA1_Final functions.
For the case when SSL not available - inline version sha.inl was included.

Now it is not provided and therefore original SSL functions should be used.
Are there reasons why SSL is not used on Windows?

@bellenot
Copy link
Copy Markdown
Member

IIRC, once OpenSSL is enabled, it forces to use https only and fails opening standard http

@linev
Copy link
Copy Markdown
Member

linev commented May 23, 2022

IIRC, once OpenSSL is enabled, it forces to use https only and fails opening standard http

No, Linux version always compiled with SSL.
Plain http can be used as well.

@bellenot
Copy link
Copy Markdown
Member

I know there is a good reason, I'll try to find it back

@bellenot
Copy link
Copy Markdown
Member

OK, so -Dbuiltin_ssl=ON doesn't work on Windows...

@linev
Copy link
Copy Markdown
Member

linev commented May 23, 2022

OK, so -Dbuiltin_ssl=ON doesn't work on Windows...

But is there any SSL library provided by Windows itself?

@bellenot
Copy link
Copy Markdown
Member

bellenot commented May 23, 2022

@bellenot
Copy link
Copy Markdown
Member

Note that some OpenSSL binaries are available for Windows, but I'll have to try them

@linev
Copy link
Copy Markdown
Member

linev commented May 23, 2022

@guitargeek
Maybe one should revert changes in civetweb, while at that place SSL is not used - it just calculates some special checksum for websocket.

Keep old code for Windows and older SSL versions
@phsft-bot
Copy link
Copy Markdown

Starting build on ROOT-debian10-i386/soversion, ROOT-performance-centos8-multicore/cxx17, ROOT-ubuntu18.04/nortcxxmod, ROOT-ubuntu2004/python3, mac1015/cxx17, mac11/cxx14, windows10/cxx14
How to customize builds

@linev
Copy link
Copy Markdown
Member

linev commented Jun 29, 2022

I add fallback solution for older OpenSSL or just for systems without OpenSSL - like Windows.
Let see if it will compile.

@linev linev self-requested a review June 29, 2022 10:55
@phsft-bot
Copy link
Copy Markdown

Build failed on ROOT-performance-centos8-multicore/cxx17.
Running on olbdw-01.cern.ch:/data/sftnight/workspace/root-pullrequests-build
See console output.

Failing tests:

@linev
Copy link
Copy Markdown
Member

linev commented Jun 29, 2022

@bellenot @guitargeek

Seems to be now it can be compiled on Windows. I just enable new feature only when OpenSSL 3.0 is available.
Same kind of PR I submit to civetweb: civetweb/civetweb#1080

@linev linev merged commit 08c41c6 into root-project:master Jun 29, 2022
@guitargeek guitargeek deleted the civetweb_1 branch June 30, 2022 11:28
@guitargeek guitargeek linked an issue Jun 30, 2022 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update civetweb to 1.16 once it's released

5 participants