Skip to content
This repository was archived by the owner on Jan 26, 2026. It is now read-only.

Commit 9c0eb11

Browse files
committed
Merge commit '389efc234b2dc65246b695188881e6056e369588'
2 parents ca9cea8 + 389efc2 commit 9c0eb11

31 files changed

Lines changed: 577 additions & 396 deletions

.gitlab-ci.yml

Lines changed: 6 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ variables:
44
CENTOS7_BUILD: buildenv-centos7
55
TUMBLEWEED_BUILD: buildenv-tumbleweed
66
MINGW_BUILD: buildenv-mingw
7-
DEBIAN_CROSS_BUILD: buildenv-debian-cross
87

98
# pkd tests fail on CentOS7 docker images, so we don't use -DSERVER_TESTING=ON
109
centos7/openssl_1.0.x/x86_64:
@@ -295,33 +294,6 @@ fedora/mingw32:
295294
paths:
296295
- obj/
297296

298-
.Debian.cross.template: &Debian_cross_template
299-
stage: test
300-
image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$DEBIAN_CROSS_BUILD
301-
script:
302-
- build=$(dpkg-architecture -qDEB_HOST_GNU_TYPE)
303-
- host="${CI_JOB_NAME#*.cross.}"
304-
- mkdir -p obj && cd obj && cmake
305-
-DCMAKE_C_COMPILER="$(which $host-gcc)"
306-
-DCMAKE_CXX_COMPILER="$(which $host-g++)"
307-
-DCMAKE_BUILD_TYPE=RelWithDebInfo
308-
-DUNIT_TESTING=ON -DWITH_SFTP=ON -DWITH_SERVER=ON -DWITH_ZLIB=ON
309-
-DWITH_PCAP=ON .. &&
310-
make -j$(nproc) &&
311-
ctest --output-on-failure
312-
tags:
313-
- shared
314-
except:
315-
- tags
316-
artifacts:
317-
expire_in: 1 week
318-
when: on_failure
319-
paths:
320-
- obj/
321-
322-
.Debian.cross.mips-linux-gnu:
323-
<<: *Debian_cross_template
324-
325297
tumbleweed/openssl_1.1.x/x86_64/gcc:
326298
image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$TUMBLEWEED_BUILD
327299
script:
@@ -330,7 +302,7 @@ tumbleweed/openssl_1.1.x/x86_64/gcc:
330302
-DPICKY_DEVELOPER=ON
331303
-DWITH_SFTP=ON -DWITH_SERVER=ON -DWITH_ZLIB=ON -DWITH_PCAP=ON
332304
-DKRB5_CONFIG=/usr/lib/mit/bin/krb5-config
333-
-DUNIT_TESTING=ON -DCLIENT_TESTING=ON -DSERVER_TESTING=ON .. &&
305+
-DUNIT_TESTING=ON -DSERVER_TESTING=ON .. &&
334306
make -j$(nproc) && ctest --output-on-failure
335307
tags:
336308
- shared
@@ -371,7 +343,7 @@ tumbleweed/openssl_1.1.x/x86_64/gcc7:
371343
-DPICKY_DEVELOPER=ON
372344
-DWITH_SFTP=ON -DWITH_SERVER=ON -DWITH_ZLIB=ON -DWITH_PCAP=ON
373345
-DKRB5_CONFIG=/usr/lib/mit/bin/krb5-config
374-
-DUNIT_TESTING=ON -DCLIENT_TESTING=ON -DSERVER_TESTING=ON .. &&
346+
-DUNIT_TESTING=ON -DSERVER_TESTING=ON .. &&
375347
make -j$(nproc) && ctest --output-on-failure
376348
tags:
377349
- shared
@@ -413,7 +385,8 @@ tumbleweed/openssl_1.1.x/x86_64/clang:
413385
-DPICKY_DEVELOPER=ON
414386
-DWITH_SFTP=ON -DWITH_SERVER=ON -DWITH_ZLIB=ON -DWITH_PCAP=ON
415387
-DKRB5_CONFIG=/usr/lib/mit/bin/krb5-config
416-
-DUNIT_TESTING=ON -DCLIENT_TESTING=ON -DSERVER_TESTING=ON .. &&
388+
-DUNIT_TESTING=ON
389+
-DSERVER_TESTING=ON .. &&
417390
make -j$(nproc) && ctest --output-on-failure
418391
tags:
419392
- shared
@@ -446,7 +419,7 @@ tumbleweed/undefined-sanitizer:
446419
-DCMAKE_BUILD_TYPE=UndefinedSanitizer
447420
-DPICKY_DEVELOPER=ON
448421
-DWITH_SFTP=ON -DWITH_SERVER=ON -DWITH_ZLIB=ON -DWITH_PCAP=ON
449-
-DUNIT_TESTING=ON -DCLIENT_TESTING=ON -DSERVER_TESTING=ON .. &&
422+
-DUNIT_TESTING=ON -DSERVER_TESTING=ON .. &&
450423
make -j$(nproc) && ctest --output-on-failure
451424
tags:
452425
- shared
@@ -468,7 +441,7 @@ tumbleweed/static-analysis:
468441
-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
469442
-DPICKY_DEVELOPER=ON
470443
-DWITH_SFTP=ON -DWITH_SERVER=ON -DWITH_ZLIB=ON -DWITH_PCAP=ON
471-
-DUNIT_TESTING=ON -DCLIENT_TESTING=ON -DSERVER_TESTING=ON .. &&
444+
-DUNIT_TESTING=ON -DSERVER_TESTING=ON .. &&
472445
scan-build --status-bugs -o scan make -j$(nproc)
473446
tags:
474447
- shared

CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules")
1010
include(DefineCMakeDefaults)
1111
include(DefineCompilerFlags)
1212

13-
project(libssh VERSION 0.9.1 LANGUAGES C)
13+
project(libssh VERSION 0.9.2 LANGUAGES C)
1414

1515
# global needed variable
1616
set(APPLICATION_NAME ${PROJECT_NAME})
@@ -22,7 +22,7 @@ set(APPLICATION_NAME ${PROJECT_NAME})
2222
# Increment AGE. Set REVISION to 0
2323
# If the source code was changed, but there were no interface changes:
2424
# Increment REVISION.
25-
set(LIBRARY_VERSION "4.8.2")
25+
set(LIBRARY_VERSION "4.8.3")
2626
set(LIBRARY_SOVERSION "4")
2727

2828
# where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked
@@ -222,7 +222,7 @@ message(STATUS "Server support : ${WITH_SERVER}")
222222
message(STATUS "GSSAPI support : ${WITH_GSSAPI}")
223223
message(STATUS "GEX support : ${WITH_GEX}")
224224
message(STATUS "Pcap debugging support : ${WITH_PCAP}")
225-
message(STATUS "With static library: ${WITH_STATIC_LIB}")
225+
message(STATUS "Build shared library: ${BUILD_SHARED_LIBS}")
226226
message(STATUS "Unit testing: ${UNIT_TESTING}")
227227
message(STATUS "Client code testing: ${CLIENT_TESTING}")
228228
message(STATUS "Blowfish cipher support: ${WITH_BLOWFISH_CIPHER}")

CPackConfig.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
1010

1111
# SOURCE GENERATOR
1212
set(CPACK_SOURCE_GENERATOR "TXZ")
13-
set(CPACK_SOURCE_IGNORE_FILES "~$;[.]swp$;/[.]git/;.gitignore;/build*;/obj*;tags;cscope.*")
13+
set(CPACK_SOURCE_IGNORE_FILES "~$;[.]swp$;/[.]git/;/[.]clangd/;.gitignore;/build*;/obj*;tags;cscope.*;compile_commands.json")
1414
set(CPACK_SOURCE_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}")
1515

1616
### NSIS INSTALLER

ChangeLog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
ChangeLog
22
==========
33

4+
version 0.9.2 (released 2019-11-07)
5+
* Fixed libssh-config.cmake
6+
* Fixed issues with rsa algorithm negotiation (T191)
7+
* Fixed detection of OpenSSL ed25519 support (T197)
8+
49
version 0.9.1 (released 2019-10-25)
510
* Added support for Ed25519 via OpenSSL
611
* Added support for X25519 via OpenSSL

ConfigureChecks.cmake

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,12 @@ if (OPENSSL_FOUND)
148148

149149
set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR})
150150
set(CMAKE_REQUIRED_LIBRARIES ${OPENSSL_CRYPTO_LIBRARY})
151-
check_symbol_exists(EVP_PKEY_ED25519 "openssl/evp.h" HAVE_OPENSSL_ED25519)
151+
check_symbol_exists(EVP_PKEY_ED25519 "openssl/evp.h" FOUND_OPENSSL_ED25519)
152+
153+
if (HAVE_OPENSSL_EVP_DIGESTSIGN AND HAVE_OPENSSL_EVP_DIGESTVERIFY AND
154+
FOUND_OPENSSL_ED25519)
155+
set(HAVE_OPENSSL_ED25519 1)
156+
endif()
152157

153158
set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR})
154159
set(CMAKE_REQUIRED_LIBRARIES ${OPENSSL_CRYPTO_LIBRARY})

DefineOptions.cmake

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ option(WITH_GSSAPI "Build with GSSAPI support" ON)
22
option(WITH_ZLIB "Build with ZLIB support" ON)
33
option(WITH_SFTP "Build with SFTP support" ON)
44
option(WITH_SERVER "Build with SSH server support" ON)
5-
option(WITH_STATIC_LIB "Build with a static library" OFF)
65
option(WITH_DEBUG_CRYPTO "Build with cryto debug output" OFF)
76
option(WITH_DEBUG_PACKET "Build with packet debug output" OFF)
87
option(WITH_DEBUG_CALLTRACE "Build with calltrace debug output" ON)
@@ -11,6 +10,7 @@ option(WITH_MBEDTLS "Compile against libmbedtls" OFF)
1110
option(WITH_BLOWFISH_CIPHER "Compile with blowfish support" OFF)
1211
option(WITH_PCAP "Compile with Pcap generation support" ON)
1312
option(WITH_INTERNAL_DOC "Compile doxygen internal documentation" OFF)
13+
option(BUILD_SHARED_LIBS "Build shared libraries" ON)
1414
option(UNIT_TESTING "Build with unit tests" OFF)
1515
option(CLIENT_TESTING "Build with client tests; requires openssh" OFF)
1616
option(SERVER_TESTING "Build with server tests; requires openssh and dropbear" OFF)
@@ -34,13 +34,9 @@ if (WITH_BENCHMARKS)
3434
set(CLIENT_TESTING ON)
3535
endif()
3636

37-
if (WITH_STATIC_LIB)
38-
set(BUILD_STATIC_LIB ON)
39-
endif (WITH_STATIC_LIB)
40-
41-
if (UNIT_TESTING)
37+
if (UNIT_TESTING OR CLIENT_TESTING OR SERVER_TESTING)
4238
set(BUILD_STATIC_LIB ON)
43-
endif (UNIT_TESTING)
39+
endif()
4440

4541
if (WITH_NACL)
4642
set(WITH_NACL ON)

examples/CMakeLists.txt

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,7 @@ set(examples_SRCS
66
connect_ssh.c
77
)
88

9-
include_directories(
10-
${LIBSSH_PUBLIC_INCLUDE_DIRS}
11-
${CMAKE_BINARY_DIR}
12-
)
9+
include_directories(${libssh_BINARY_DIR})
1310

1411
if (ARGP_INCLUDE_DIR)
1512
include_directories(${ARGP_INCLUDE_DIR})
@@ -18,68 +15,68 @@ endif()
1815
if (UNIX AND NOT WIN32)
1916
add_executable(libssh_scp libssh_scp.c ${examples_SRCS})
2017
target_compile_options(libssh_scp PRIVATE ${DEFAULT_C_COMPILE_FLAGS})
21-
target_link_libraries(libssh_scp ${LIBSSH_SHARED_LIBRARY})
18+
target_link_libraries(libssh_scp ssh::ssh)
2219

2320
add_executable(scp_download scp_download.c ${examples_SRCS})
2421
target_compile_options(scp_download PRIVATE ${DEFAULT_C_COMPILE_FLAGS})
25-
target_link_libraries(scp_download ${LIBSSH_SHARED_LIBRARY})
22+
target_link_libraries(scp_download ssh::ssh)
2623

2724
add_executable(sshnetcat sshnetcat.c ${examples_SRCS})
2825
target_compile_options(sshnetcat PRIVATE ${DEFAULT_C_COMPILE_FLAGS})
29-
target_link_libraries(sshnetcat ${LIBSSH_SHARED_LIBRARY})
26+
target_link_libraries(sshnetcat ssh::ssh)
3027

3128
if (WITH_SFTP)
3229
add_executable(samplesftp samplesftp.c ${examples_SRCS})
3330
target_compile_options(samplesftp PRIVATE ${DEFAULT_C_COMPILE_FLAGS})
34-
target_link_libraries(samplesftp ${LIBSSH_SHARED_LIBRARY})
31+
target_link_libraries(samplesftp ssh::ssh)
3532
endif (WITH_SFTP)
3633

3734
add_executable(ssh-client ssh_client.c ${examples_SRCS})
3835
target_compile_options(ssh-client PRIVATE ${DEFAULT_C_COMPILE_FLAGS})
39-
target_link_libraries(ssh-client ${LIBSSH_SHARED_LIBRARY})
36+
target_link_libraries(ssh-client ssh::ssh)
4037

4138
if (WITH_SERVER AND (ARGP_LIBRARY OR HAVE_ARGP_H))
4239
if (HAVE_LIBUTIL)
4340
add_executable(ssh_server_fork ssh_server_fork.c)
4441
target_compile_options(ssh_server_fork PRIVATE ${DEFAULT_C_COMPILE_FLAGS})
45-
target_link_libraries(ssh_server_fork ${LIBSSH_SHARED_LIBRARY} ${ARGP_LIBRARY} util)
42+
target_link_libraries(ssh_server_fork ssh::ssh ${ARGP_LIBRARY} util)
4643
endif (HAVE_LIBUTIL)
4744

4845
if (WITH_GSSAPI AND GSSAPI_FOUND)
4946
add_executable(samplesshd-cb samplesshd-cb.c)
5047
target_compile_options(samplesshd-cb PRIVATE ${DEFAULT_C_COMPILE_FLAGS})
51-
target_link_libraries(samplesshd-cb ${LIBSSH_SHARED_LIBRARY} ${ARGP_LIBRARY})
48+
target_link_libraries(samplesshd-cb ssh::ssh ${ARGP_LIBRARY})
5249

5350
add_executable(proxy proxy.c)
5451
target_compile_options(proxy PRIVATE ${DEFAULT_C_COMPILE_FLAGS})
55-
target_link_libraries(proxy ${LIBSSH_SHARED_LIBRARY} ${ARGP_LIBRARY})
52+
target_link_libraries(proxy ssh::ssh ${ARGP_LIBRARY})
5653

5754
add_executable(sshd_direct-tcpip sshd_direct-tcpip.c)
5855
target_compile_options(sshd_direct-tcpip PRIVATE ${DEFAULT_C_COMPILE_FLAGS})
59-
target_link_libraries(sshd_direct-tcpip ${LIBSSH_SHARED_LIBRARY} ${ARGP_LIBRARY})
56+
target_link_libraries(sshd_direct-tcpip ssh::ssh ${ARGP_LIBRARY})
6057
endif (WITH_GSSAPI AND GSSAPI_FOUND)
6158

6259
add_executable(samplesshd-kbdint samplesshd-kbdint.c)
6360
target_compile_options(samplesshd-kbdint PRIVATE ${DEFAULT_C_COMPILE_FLAGS})
64-
target_link_libraries(samplesshd-kbdint ${LIBSSH_SHARED_LIBRARY} ${ARGP_LIBRARY})
61+
target_link_libraries(samplesshd-kbdint ssh::ssh ${ARGP_LIBRARY})
6562

