From 1bf25bf4d1db2f226be311391d616dc9b120b79a Mon Sep 17 00:00:00 2001
From: Guilherme Amadio <amadio@cern.ch>
Date: Fri, 8 Feb 2019 11:39:06 +0100
Subject: [PATCH] net: link to crypt, not OpenSSL's crypto

There seems to be a confusion between crypt(3) and crypto(7) here.
The crypt function is defined in unistd.h and is used for password
and data encryption, while crypto is OpenSSL's library implementing
cryptographic algorithms used in Internet standards.

crypt  - https://www.unix.com/man-page/all/3C/crypt
crypto - https://www.openssl.org/docs/man1.1.1/man7/crypto.html
---
 net/auth/CMakeLists.txt | 6 +-----
 net/net/CMakeLists.txt  | 2 +-
 2 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/net/auth/CMakeLists.txt b/net/auth/CMakeLists.txt
index 5654249760d..8c24ce647fd 100644
--- a/net/auth/CMakeLists.txt
+++ b/net/auth/CMakeLists.txt
@@ -21,13 +21,9 @@ ROOT_STANDARD_LIBRARY_PACKAGE(RootAuth
     src/TRootSecContext.cxx
   LINKDEF
     LinkDefRoot.h
-  LIBRARIES
-    ${CRYPTLIBS} rsa
   DEPENDENCIES
     Net
     RIO
 )
 
-if(ssl)
-  target_link_libraries(RootAuth PUBLIC ${OPENSSL_LIBRARIES})
-endif()
+target_link_libraries(RootAuth PRIVATE rsa $<$<PLATFORM_ID:Linux>:crypt>)
diff --git a/net/net/CMakeLists.txt b/net/net/CMakeLists.txt
index 2febd523e74..cb8768fa530 100644
--- a/net/net/CMakeLists.txt
+++ b/net/net/CMakeLists.txt
@@ -102,5 +102,5 @@ ROOT_STANDARD_LIBRARY_PACKAGE(Net
                               DEPENDENCIES RIO)
 
 if(ssl)
-  target_link_libraries(Net PRIVATE ${OPENSSL_LIBRARIES} ${CRYPTLIBS})
+  target_link_libraries(Net PRIVATE ${OPENSSL_LIBRARIES})
 endif()
-- 
GitLab