Jakub Jelen
f2b64abcbd
buffer: Use sizeof instead of magic number
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Norbert Pocs <norbertpocs0@gmail.com >
2025-06-03 10:23:17 +02:00
Nicolas Graves
4135154b6d
cmocka_unit_test_setup_teardown: Comply with codespell style.
...
Signed-off-by: Nicolas Graves <ngraves@ngraves.fr >
Reviewed-by: Jakub Jelen <jjelen@redhat.com >
2025-05-30 20:11:51 +02:00
Praneeth Sarode
ca4c874a9e
tests: remove unsupported SHA1 HMAC tests for compatibility with latest dropbear version
...
Signed-off-by: Praneeth Sarode <praneethsarode@gmail.com >
Reviewed-by: Jakub Jelen <jjelen@redhat.com >
2025-05-27 13:50:03 +02:00
Rohan Eden
c7b6ffad0e
Remove height due to inconsistent display in browser
...
Signed-off-by: Rohan Eden <rohan.eden@citypaine.com >
Reviewed-by: Jakub Jelen <jjelen@redhat.com >
2025-05-20 18:27:46 +02:00
salonidabgar
c1fb0d872d
Reformatted torture_auth_cert.c
...
Signed-off-by: salonidabgar <salonidabgar@gmail.com >
Reviewed-by: Jakub Jelen <jjelen@redhat.com >
2025-05-14 13:45:23 +02:00
salonidabgar
3a167a89b5
Added tests for auth agent forwarding
...
Signed-off-by: salonidabgar <salonidabgar@gmail.com >
Reviewed-by: Jakub Jelen <jjelen@redhat.com >
2025-05-14 13:45:23 +02:00
salonidabgar
dfa9421e01
Added preprocessor directives for Windows
...
Signed-off-by: salonidabgar <salonidabgar@gmail.com >
Reviewed-by: Jakub Jelen <jjelen@redhat.com >
2025-05-14 13:45:23 +02:00
salonidabgar
efc5bc633f
Reformatted torture.c and torture.h
...
Signed-off-by: salonidabgar <salonidabgar@gmail.com >
Reviewed-by: Jakub Jelen <jjelen@redhat.com >
2025-05-14 13:45:23 +02:00
salonidabgar
3a4ba8b763
Fix file permissions: remove executable bit from CMakeLists.txt as it's a configuration file
...
Signed-off-by: salonidabgar <salonidabgar@gmail.com >
Reviewed-by: Jakub Jelen <jjelen@redhat.com >
2025-05-14 13:45:23 +02:00
salonidabgar
47db54b7c1
Move torture_setup_ssh_agent() and torture_cleanup_ssh_agent() to torture.c
...
Signed-off-by: salonidabgar <salonidabgar@gmail.com >
Reviewed-by: Jakub Jelen <jjelen@redhat.com >
2025-05-14 13:45:23 +02:00
salonidabgar
d1c2d3db9d
Added .DS_Store to .gitignore
...
Signed-off-by: salonidabgar <salonidabgar@gmail.com >
Reviewed-by: Jakub Jelen <jjelen@redhat.com >
2025-05-14 13:45:23 +02:00
Praneeth Sarode
dcb65fe584
refactor(curve25519): split the single file curve25519.c into multiple files for better readability
...
Signed-off-by: Praneeth Sarode <praneethsarode@gmail.com >
Reviewed-by: Jakub Jelen <jjelen@redhat.com >
2025-05-06 22:03:18 +02:00
Lucas Mulling
d758990d39
misc: Fix OpenSSH banner parsing
...
Signed-off-by: Lucas Mulling <lucas.mulling@suse.com >
Reviewed-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Norbert Pocs <norbertpocs0@gmail.com >
2025-04-28 14:56:27 -03:00
Andreas Schneider
bfae56634c
tests:unittests: Fix tests on FreeBSD
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
Reviewed-by: Jakub Jelen <jjelen@redhat.com >
2025-04-24 10:47:26 +02:00
Jakub Jelen
3d0226cadc
examples: Avoid using uninitialized memory
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Norbert Pocs <norbertpocs0@gmail.com >
2025-04-16 17:41:22 +02:00
Jakub Jelen
0bcd7d12d8
dh-gex: Avoid reading the EOF stream
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Norbert Pocs <norbertpocs0@gmail.com >
2025-04-16 17:41:22 +02:00
Jakub Jelen
bd10ec1162
tests: Use fseek instead of rewind to simplify error checking
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Norbert Pocs <norbertpocs0@gmail.com >
2025-04-16 17:41:22 +02:00
Jakub Jelen
69c169e4cb
sftpserver: Free memory on error condition
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Norbert Pocs <norbertpocs0@gmail.com >
2025-04-16 17:41:22 +02:00
Jakub Jelen
f0b9db586b
test: Fix potential leak of fds on error
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Norbert Pocs <norbertpocs0@gmail.com >
2025-04-16 17:41:22 +02:00
Jakub Jelen
c735b44f83
test: Fix unused variables and potential memory leaks
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Norbert Pocs <norbertpocs0@gmail.com >
2025-04-16 17:41:22 +02:00
Jakub Jelen
3b4b8033de
tests: Make the static ananlyzers happy with the threads
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Norbert Pocs <norbertpocs0@gmail.com >
2025-04-16 17:41:22 +02:00
Jakub Jelen
0068fdd594
examples: Fix possible null pointer passed to open()
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Norbert Pocs <norbertpocs0@gmail.com >
2025-04-16 16:19:42 +02:00
Praneeth Sarode
344235c954
fix(tests): improve synchronization in torture_forwarded_tcpip_callback tests
...
Signed-off-by: Praneeth Sarode <praneethsarode@gmail.com >
Reviewed-by: Jakub Jelen <jjelen@redhat.com >
2025-04-16 14:49:40 +02:00
Jakub Jelen
d00f7b1bf9
Make sure we pass right parameters to buffer_pack
...
Fixes : #299
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Sahana Prasad <sahana@redhat.com >
Reviewed-by: Norbert Pocs <norbertpocs0@gmail.com >
2025-04-15 16:15:52 +02:00
Jakub Jelen
b14018ecab
tests: Do not build zlib test when built without
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Sahana Prasad <sahana@redhat.com >
Reviewed-by: Norbert Pocs <norbertpocs0@gmail.com >
2025-04-15 16:15:52 +02:00
Jakub Jelen
5e47b1c1c2
kex: Add more noisy errors to simplify debugging ssh_make_sessionid
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Sahana Prasad <sahana@redhat.com >
Reviewed-by: Norbert Pocs <norbertpocs0@gmail.com >
2025-04-15 16:15:52 +02:00
Jakub Jelen
9ce885b168
ci: Add mbedTLS + clang build combination
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Sahana Prasad <sahana@redhat.com >
Reviewed-by: Norbert Pocs <norbertpocs0@gmail.com >
2025-04-15 16:15:52 +02:00
Jakub Jelen
184dad101d
Move the PKCS#11 provider environment variable where it needs to be
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Sahana Prasad <sahana@redhat.com >
Reviewed-by: Norbert Pocs <norbertpocs0@gmail.com >
2025-04-15 16:15:52 +02:00
RaviRaaja
04a58919f8
Fix: NULL pointer check in ssh_channel_is_closed
...
The ssh_channel_is_closed function would crash when
accessing channel->session->alive if session is NULL.
This patch adds a null check before accessing the session
pointer.
- build succeeded
- unit test passed
- no new unit test added
https://gitlab.com/libssh/libssh-mirror/-/issues/239
Signed-off-by: Raviraaja Lakshmanan <mailstoraviraaja@gmail.com >
Reviewed-by: Jakub Jelen <jjelen@redhat.com >
2025-04-14 22:20:35 +02:00
Norbert Pocs
b106211d92
clang-format: Align consecutive macros
...
This option makes padding between macro names and the values based on
the longest macro name in a consecutive list of macro lines.
Signed-off-by: Norbert Pocs <norbertpocs0@gmail.com >
Reviewed-by: Jakub Jelen <jjelen@redhat.com >
2025-04-14 22:20:08 +02:00
Norbert Pocs
af10857aa3
CmakeLists: Fix multiple digit major version for OpenSSH
...
Signed-off-by: Norbert Pocs <norbertpocs0@gmail.com >
Reviewed-by: Jakub Jelen <jjelen@redhat.com >
2025-04-14 22:19:18 +02:00
Praneeth Sarode
f3b389d112
tests: add unit test for direct-tcpip channel open request
...
Signed-off-by: Praneeth Sarode <praneethsarode@gmail.com >
Reviewed-by: Jakub Jelen <jjelen@redhat.com >
2025-04-07 14:02:41 +02:00
Praneeth Sarode
18e7423e70
Add direct-tcpip channel open request callback support
...
Signed-off-by: Praneeth Sarode <praneethsarode@gmail.com >
Reviewed-by: Jakub Jelen <jjelen@redhat.com >
2025-04-07 14:02:21 +02:00
Praneeth Sarode
8c8d3ceef7
tests: add unit test for forwarded-tcpip callback
...
Signed-off-by: Praneeth Sarode <praneethsarode@gmail.com >
Reviewed-by: Jakub Jelen <jjelen@redhat.com >
2025-04-07 10:57:21 +02:00
Praneeth Sarode
0d0ed4b1f8
curve25519: add support for gcrypt's Curve25519 implementation
...
Signed-off-by: Praneeth Sarode <praneethsarode@gmail.com >
Reviewed-by: Jakub Jelen <jjelen@redhat.com >
2025-04-03 11:28:44 +02:00
Arek Ouzounian
8dc234c909
Add clarification to INSTALL for unit testing on Windows via the cmocka dependency
...
Signed-off-by: Arek Ouzounian <agouzo777@gmail.com >
Reviewed-by: Jakub Jelen <jjelen@redhat.com >
2025-04-03 11:27:45 +02:00
Praneeth Sarode
2e686c5cea
cmake: fix MbedTLS version detection
...
Signed-off-by: Praneeth Sarode <praneethsarode@gmail.com >
Reviewed-by: Jakub Jelen <jjelen@redhat.com >
2025-04-03 11:27:08 +02:00
Jakub Jelen
d3706d5940
Add missing symbol to the map
...
This was omitted from the 84d02e74 and caused issues to build when abimap is
not present.
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2025-04-02 10:59:53 +02:00
Praneeth Sarode
d92a057090
tests: fix torture_server_x11 and add it to tests
...
Signed-off-by: Praneeth Sarode <praneethsarode@gmail.com >
Reviewed-by: Jakub Jelen <jjelen@redhat.com >
2025-04-01 10:19:14 +02:00
Jakub Jelen
1434f24911
auth: Avoid forward-null pointer dereference
...
This could happen only if the function would really be called with the NULL
session, but this was never the case as the session is dereferenced already on
all code paths toward this place.
This is just to make the scanner happy that the session can not really be NULL
here.
Thanks coverity!
CID 1593926
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Norbert Pocs <norbertpocs0@gmail.com >
2025-03-31 11:05:37 +02:00
Aditya Sinha
cce600f980
test for ssh_get_kex_algo()
...
Signed-off-by: Aditya Sinha <aditya072006@gmail.com >
Reviewed-by: Jakub Jelen <jjelen@redhat.com >
2025-03-30 13:10:53 +02:00
Aditya Sinha
95150b1137
Adding the missing Algorithms to ssh_get_kex_algo() function
...
Signed-off-by: Aditya Sinha <aditya072006@gmail.com >
Reviewed-by: Jakub Jelen <jjelen@redhat.com >
2025-03-30 13:10:52 +02:00
Aditya Sinha
65b2591b91
Reformatting the ssh_get_kex_aglo() function
...
Signed-off-by: Aditya Sinha <aditya072006@gmail.com >
Reviewed-by: Jakub Jelen <jjelen@redhat.com >
2025-03-30 13:10:51 +02:00
Praneeth Sarode
a5e9529ca7
curve25519: refactor mbedTLS code to remove code duplication
...
Signed-off-by: Praneeth Sarode <praneethsarode@gmail.com >
Reviewed-by: Jakub Jelen <jjelen@redhat.com >
2025-03-30 13:04:48 +02:00
Praneeth Sarode
49a355c272
curve25519: Use mbedTLS curve25519 for ECDH, if available
...
Signed-off-by: Praneeth Sarode <praneethsarode@gmail.com >
Reviewed-by: Jakub Jelen <jjelen@redhat.com >
2025-03-30 13:04:47 +02:00
David Wedderwille
84d02e7440
kex: Make existing convenience features available
...
Signed-off-by: David Wedderwille <davidwe@posteo.de >
Reviewed-by: Jakub Jelen <jjelen@redhat.com >
2025-03-30 12:17:42 +02:00
David Wedderwille
0b91ba779c
kex: Improved naming of variables.
...
Signed-off-by: David Wedderwille <davidwe@posteo.de >
Reviewed-by: Jakub Jelen <jjelen@redhat.com >
2025-03-30 12:17:41 +02:00
Yuvraj Saxena
d02163546d
fuzz: Add ProxyJump misconfiguration cases to ssh_client_config_fuzzer_corpus
...
This commit adds test cases to catch issues where ProxyJump configurations lead to infinite loops or incorrect username usage, as reported in issue #287 , and issue #291
Signed-off-by: Yuvraj Saxena <ysaxenax@gmail.com >
Reviewed-by: Jakub Jelen <jjelen@redhat.com >
2025-03-30 12:14:37 +02:00
AsadaShino
a93e84efb9
authenticate_console:Stop authentication after SSH session disconnection to avoid hanging up in poll
...
Signed-off-by: AsadaShino <1164429449@qq.com >
Reviewed-by: Jakub Jelen <jjelen@redhat.com >
2025-03-20 15:29:59 +01:00
Eshan Kelkar
a59d587060
sftpserver.c: Add support for O_TRUNC while opening files
...
Signed-off-by: Eshan Kelkar <eshankelkar@galorithm.com >
Reviewed-by: Jakub Jelen <jjelen@redhat.com >
2025-03-18 18:13:52 +01:00