6663
endif()
6764
endif (UNIX AND NOT WIN32)
6865

6966
add_executable(exec exec.c ${examples_SRCS})
7067
target_compile_options(exec PRIVATE ${DEFAULT_C_COMPILE_FLAGS})
71-
target_link_libraries(exec ${LIBSSH_SHARED_LIBRARY})
68+
target_link_libraries(exec ssh::ssh)
7269

7370
add_executable(senddata senddata.c ${examples_SRCS})
7471
target_compile_options(senddata PRIVATE ${DEFAULT_C_COMPILE_FLAGS})
75-
target_link_libraries(senddata ${LIBSSH_SHARED_LIBRARY})
72+
target_link_libraries(senddata ssh::ssh)
7673

7774
add_executable(keygen keygen.c)
7875
target_compile_options(keygen PRIVATE ${DEFAULT_C_COMPILE_FLAGS})
79-
target_link_libraries(keygen ${LIBSSH_SHARED_LIBRARY})
76+
target_link_libraries(keygen ssh::ssh)
8077

8178
add_executable(libsshpp libsshpp.cpp)
82-
target_link_libraries(libsshpp ${LIBSSH_SHARED_LIBRARY})
79+
target_link_libraries(libsshpp ssh::ssh)
8380

8481
add_executable(libsshpp_noexcept libsshpp_noexcept.cpp)
85-
target_link_libraries(libsshpp_noexcept ${LIBSSH_SHARED_LIBRARY})
82+
target_link_libraries(libsshpp_noexcept ssh::ssh)

include/libssh/libssh.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
/* libssh version */
8080
#define LIBSSH_VERSION_MAJOR 0
8181
#define LIBSSH_VERSION_MINOR 9
82-
#define LIBSSH_VERSION_MICRO 1
82+
#define LIBSSH_VERSION_MICRO 2
8383

8484
#define LIBSSH_VERSION_INT SSH_VERSION_INT(LIBSSH_VERSION_MAJOR, \
8585
LIBSSH_VERSION_MINOR, \

include/libssh/pki.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ enum ssh_keytypes_e ssh_key_type_from_signature_name(const char *name);
111111
enum ssh_keytypes_e ssh_key_type_plain(enum ssh_keytypes_e type);
112112
enum ssh_digest_e ssh_key_type_to_hash(ssh_session session,
113113
enum ssh_keytypes_e type);
114+
enum ssh_digest_e ssh_key_hash_from_name(const char *name);
114115

115116
#define is_ecdsa_key_type(t) \
116117
((t) >= SSH_KEYTYPE_ECDSA_P256 && (t) <= SSH_KEYTYPE_ECDSA_P521)
@@ -153,7 +154,8 @@ ssh_string ssh_pki_do_sign_agent(ssh_session session,
153154
struct ssh_buffer_struct *buf,
154155
const ssh_key pubkey);
155156
ssh_string ssh_srv_pki_do_sign_sessionid(ssh_session session,
156-
const ssh_key privkey);
157+
const ssh_key privkey,
158+
const enum ssh_digest_e digest);
157159

158160
/* Temporary functions, to be removed after migration to ssh_key */
159161
ssh_public_key ssh_pki_convert_key_to_publickey(const ssh_key key);

include/libssh/priv.h

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,17 @@ int gettimeofday(struct timeval *__p, void *__t);
221221
struct ssh_common_struct;
222222
struct ssh_kex_struct;
223223

224-
int ssh_get_key_params(ssh_session session, ssh_key *privkey);
224+
enum ssh_digest_e {
225+
SSH_DIGEST_AUTO=0,
226+
SSH_DIGEST_SHA1=1,
227+
SSH_DIGEST_SHA256,
228+
SSH_DIGEST_SHA384,
229+
SSH_DIGEST_SHA512,
230+
};
231+
232+
int ssh_get_key_params(ssh_session session,
233+
ssh_key *privkey,
234+
enum ssh_digest_e *digest);
225235

226236
/* LOGGING */
227237
void ssh_log_function(int verbosity,

0 commit comments

Comments
 (0)