Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
LOFAR
Manage
Activity
Members
Labels
Plan
Issues
Wiki
Jira issues
Open Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RadioObservatory
LOFAR
Commits
ae155930
Commit
ae155930
authored
11 years ago
by
Jan David Mol
Browse files
Options
Downloads
Patches
Plain Diff
Task #3696: Detect and initialise libgcrypt, because libssh2 can be linked against it
parent
6507e0de
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CMake/FindGCrypt.cmake
+46
-0
46 additions, 0 deletions
CMake/FindGCrypt.cmake
RTCP/Cobalt/GPUProc/CMakeLists.txt
+2
-1
2 additions, 1 deletion
RTCP/Cobalt/GPUProc/CMakeLists.txt
RTCP/Cobalt/GPUProc/src/Storage/SSH.cc
+20
-1
20 additions, 1 deletion
RTCP/Cobalt/GPUProc/src/Storage/SSH.cc
with
68 additions
and
2 deletions
CMake/FindGCrypt.cmake
0 → 100644
+
46
−
0
View file @
ae155930
# - Try to find GCrypt: a crypto library
# This will define:
# GCRYPT_FOUND - system has GCrypt
# GCRYPT_INCLUDE_DIR - the GCrypt include directory (cached)
# GCRYPT_INCLUDE_DIRS - the GCrypt include directories
# (identical to GCRYPT_INCLUDE_DIR)
# GCRYPT_LIBRARY - the GCrypt library (cached)
# GCRYPT_LIBRARIES - the GCrypt libraries
# (identical to GCRYPT_LIBRARY)
# Copyright (C) 2009
# ASTRON (Netherlands Institute for Radio Astronomy)
# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
#
# This file is part of the LOFAR software suite.
# The LOFAR software suite is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# The LOFAR software suite is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with the LOFAR software suite. If not, see <http://www.gnu.org/licenses/>.
#
# $Id$
if
(
NOT GCRYPT_FOUND
)
find_path
(
GCRYPT_INCLUDE_DIR gcrypt.h
HINTS
${
GCRYPT_ROOT_DIR
}
PATH_SUFFIXES include
)
find_library
(
GCRYPT_LIBRARY gcrypt
HINTS
${
GCRYPT_ROOT_DIR
}
PATH_SUFFIXES lib
)
mark_as_advanced
(
GCRYPT_INCLUDE_DIR GCRYPT_LIBRARY
)
include
(
FindPackageHandleStandardArgs
)
find_package_handle_standard_args
(
GCrypt DEFAULT_MSG
GCRYPT_LIBRARY GCRYPT_INCLUDE_DIR
)
set
(
GCRYPT_INCLUDE_DIRS
${
GCRYPT_INCLUDE_DIR
}
)
set
(
GCRYPT_LIBRARIES
${
GCRYPT_LIBRARY
}
)
endif
(
NOT GCRYPT_FOUND
)
This diff is collapsed.
Click to expand it.
RTCP/Cobalt/GPUProc/CMakeLists.txt
+
2
−
1
View file @
ae155930
...
...
@@ -49,7 +49,8 @@ lofar_package(GPUProc 1.0 DEPENDS ${_gpuproc_deps})
lofar_find_package
(
OpenMP REQUIRED
)
lofar_find_package
(
LibSSH2 REQUIRED
)
lofar_find_package
(
OpenSSL REQUIRED
)
lofar_find_package
(
OpenSSL
)
lofar_find_package
(
GCrypt
)
lofar_find_package
(
Boost REQUIRED
)
lofar_find_package
(
MPI
)
lofar_find_package
(
FFTW3 COMPONENTS single double threads REQUIRED
)
# 'double threads' for FFT unit test refs
...
...
This diff is collapsed.
Click to expand it.
RTCP/Cobalt/GPUProc/src/Storage/SSH.cc
+
20
−
1
View file @
ae155930
...
...
@@ -29,7 +29,16 @@
#include
<unistd.h>
#include
<vector>
#include
<sys/select.h>
#ifdef HAVE_OPENSSL
#include
<openssl/crypto.h>
#endif
#ifdef HAVE_GCRYPT
#include
<pthread.h>
#include
<gcrypt.h>
GCRY_THREAD_OPTION_PTHREAD_IMPL
;
#endif
#include
<Common/LofarLogger.h>
#include
<Common/SystemCallException.h>
...
...
@@ -701,6 +710,7 @@ namespace LOFAR
#ifdef HAVE_OPENSSL
std
::
vector
<
SmartPtr
<
Mutex
>
>
openssl_mutexes
;
static
void
lock_callback
(
int
mode
,
int
type
,
const
char
*
file
,
int
line
)
...
...
@@ -718,10 +728,11 @@ namespace LOFAR
{
return
static_cast
<
unsigned
long
>
(
pthread_self
());
}
#endif
bool
SSH_Init
()
{
#ifdef HAVE_OPENSSL
// initialise openssl
openssl_mutexes
.
resize
(
CRYPTO_num_locks
());
for
(
size_t
i
=
0
;
i
<
openssl_mutexes
.
size
();
++
i
)
...
...
@@ -729,6 +740,12 @@ namespace LOFAR
CRYPTO_set_id_callback
(
&
thread_id_callback
);
CRYPTO_set_locking_callback
(
&
lock_callback
);
#endif
#ifdef HAVE_GCRYPT
// initialise gcrypt
gcry_control
(
GCRYCTL_SET_THREAD_CBS
,
&
gcry_threads_pthread
);
#endif
#if LIBSSH2_VERSION_NUM >= 0x010205
// initialise libssh2
...
...
@@ -748,11 +765,13 @@ namespace LOFAR
libssh2_exit
();
#endif
#ifdef HAVE_OPENSSL
// exit openssl
CRYPTO_set_locking_callback
(
NULL
);
CRYPTO_set_id_callback
(
NULL
);
openssl_mutexes
.
clear
();
#endif
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment