71 Commits
devel ... main

Author SHA256 Message Date
deb5be55db Accepting request 1223874 from devel:libraries:c_c++
OBS-URL: https://build.opensuse.org/request/show/1223874
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libssh2_org?expand=0&rev=46
2024-11-14 15:07:28 +00:00
3a434821e6 Accepting request 1164239 from devel:libraries:c_c++
OBS-URL: https://build.opensuse.org/request/show/1164239
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libssh2_org?expand=0&rev=45
2024-04-03 15:18:24 +00:00
24b9d6f488 Accepting request 1164237 from home:pmonrealgonzalez:branches:devel:libraries:c_c++
- Fix an issue with Encrypt-then-MAC family. [bsc#1221622]
  * Test the ETM feature in the remote end's configuration when
    receiving data. Upstream issue: #1331.
  * Add libssh2_org-ETM-remote.patch

- Always add the KEX pseudo-methods "ext-info-c" and "kex-strict-c-v00@openssh.com"
  when configuring custom method list. [bsc#1218971, CVE-2023-48795]
  * The strict-kex extension is announced in the list of available
    KEX methods. However, when the default KEX method list is modified
    or replaced, the extension is not added back automatically.
  * Add libssh2_org-CVE-2023-48795-ext.patch

OBS-URL: https://build.opensuse.org/request/show/1164237
OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/libssh2_org?expand=0&rev=77
2024-04-02 21:52:22 +00:00
347fac4a7b Accepting request 1134106 from devel:libraries:c_c++
OBS-URL: https://build.opensuse.org/request/show/1134106
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libssh2_org?expand=0&rev=44
2023-12-20 20:01:14 +00:00
David Anes
09713682e1 Accepting request 1134032 from home:ohollmann:branches:devel:libraries:c_c++
- Security fix: [bsc#1218127, CVE-2023-48795]
  * Add 'strict KEX' to fix CVE-2023-48795 "Terrapin Attack"
  * Add libssh2_org-CVE-2023-48795.patch

OBS-URL: https://build.opensuse.org/request/show/1134032
OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/libssh2_org?expand=0&rev=75
2023-12-19 21:57:18 +00:00
3b0fb425b1 Accepting request 1094135 from devel:libraries:c_c++
OBS-URL: https://build.opensuse.org/request/show/1094135
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libssh2_org?expand=0&rev=43
2023-06-21 20:37:19 +00:00
1340bd73bf Accepting request 1094134 from home:pmonrealgonzalez:branches:devel:libraries:c_c++
OBS-URL: https://build.opensuse.org/request/show/1094134
OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/libssh2_org?expand=0&rev=73
2023-06-20 17:18:33 +00:00
a10789ab49 Accepting request 1093948 from home:pmonrealgonzalez:branches:devel:libraries:c_c++
- Update to 1.11.0:
  * Enhancements and bugfixes
    - Adds support for encrypt-then-mac (ETM) MACs
    - Adds support for AES-GCM crypto protocols
    - Adds support for sk-ecdsa-sha2-nistp256 and sk-ssh-ed25519 keys
    - Adds support for RSA certificate authentication
    - Adds FIDO support with *_sk() functions
    - Adds RSA-SHA2 key upgrading to OpenSSL, WinCNG, mbedTLS, OS400 backends
    - Adds Agent Forwarding and libssh2_agent_sign()
    - Adds support for Channel Signal message libssh2_channel_signal_ex()
    - Adds support to get the user auth banner message libssh2_userauth_banner()
    - Adds LIBSSH2_NO_{MD5, HMAC_RIPEMD, DSA, RSA, RSA_SHA1, ECDSA, ED25519,
      AES_CBC, AES_CTR, BLOWFISH, RC4, CAST, 3DES} options
    - Adds direct stream UNIX sockets with libssh2_channel_direct_streamlocal_ex()
    - Adds wolfSSL support to CMake file
    - Adds mbedTLS 3.x support
    - Adds LibreSSL 3.5 support
    - Adds support for CMake "unity" builds
    - Adds CMake support for building shared and static libs in a single pass
    - Adds symbol hiding support to CMake
    - Adds support for libssh2.rc for all build tools
    - Adds .zip, .tar.xz and .tar.bz2 release tarballs
    - Enables ed25519 key support for LibreSSL 3.7.0 or higher
    - Improves OpenSSL 1.1 and 3 compatibility
    - Now requires OpenSSL 1.0.2 or newer
    - Now requires CMake 3.1 or newer
    - SFTP: Adds libssh2_sftp_open_ex_r() and libssh2_sftp_open_r() extended APIs
    - SFTP: No longer has a packet limit when reading a directory
    - SFTP: now parses attribute extensions if they exist
    - SFTP: no longer will busy loop if SFTP fails to initialize

OBS-URL: https://build.opensuse.org/request/show/1093948
OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/libssh2_org?expand=0&rev=72
2023-06-20 16:50:58 +00:00
befa0231df Accepting request 939263 from devel:libraries:c_c++
OBS-URL: https://build.opensuse.org/request/show/939263
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libssh2_org?expand=0&rev=42
2021-12-12 20:27:19 +00:00
76e14e1783 Accepting request 939227 from home:david.anes:branches:devel:libraries:c_c++
Update to 1.10.0

OBS-URL: https://build.opensuse.org/request/show/939227
OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/libssh2_org?expand=0&rev=71
2021-12-10 16:14:35 +00:00
641f039e0a Accepting request 831685 from devel:libraries:c_c++
Automatic submission by obs-autosubmit

OBS-URL: https://build.opensuse.org/request/show/831685
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libssh2_org?expand=0&rev=41
2020-09-06 19:37:05 +00:00
8ed51ae453 Accepting request 829988 from home:dimstar:Factory
- Drop man and groff BuildRequires: both are no longer used in
  current versions.

OBS-URL: https://build.opensuse.org/request/show/829988
OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/libssh2_org?expand=0&rev=69
2020-08-27 14:21:47 +00:00
46447a224f Accepting request 742246 from devel:libraries:c_c++
OBS-URL: https://build.opensuse.org/request/show/742246
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libssh2_org?expand=0&rev=40
2019-10-25 16:41:08 +00:00
Tomáš Chvátal
194c4edcf2 Accepting request 742231 from home:pmonrealgonzalez:branches:devel:libraries:c_c++
- Security fix: [bsc#1154862, CVE-2019-17498]
  * The SSH_MSG_DISCONNECT:packet.c logic has an integer overflow in
    a bounds check that might lead to disclose sensitive information
    or cause a denial of service
  * Add patch libssh2_org-CVE-2019-17498.patch

OBS-URL: https://build.opensuse.org/request/show/742231
OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/libssh2_org?expand=0&rev=67
2019-10-23 19:01:44 +00:00
7e6273c7a9 Accepting request 711291 from devel:libraries:c_c++
OBS-URL: https://build.opensuse.org/request/show/711291
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libssh2_org?expand=0&rev=39
2019-06-25 20:17:25 +00:00
9307041c2f Accepting request 711121 from home:pmonrealgonzalez:branches:devel:libraries:c_c++
- Version update to 1.9.0:
   Enhancements and bugfixes:
    * adds ECDSA keys and host key support when using OpenSSL
    * adds ED25519 key and host key support when using OpenSSL 1.1.1
    * adds OpenSSH style key file reading
    * adds AES CTR mode support when using WinCNG
    * adds PEM passphrase protected file support for Libgcrypt and WinCNG
    * adds SHA256 hostkey fingerprint
    * adds libssh2_agent_get_identity_path() and libssh2_agent_set_identity_path()
    * adds explicit zeroing of sensitive data in memory
    * adds additional bounds checks to network buffer reads
    * adds the ability to use the server default permissions when creating sftp directories
    * adds support for building with OpenSSL no engine flag
    * adds support for building with LibreSSL
    * increased sftp packet size to 256k
    * fixed oversized packet handling in sftp
    * fixed building with OpenSSL 1.1
    * fixed a possible crash if sftp stat gets an unexpected response
    * fixed incorrect parsing of the KEX preference string value
    * fixed conditional RSA and AES-CTR support
    * fixed a small memory leak during the key exchange process
    * fixed a possible memory leak of the ssh banner string
    * fixed various small memory leaks in the backends
    * fixed possible out of bounds read when parsing public keys from the server
    * fixed possible out of bounds read when parsing invalid PEM files
    * no longer null terminates the scp remote exec command
    * now handle errors when diffie hellman key pair generation fails
    * improved building instructions
    * improved unit tests
- Rebased patch libssh2-ocloexec.patch

OBS-URL: https://build.opensuse.org/request/show/711121
OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/libssh2_org?expand=0&rev=65
2019-06-21 09:50:59 +00:00
5fc8188a2c Accepting request 692646 from devel:libraries:c_c++
OBS-URL: https://build.opensuse.org/request/show/692646
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libssh2_org?expand=0&rev=38
2019-04-12 07:13:02 +00:00
4dd88213d6 Accepting request 692556 from home:pmonrealgonzalez:branches:devel:libraries:c_c++
- Version update to 1.8.2: [bsc#1130103]
   Bug fixes:
    * Fixed the misapplied userauth patch that broke 1.8.1
    * moved the MAX size declarations from the public header

OBS-URL: https://build.opensuse.org/request/show/692556
OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/libssh2_org?expand=0&rev=63
2019-04-09 15:24:57 +00:00
e653c808f8 Accepting request 686382 from devel:libraries:c_c++
OBS-URL: https://build.opensuse.org/request/show/686382
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libssh2_org?expand=0&rev=37
2019-03-24 13:55:54 +00:00
Tomáš Chvátal
95d1d4c548 Accepting request 686341 from home:pmonrealgonzalez:branches:devel:libraries:c_c++
- Version update to 1.8.1:
  Bug Fixes:
   * [bsc#1128471, CVE-2019-3855] Integer overflow when reading a specially
     crafted packet
   * [bsc#1128493, CVE-2019-3863] Integer overflow in userauth_keyboard_interactive
     with a number of extremely long prompt strings
   * [bsc#1128472, CVE-2019-3856] Integer overflow if the server sent an extremely
     large number of keyboard prompts
   * [bsc#1128490, CVE-2019-3861] Out of bounds read when processing a specially
     crafted packet
   * [bsc#1128474, CVE-2019-3857] Integer overflow when receiving a specially
     crafted exit signal message channel packet
   * [bsc#1128492, CVE-2019-3862] Out of bounds read when receiving a specially
     crafted exit status message channel packet
   * [bsc#1128476, CVE-2019-3858] Zero byte allocation when reading a specially
     crafted SFTP packet
   * [bsc#1128481, CVE-2019-3860] Out of bounds reads when processing specially
     crafted SFTP packets
   * [bsc#1128480, CVE-2019-3859] Out of bounds reads in _libssh2_packet_require(v)

OBS-URL: https://build.opensuse.org/request/show/686341
OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/libssh2_org?expand=0&rev=61
2019-03-19 10:41:33 +00:00
97a9d137a9 Accepting request 566491 from devel:libraries:c_c++
OBS-URL: https://build.opensuse.org/request/show/566491
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libssh2_org?expand=0&rev=36
2018-01-19 10:46:23 +00:00
Tomáš Chvátal
cffaab5577 Accepting request 566490 from home:dimstar:Factory
- Drop openssh BuildRequires: this is only used for one of the
  minor self-tests.

And in plus, this should kill the small cycle

  openssh -> libssh2_org -> systemd -> openssh

OBS-URL: https://build.opensuse.org/request/show/566490
OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/libssh2_org?expand=0&rev=59
2018-01-16 19:05:47 +00:00
089ee162b4 Accepting request 507169 from devel:libraries:c_c++
1

OBS-URL: https://build.opensuse.org/request/show/507169
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libssh2_org?expand=0&rev=35
2017-07-04 07:08:25 +00:00
Tomáš Chvátal
23c9c70d71 Accepting request 507160 from home:jengelh:branches:devel:libraries:c_c++
- Remove --with-pic which is only for static libs

OBS-URL: https://build.opensuse.org/request/show/507160
OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/libssh2_org?expand=0&rev=57
2017-06-29 20:13:55 +00:00
f045a387dd Accepting request 503643 from devel:libraries:c_c++
- Version update to 1.8.0:
  * support openssl-1.1
  * many bugfixes
- Fixes bsc#1042660
- Remove obsolete conditionals that are no longer needed

OBS-URL: https://build.opensuse.org/request/show/503643
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libssh2_org?expand=0&rev=34
2017-06-20 08:57:38 +00:00
Tomáš Chvátal
84a34035da - Version update to 1.8.0:
* support openssl-1.1
  * many bugfixes
- Fixes bsc#1042660
- Remove obsolete conditionals that are no longer needed

OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/libssh2_org?expand=0&rev=55
2017-06-14 10:25:35 +00:00
7c30faf4e0 Accepting request 361128 from devel:libraries:c_c++
1

OBS-URL: https://build.opensuse.org/request/show/361128
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libssh2_org?expand=0&rev=33
2016-02-25 21:27:28 +00:00
Ismail Dönmez
029f6ff34f Accepting request 361119 from home:vitezslav_cizek:branches:devel:libraries:c_c++
- update to 1.7.0
  * Fixes CVE-2016-0787 (boo#967026)
  * Changes:
    libssh2_session_set_last_error: Add function
    mac: Add support for HMAC-SHA-256 and HMAC-SHA-512
    WinCNG: support for SHA256/512 HMAC
    kex: Added diffie-hellman-group-exchange-sha256 support
    OS/400 crypto library QC3 support
  * and many bugfixes

OBS-URL: https://build.opensuse.org/request/show/361119
OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/libssh2_org?expand=0&rev=53
2016-02-23 14:20:38 +00:00
Stephan Kulow
5e8c1112ed Accepting request 311845 from devel:libraries:c_c++
1

OBS-URL: https://build.opensuse.org/request/show/311845
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libssh2_org?expand=0&rev=32
2015-06-17 14:15:33 +00:00
Ismail Dönmez
14b6d6ad9d Accepting request 311823 from home:vitezslav_cizek:branches:devel:libraries:c_c++
- update to 1.6.0
  Changes:
    Added CMake build system
    Added libssh2_userauth_publickey_frommemory()
  Bug fixes:
    wait_socket: wrong use of difftime()
    userauth: Fixed prompt text no longer being copied to the prompts struct
    mingw build: allow to pass custom CFLAGS
    Let mansyntax.sh work regardless of where it is called from
    Init HMAC_CTX before using it
    direct_tcpip: Fixed channel write
    WinCNG: fixed backend breakage
    OpenSSL: caused by introducing libssh2_hmac_ctx_init
    userauth.c: fix possible dereferences of a null pointer
    wincng: Added explicit clear memory feature to WinCNG backend
    openssl.c: fix possible segfault in case EVP_DigestInit fails
    wincng: fix return code of libssh2_md5_init()
    kex: do not ignore failure of libssh2_sha1_init()
    scp: fix that scp_send may transmit not initialised memory
    scp.c: improved command length calculation
    nonblocking examples: fix warning about unused tvdiff on Mac OS X
    configure: make clear-memory default but WARN if backend unsupported
    OpenSSL: Enable use of OpenSSL that doesn't have DSA
    OpenSSL: Use correct no-blowfish #define
    kex: fix libgcrypt memory leaks of bignum
    libssh2_channel_open: more detailed error message
    wincng: fixed memleak in (block) cipher destructor

OBS-URL: https://build.opensuse.org/request/show/311823
OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/libssh2_org?expand=0&rev=51
2015-06-13 07:50:45 +00:00
1586c75d53 Accepting request 290528 from devel:libraries:c_c++
1

OBS-URL: https://build.opensuse.org/request/show/290528
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libssh2_org?expand=0&rev=31
2015-03-16 08:38:07 +00:00
Ismail Dönmez
24c5ad3751 Accepting request 290303 from home:vitezslav_cizek:branches:devel:libraries:c_c++
- update to 1.5.0
  * fixes CVE-2015-1782 (bnc#921070)
- tarball verification
  * added libssh2_org.keyring
  * added libssh2-1.5.0.tar.gz.asc
Changes in 1.5.0:
  Added Windows Cryptography API: Next Generation based backend
Bug fixes:
  Security Advisory: Using `SSH_MSG_KEXINIT` data unbounded, CVE-2015-1782
  missing _libssh2_error in _libssh2_channel_write
  knownhost: Fix DSS keys being detected as unknown.
  knownhost: Restore behaviour of `libssh2_knownhost_writeline` with short buffer.
  libssh2.h: on Windows, a socket is of type SOCKET, not int
  libssh2_priv.h: a 1 bit bit-field should be unsigned
  windows build: do not export externals from static library
  Fixed two potential use-after-frees of the payload buffer
  Fixed a few memory leaks in error paths
  userauth: Fixed an attempt to free from stack on error
  agent_list_identities: Fixed memory leak on OOM
  knownhosts: Abort if the hosts buffer is too small
  sftp_close_handle: ensure the handle is always closed
  channel_close: Close the channel even in the case of errors
  docs: added missing libssh2_session_handshake.3 file
  docs: fixed a bunch of typos
  userauth_password: pass on the underlying error code
  _libssh2_channel_forward_cancel: accessed struct after free
  _libssh2_packet_add: avoid using uninitialized memory
  _libssh2_channel_forward_cancel: avoid memory leaks on error
  _libssh2_channel_write: client spins on write when window full
  windows build: fix build errors

OBS-URL: https://build.opensuse.org/request/show/290303
OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/libssh2_org?expand=0&rev=49
2015-03-13 06:55:14 +00:00
Stephan Kulow
4a455a122f Accepting request 180805 from devel:libraries:c_c++
- ignore groff-full to remove factory build cycle
- add groff to build requires to make tests passing

OBS-URL: https://build.opensuse.org/request/show/180805
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libssh2_org?expand=0&rev=28
2013-06-26 11:57:44 +00:00
908ef872a9 - ignore groff-full to remove factory build cycle
- add groff to build requires to make tests passing

OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/libssh2_org?expand=0&rev=47
2013-06-25 07:56:12 +00:00
Stephan Kulow
8a8060e8b1 Accepting request 173203 from devel:libraries:c_c++
fixed building on older OS/sle targets (forwarded request 173167 from bmanojlovic)

OBS-URL: https://build.opensuse.org/request/show/173203
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libssh2_org?expand=0&rev=27
2013-04-24 19:42:39 +00:00
08367842ae Accepting request 173167 from home:bmanojlovic:branches:devel:libraries:c_c++
fixed building on older OS/sle targets

OBS-URL: https://build.opensuse.org/request/show/173167
OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/libssh2_org?expand=0&rev=45
2013-04-24 16:31:10 +00:00
Stephan Kulow
6747957a0c Accepting request 156953 from devel:libraries:c_c++
- Use AC_CONFIG_HEADERS instead of AM_CONFIG_HEADER, fixes 
  build with new automake (forwarded request 156888 from elvigia)

OBS-URL: https://build.opensuse.org/request/show/156953
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libssh2_org?expand=0&rev=26
2013-03-03 20:07:24 +00:00
Ismail Dönmez
581fbe7b99 Accepting request 156888 from home:elvigia:branches:devel:libraries:c_c++
- Use AC_CONFIG_HEADERS instead of AM_CONFIG_HEADER, fixes 
  build with new automake

OBS-URL: https://build.opensuse.org/request/show/156888
OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/libssh2_org?expand=0&rev=43
2013-03-01 10:22:28 +00:00
Stephan Kulow
8ec151cf90 Accepting request 148084 from devel:libraries:c_c++
- update to 1.4.3
    compression: add support for zlib@openssh.com
    Bug fixes:
    sftp_read: return error if a too large package arrives
    libssh2_hostkey_hash.3: update the description of return value
    examples: use stderr for messages, stdout for data
    openssl: do not leak memory when handling errors
    improved handling of disabled MD5 algorithm in OpenSSL
    known_hosts: Fail when parsing unknown keys in known_hosts file
    configure: gcrypt doesn't come with pkg-config support
    session_free: wrong variable used for keeping state
    libssh2_userauth_publickey_fromfile_ex.3: mention publickey == NULL
    comp_method_zlib_decomp: handle Z_BUF_ERROR when inflating
    Return LIBSSH2_ERROR_SOCKET_DISCONNECT on EOF when reading banner
    userauth.c: fread() from public key file to correctly detect any errors
    configure.ac: Add option to disable build of the example applications
    Added 'Requires.private:' line to libssh2.pc
    SFTP: filter off incoming "zombie" responses
    gettimeofday: no need for a replacement under cygwin
    SSH_MSG_CHANNEL_REQUEST: default to want_reply
    win32/libssh2_config.h: Remove hardcoded #define LIBSSH2_HAVE_ZLIB
    build error with gcrypt backend
    always do "forced" window updates to avoid corner case stalls
    aes: the init function fails when OpenSSL has AES support
    transport_send: Finish in-progress key exchange before sending data
    channel_write: acknowledge transport errors
    examples/x11.c: Make sure sizeof passed to read operation is correct
    examples/x11.c:,Fix suspicious sizeof usage
    sftp_packet_add: verify the packet before accepting it
    SFTP: preserve the original error code more (forwarded request 147891 from vitezslav_cizek)

OBS-URL: https://build.opensuse.org/request/show/148084
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libssh2_org?expand=0&rev=24
2013-01-12 13:52:06 +00:00
e7c6234e52 Accepting request 147891 from home:vitezslav_cizek:branches:devel:libraries:c_c++
- update to 1.4.3
    compression: add support for zlib@openssh.com
    Bug fixes:
    sftp_read: return error if a too large package arrives
    libssh2_hostkey_hash.3: update the description of return value
    examples: use stderr for messages, stdout for data
    openssl: do not leak memory when handling errors
    improved handling of disabled MD5 algorithm in OpenSSL
    known_hosts: Fail when parsing unknown keys in known_hosts file
    configure: gcrypt doesn't come with pkg-config support
    session_free: wrong variable used for keeping state
    libssh2_userauth_publickey_fromfile_ex.3: mention publickey == NULL
    comp_method_zlib_decomp: handle Z_BUF_ERROR when inflating
    Return LIBSSH2_ERROR_SOCKET_DISCONNECT on EOF when reading banner
    userauth.c: fread() from public key file to correctly detect any errors
    configure.ac: Add option to disable build of the example applications
    Added 'Requires.private:' line to libssh2.pc
    SFTP: filter off incoming "zombie" responses
    gettimeofday: no need for a replacement under cygwin
    SSH_MSG_CHANNEL_REQUEST: default to want_reply
    win32/libssh2_config.h: Remove hardcoded #define LIBSSH2_HAVE_ZLIB
    build error with gcrypt backend
    always do "forced" window updates to avoid corner case stalls
    aes: the init function fails when OpenSSL has AES support
    transport_send: Finish in-progress key exchange before sending data
    channel_write: acknowledge transport errors
    examples/x11.c: Make sure sizeof passed to read operation is correct
    examples/x11.c:,Fix suspicious sizeof usage
    sftp_packet_add: verify the packet before accepting it
    SFTP: preserve the original error code more

OBS-URL: https://build.opensuse.org/request/show/147891
OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/libssh2_org?expand=0&rev=41
2013-01-11 14:43:44 +00:00
Stephan Kulow
aad2ac6d72 Accepting request 102482 from devel:libraries:c_c++
- fix license (forwarded request 102481 from elvigia)

OBS-URL: https://build.opensuse.org/request/show/102482
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libssh2_org?expand=0&rev=22
2012-02-03 09:24:24 +00:00
Ismail Dönmez
de8818b3f7 Accepting request 102481 from home:elvigia:branches:devel:libraries:c_c++
- fix license

OBS-URL: https://build.opensuse.org/request/show/102481
OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/libssh2_org?expand=0&rev=39
2012-02-02 13:39:51 +00:00
Cristian Rodríguez
113852fc13 Accepting request 102437 from home:elvigia:branches:devel:libraries:c_c++
- Update to version 1.4.0 plus git bugfixes

OBS-URL: https://build.opensuse.org/request/show/102437
OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/libssh2_org?expand=0&rev=38
2012-02-02 04:31:06 +00:00
Stephan Kulow
94b56ca8ef Accepting request 98260 from devel:libraries:c_c++
- Refresh patches. (forwarded request 98259 from elvigia)

OBS-URL: https://build.opensuse.org/request/show/98260
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libssh2_org?expand=0&rev=21
2011-12-31 16:19:54 +00:00
Cristian Rodríguez
87203238c9 Accepting request 98259 from home:elvigia:branches:devel:libraries:c_c++
- Refresh patches.

OBS-URL: https://build.opensuse.org/request/show/98259
OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/libssh2_org?expand=0&rev=36
2011-12-27 04:11:19 +00:00
f5a95ea363 Remove redundant/unwanted tags/section (cf. specfile guidelines)
OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/libssh2_org?expand=0&rev=35
2011-12-01 03:42:14 +00:00
Cristian Rodríguez
73e5b41339 Accepting request 94640 from home:elvigia:branches:devel:libraries:c_c++
- open library file descriptors with O_CLOEXEC

OBS-URL: https://build.opensuse.org/request/show/94640
OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/libssh2_org?expand=0&rev=34
2011-12-01 02:46:12 +00:00
Stephan Kulow
b01a01a7d0 Accepting request 89035 from devel:libraries:c_c++
- Update to version 1.3.0
* sftp_read: advance offset correctly for buffered copies
* libssh2_sftp_seek64: flush packetlist and buffered data
* _libssh2_packet_add: adjust window size when truncating
* sftp_read: a short read is not end of file (forwarded request 89034 from elvigia)

OBS-URL: https://build.opensuse.org/request/show/89035
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libssh2_org?expand=0&rev=20
2011-10-25 14:08:38 +00:00
Cristian Rodríguez
7ddc07686f Accepting request 89034 from home:elvigia:branches:devel:libraries:c_c++
- Update to version 1.3.0
* sftp_read: advance offset correctly for buffered copies
* libssh2_sftp_seek64: flush packetlist and buffered data
* _libssh2_packet_add: adjust window size when truncating
* sftp_read: a short read is not end of file

OBS-URL: https://build.opensuse.org/request/show/89034
OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/libssh2_org?expand=0&rev=32
2011-10-21 18:18:27 +00:00
Lars Vogdt
c7ae264e97 Accepting request 86038 from devel:libraries:c_c++
- document the reason for the testsuite failure

OBS-URL: https://build.opensuse.org/request/show/86038
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libssh2_org?expand=0&rev=18
2011-10-03 07:24:25 +00:00
ee3b284919 Accepting request 86031 from openSUSE:Factory:ARM
- document the reason for the testsuite failure

OBS-URL: https://build.opensuse.org/request/show/86031
OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/libssh2_org?expand=0&rev=30
2011-10-02 13:42:30 +00:00
Lars Vogdt
6494cea67c Accepting request 85831 from devel:libraries:c_c++
Broken macro usage (forwarded request 85830 from elvigia)

OBS-URL: https://build.opensuse.org/request/show/85831
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libssh2_org?expand=0&rev=17
2011-10-02 08:16:28 +00:00
Cristian Rodríguez
1d726d074a Accepting request 85830 from home:elvigia:branches:devel:libraries:c_c++
Broken macro usage

OBS-URL: https://build.opensuse.org/request/show/85830
OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/libssh2_org?expand=0&rev=28
2011-09-30 19:59:17 +00:00
Cristian Rodríguez
aca8bbe8bc Accepting request 85819 from home:elvigia:branches:devel:libraries:c_c++
- Workaround qemu-arm problems.

OBS-URL: https://build.opensuse.org/request/show/85819
OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/libssh2_org?expand=0&rev=27
2011-09-30 17:41:48 +00:00
Sascha Peilicke
e463062aee Autobuild autoformatter for 81055
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libssh2_org?expand=0&rev=16
2011-09-06 13:36:21 +00:00
OBS User buildservice-autocommit
bfd70ff1b8 Updating link to change in openSUSE:Factory/libssh2_org revision 16.0
OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/libssh2_org?expand=0&rev=9873d46484f0d1b02f59387e408a63bc
2011-09-06 13:36:21 +00:00
Sascha Peilicke
8643225a83 Accepting request 81055 from devel:libraries:c_c++
- respect user's openssl.cnf engine configuration, might 
 want to do crypto with aes-ni, intel-accell or use rdrand (forwarded request 81054 from elvigia)

OBS-URL: https://build.opensuse.org/request/show/81055
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libssh2_org?expand=0&rev=15
2011-09-06 13:36:13 +00:00
Cristian Rodríguez
0b22ddfb7a Accepting request 81054 from home:elvigia:branches:devel:libraries:c_c++
- respect user's openssl.cnf engine configuration, might 
 want to do crypto with aes-ni, intel-accell or use rdrand

OBS-URL: https://build.opensuse.org/request/show/81054
OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/libssh2_org?expand=0&rev=25
2011-09-06 04:48:20 +00:00
Sascha Peilicke
ba1217f597 Autobuild autoformatter for 79180
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libssh2_org?expand=0&rev=14
2011-08-18 07:37:22 +00:00
OBS User buildservice-autocommit
93be781720 Updating link to change in openSUSE:Factory/libssh2_org revision 14.0
OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/libssh2_org?expand=0&rev=3875bcbb5dbf18e9f2107b93f5ed29fd
2011-08-18 07:37:22 +00:00
Sascha Peilicke
b037ce1dc7 Accepting request 79180 from devel:libraries:c_c++
- Update to version 1.2.9
* Added libssh2_session_set_timeout() and 
  libssh2_session_get_timeout() to make blocking calls get a timeout
* userauth_keyboard_interactive: fix buffer overflow (forwarded request 79178 from elvigia)

OBS-URL: https://build.opensuse.org/request/show/79180
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libssh2_org?expand=0&rev=13
2011-08-18 07:37:12 +00:00
Cristian Rodríguez
e461438f7a Accepting request 79178 from home:elvigia:branches:devel:libraries:c_c++
- Update to version 1.2.9
* Added libssh2_session_set_timeout() and 
  libssh2_session_get_timeout() to make blocking calls get a timeout
* userauth_keyboard_interactive: fix buffer overflow

OBS-URL: https://build.opensuse.org/request/show/79178
OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/libssh2_org?expand=0&rev=23
2011-08-17 21:20:59 +00:00
OBS User autobuild
baba7d0190 Autobuild autoformatter for 51660
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libssh2_org?expand=0&rev=11
2010-11-02 10:03:26 +00:00
Ruediger Oertel
8612a04e1c Accepting request 51660 from devel:libraries:c_c++
Accepted submit request 51660 from user elvigia

OBS-URL: https://build.opensuse.org/request/show/51660
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libssh2_org?expand=0&rev=10
2010-11-02 10:03:18 +00:00
Cristian Rodríguez
fd4e13a61b Accepting request 51659 from home:elvigia:branches:devel:libraries:c_c++
OBS-URL: https://build.opensuse.org/request/show/51659
OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/libssh2_org?expand=0&rev=21
2010-10-29 17:14:28 +00:00
OBS User autobuild
199d4fb5d9 Accepting request 44907 from devel:libraries:c_c++
Copy from devel:libraries:c_c++/libssh2_org based on submit request 44907 from user elvigia

OBS-URL: https://build.opensuse.org/request/show/44907
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libssh2_org?expand=0&rev=9
2010-08-09 00:09:57 +00:00
OBS User autobuild
def7a84ba4 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libssh2_org?expand=0&rev=6 2010-03-18 15:05:37 +00:00
OBS User autobuild
d2dfdb0287 Accepting request 31722 from devel:libraries:c_c++
Copy from devel:libraries:c_c++/libssh2_org based on submit request 31722 from user msmeissn

OBS-URL: https://build.opensuse.org/request/show/31722
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libssh2_org?expand=0&rev=5
2010-02-11 18:32:00 +00:00
OBS User unknown
f107d9597f OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libssh2_org?expand=0&rev=3 2009-05-28 02:37:51 +00:00
OBS User unknown
a94b173864 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libssh2_org?expand=0&rev=2 2009-01-08 17:45:06 +00:00
OBS User unknown
781df34c8b OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libssh2_org?expand=0&rev=1 2008-11-04 16:48:58 +00:00
5 changed files with 0 additions and 564 deletions

BIN
libssh2-1.11.0.tar.xz (Stored with Git LFS)

Binary file not shown.

View File

@@ -1,11 +0,0 @@
-----BEGIN PGP SIGNATURE-----
iQEzBAABCgAdFiEEJ+3q8i86vOtQ25oSXMkI/bceEsIFAmR2HWEACgkQXMkI/bce
EsIBgwf/ZExq9GsrLaX3eFiOe6/qjcixscNfP2TfBn/b9miKzmTCEle9H/wLUaeI
VVB/Zs9pNAlROJ+QEGQKfBb5fzGJm9nifWsuZ+Y65s8JGUzI3Y3cKdsyYTV8Myaj
1IvMR/oQoPjW8bd0a3SsKRLdWhN/9/Q4fiEjSs2Zp1OuCaLnLebyPgXx8f3BpXKQ
YfLYUslRgKGND+VULfUki1i8mvF4ledhanf1nTRxwfK5HrXWLT/Yd+lVRKTZgWl+
2YqXvGU9pI9N7GSVfHttYEbqP8hd8ncxea46bSaSauc4e5Sn9lYAvo2Wri33zPLw
MwI17cyi7s1H0CuIc2cT4L8BUYg3vw==
=eRz/
-----END PGP SIGNATURE-----

View File

@@ -1,65 +0,0 @@
From 59786b186d4de8fd6cd5aeebedbce2362a849566 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Josef=20=C4=8Cejka?= <jcejka@suse.cz>
Date: Tue, 6 Feb 2024 15:14:29 +0100
Subject: [PATCH] Always add extension indicators to kex_algorithms
KEX pseudo-methods "ext-info-c" and "kex-strict-c-v00@openssh.com"
are in default kex method list but they were lost
after configuring custom kex method list in libssh2_session_method_pref().
---
src/kex.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/src/kex.c b/src/kex.c
index 8c65a0fe..1d1dadfa 100644
--- a/src/kex.c
+++ b/src/kex.c
@@ -4027,13 +4027,25 @@ libssh2_session_method_pref(LIBSSH2_SESSION * session, int method_type,
const char *prefs)
{
char **prefvar, *s, *newprefs;
+ char *tmpprefs = NULL;
size_t prefs_len = strlen(prefs);
const LIBSSH2_COMMON_METHOD **mlist;
+ const char *kex_extensions = "ext-info-c,kex-strict-c-v00@openssh.com,";
+ size_t kex_extensions_len = strlen(kex_extensions);
switch(method_type) {
case LIBSSH2_METHOD_KEX:
prefvar = &session->kex_prefs;
mlist = (const LIBSSH2_COMMON_METHOD **)libssh2_kex_methods;
+ tmpprefs = LIBSSH2_ALLOC(session, kex_extensions_len + prefs_len + 1);
+ if(!tmpprefs) {
+ return _libssh2_error(session, LIBSSH2_ERROR_ALLOC,
+ "Error allocated space for kex method preferences");
+ }
+ memcpy(tmpprefs, kex_extensions, kex_extensions_len);
+ memcpy(tmpprefs + kex_extensions_len, prefs, prefs_len + 1);
+ prefs = tmpprefs;
+ prefs_len = strlen(prefs);
break;
case LIBSSH2_METHOD_HOSTKEY:
@@ -4093,6 +4105,9 @@ libssh2_session_method_pref(LIBSSH2_SESSION * session, int method_type,
s = newprefs = LIBSSH2_ALLOC(session, prefs_len + 1);
if(!newprefs) {
+ if (tmpprefs) {
+ LIBSSH2_FREE(session, tmpprefs);
+ }
return _libssh2_error(session, LIBSSH2_ERROR_ALLOC,
"Error allocated space for method preferences");
}
@@ -4121,6 +4136,10 @@ libssh2_session_method_pref(LIBSSH2_SESSION * session, int method_type,
}
}
+ if (tmpprefs) {
+ LIBSSH2_FREE(session, tmpprefs);
+ }
+
if(!*newprefs) {
LIBSSH2_FREE(session, newprefs);
return _libssh2_error(session, LIBSSH2_ERROR_METHOD_NOT_SUPPORTED,
--
2.26.2

View File

@@ -1,459 +0,0 @@
From d34d9258b8420b19ec3f97b4cc5bf7aa7d98e35a Mon Sep 17 00:00:00 2001
From: Michael Buckley <michael@buckleyisms.com>
Date: Thu, 30 Nov 2023 15:08:02 -0800
Subject: [PATCH] src: add 'strict KEX' to fix CVE-2023-48795 "Terrapin Attack"
Refs:
https://terrapin-attack.com/
https://seclists.org/oss-sec/2023/q4/292
https://osv.dev/list?ecosystem=&q=CVE-2023-48795
https://github.com/advisories/GHSA-45x7-px36-x8w8
https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-48795
Fixes #1290
Closes #1291
---
src/kex.c | 63 +++++++++++++++++++++++------------
src/libssh2_priv.h | 18 +++++++---
src/packet.c | 83 +++++++++++++++++++++++++++++++++++++++++++---
src/packet.h | 2 +-
src/session.c | 3 ++
src/transport.c | 12 ++++++-
6 files changed, 149 insertions(+), 32 deletions(-)
Index: libssh2-1.11.0/src/kex.c
===================================================================
--- libssh2-1.11.0.orig/src/kex.c
+++ libssh2-1.11.0/src/kex.c
@@ -3037,6 +3037,13 @@ kex_method_extension_negotiation = {
0,
};
+static const LIBSSH2_KEX_METHOD
+kex_method_strict_client_extension = {
+ "kex-strict-c-v00@openssh.com",
+ NULL,
+ 0,
+};
+
static const LIBSSH2_KEX_METHOD *libssh2_kex_methods[] = {
#if LIBSSH2_ED25519
&kex_method_ssh_curve25519_sha256,
@@ -3055,6 +3062,7 @@ static const LIBSSH2_KEX_METHOD *libssh2
&kex_method_diffie_helman_group1_sha1,
&kex_method_diffie_helman_group_exchange_sha1,
&kex_method_extension_negotiation,
+ &kex_method_strict_client_extension,
NULL
};
@@ -3307,13 +3315,13 @@ static int kexinit(LIBSSH2_SESSION * ses
return 0;
}
-/* kex_agree_instr
+/* _libssh2_kex_agree_instr
* Kex specific variant of strstr()
* Needle must be preceded by BOL or ',', and followed by ',' or EOL
*/
-static unsigned char *
-kex_agree_instr(unsigned char *haystack, size_t haystack_len,
- const unsigned char *needle, size_t needle_len)
+unsigned char *
+_libssh2_kex_agree_instr(unsigned char *haystack, size_t haystack_len,
+ const unsigned char *needle, size_t needle_len)
{
unsigned char *s;
unsigned char *end_haystack;
@@ -3398,7 +3406,7 @@ static int kex_agree_hostkey(LIBSSH2_SES
while(s && *s) {
unsigned char *p = (unsigned char *) strchr((char *) s, ',');
size_t method_len = (p ? (size_t)(p - s) : strlen((char *) s));
- if(kex_agree_instr(hostkey, hostkey_len, s, method_len)) {
+ if(_libssh2_kex_agree_instr(hostkey, hostkey_len, s, method_len)) {
const LIBSSH2_HOSTKEY_METHOD *method =
(const LIBSSH2_HOSTKEY_METHOD *)
kex_get_method_by_name((char *) s, method_len,
@@ -3432,9 +3440,9 @@ static int kex_agree_hostkey(LIBSSH2_SES
}
while(hostkeyp && (*hostkeyp) && (*hostkeyp)->name) {
- s = kex_agree_instr(hostkey, hostkey_len,
- (unsigned char *) (*hostkeyp)->name,
- strlen((*hostkeyp)->name));
+ s = _libssh2_kex_agree_instr(hostkey, hostkey_len,
+ (unsigned char *) (*hostkeyp)->name,
+ strlen((*hostkeyp)->name));
if(s) {
/* So far so good, but does it suit our purposes? (Encrypting vs
Signing) */
@@ -3468,6 +3476,12 @@ static int kex_agree_kex_hostkey(LIBSSH2
{
const LIBSSH2_KEX_METHOD **kexp = libssh2_kex_methods;
unsigned char *s;
+ const unsigned char *strict =
+ (unsigned char *)"kex-strict-s-v00@openssh.com";
+
+ if(_libssh2_kex_agree_instr(kex, kex_len, strict, 28)) {
+ session->kex_strict = 1;
+ }
if(session->kex_prefs) {
s = (unsigned char *) session->kex_prefs;
@@ -3475,7 +3489,7 @@ static int kex_agree_kex_hostkey(LIBSSH2
while(s && *s) {
unsigned char *q, *p = (unsigned char *) strchr((char *) s, ',');
size_t method_len = (p ? (size_t)(p - s) : strlen((char *) s));
- q = kex_agree_instr(kex, kex_len, s, method_len);
+ q = _libssh2_kex_agree_instr(kex, kex_len, s, method_len);
if(q) {
const LIBSSH2_KEX_METHOD *method = (const LIBSSH2_KEX_METHOD *)
kex_get_method_by_name((char *) s, method_len,
@@ -3509,9 +3523,9 @@ static int kex_agree_kex_hostkey(LIBSSH2
}
while(*kexp && (*kexp)->name) {
- s = kex_agree_instr(kex, kex_len,
- (unsigned char *) (*kexp)->name,
- strlen((*kexp)->name));
+ s = _libssh2_kex_agree_instr(kex, kex_len,
+ (unsigned char *) (*kexp)->name,
+ strlen((*kexp)->name));
if(s) {
/* We've agreed on a key exchange method,
* Can we agree on a hostkey that works with this kex?
@@ -3555,7 +3569,7 @@ static int kex_agree_crypt(LIBSSH2_SESSI
unsigned char *p = (unsigned char *) strchr((char *) s, ',');
size_t method_len = (p ? (size_t)(p - s) : strlen((char *) s));
- if(kex_agree_instr(crypt, crypt_len, s, method_len)) {
+ if(_libssh2_kex_agree_instr(crypt, crypt_len, s, method_len)) {
const LIBSSH2_CRYPT_METHOD *method =
(const LIBSSH2_CRYPT_METHOD *)
kex_get_method_by_name((char *) s, method_len,
@@ -3577,9 +3591,9 @@ static int kex_agree_crypt(LIBSSH2_SESSI
}
while(*cryptp && (*cryptp)->name) {
- s = kex_agree_instr(crypt, crypt_len,
- (unsigned char *) (*cryptp)->name,
- strlen((*cryptp)->name));
+ s = _libssh2_kex_agree_instr(crypt, crypt_len,
+ (unsigned char *) (*cryptp)->name,
+ strlen((*cryptp)->name));
if(s) {
endpoint->crypt = *cryptp;
return 0;
@@ -3619,7 +3633,7 @@ static int kex_agree_mac(LIBSSH2_SESSION
unsigned char *p = (unsigned char *) strchr((char *) s, ',');
size_t method_len = (p ? (size_t)(p - s) : strlen((char *) s));
- if(kex_agree_instr(mac, mac_len, s, method_len)) {
+ if(_libssh2_kex_agree_instr(mac, mac_len, s, method_len)) {
const LIBSSH2_MAC_METHOD *method = (const LIBSSH2_MAC_METHOD *)
kex_get_method_by_name((char *) s, method_len,
(const LIBSSH2_COMMON_METHOD **)
@@ -3640,8 +3654,9 @@ static int kex_agree_mac(LIBSSH2_SESSION
}
while(*macp && (*macp)->name) {
- s = kex_agree_instr(mac, mac_len, (unsigned char *) (*macp)->name,
- strlen((*macp)->name));
+ s = _libssh2_kex_agree_instr(mac, mac_len,
+ (unsigned char *) (*macp)->name,
+ strlen((*macp)->name));
if(s) {
endpoint->mac = *macp;
return 0;
@@ -3672,7 +3687,7 @@ static int kex_agree_comp(LIBSSH2_SESSIO
unsigned char *p = (unsigned char *) strchr((char *) s, ',');
size_t method_len = (p ? (size_t)(p - s) : strlen((char *) s));
- if(kex_agree_instr(comp, comp_len, s, method_len)) {
+ if(_libssh2_kex_agree_instr(comp, comp_len, s, method_len)) {
const LIBSSH2_COMP_METHOD *method =
(const LIBSSH2_COMP_METHOD *)
kex_get_method_by_name((char *) s, method_len,
@@ -3694,8 +3709,9 @@ static int kex_agree_comp(LIBSSH2_SESSIO
}
while(*compp && (*compp)->name) {
- s = kex_agree_instr(comp, comp_len, (unsigned char *) (*compp)->name,
- strlen((*compp)->name));
+ s = _libssh2_kex_agree_instr(comp, comp_len,
+ (unsigned char *) (*compp)->name,
+ strlen((*compp)->name));
if(s) {
endpoint->comp = *compp;
return 0;
@@ -3876,6 +3892,7 @@ _libssh2_kex_exchange(LIBSSH2_SESSION *
session->local.kexinit = key_state->oldlocal;
session->local.kexinit_len = key_state->oldlocal_len;
key_state->state = libssh2_NB_state_idle;
+ session->state &= ~LIBSSH2_STATE_INITIAL_KEX;
session->state &= ~LIBSSH2_STATE_KEX_ACTIVE;
session->state &= ~LIBSSH2_STATE_EXCHANGING_KEYS;
return -1;
@@ -3901,6 +3918,7 @@ _libssh2_kex_exchange(LIBSSH2_SESSION *
session->local.kexinit = key_state->oldlocal;
session->local.kexinit_len = key_state->oldlocal_len;
key_state->state = libssh2_NB_state_idle;
+ session->state &= ~LIBSSH2_STATE_INITIAL_KEX;
session->state &= ~LIBSSH2_STATE_KEX_ACTIVE;
session->state &= ~LIBSSH2_STATE_EXCHANGING_KEYS;
return -1;
@@ -3949,6 +3967,7 @@ _libssh2_kex_exchange(LIBSSH2_SESSION *
session->remote.kexinit = NULL;
}
+ session->state &= ~LIBSSH2_STATE_INITIAL_KEX;
session->state &= ~LIBSSH2_STATE_KEX_ACTIVE;
session->state &= ~LIBSSH2_STATE_EXCHANGING_KEYS;
Index: libssh2-1.11.0/src/libssh2_priv.h
===================================================================
--- libssh2-1.11.0.orig/src/libssh2_priv.h
+++ libssh2-1.11.0/src/libssh2_priv.h
@@ -699,6 +699,9 @@ struct _LIBSSH2_SESSION
/* key signing algorithm preferences -- NULL yields server order */
char *sign_algo_prefs;
+ /* Whether to use the OpenSSH Strict KEX extension */
+ int kex_strict;
+
/* (remote as source of data -- packet_read ) */
libssh2_endpoint_data remote;
@@ -870,6 +873,7 @@ struct _LIBSSH2_SESSION
int fullpacket_macstate;
size_t fullpacket_payload_len;
int fullpacket_packet_type;
+ uint32_t fullpacket_required_type;
/* State variables used in libssh2_sftp_init() */
libssh2_nonblocking_states sftpInit_state;
@@ -910,10 +914,11 @@ struct _LIBSSH2_SESSION
};
/* session.state bits */
-#define LIBSSH2_STATE_EXCHANGING_KEYS 0x00000001
-#define LIBSSH2_STATE_NEWKEYS 0x00000002
-#define LIBSSH2_STATE_AUTHENTICATED 0x00000004
-#define LIBSSH2_STATE_KEX_ACTIVE 0x00000008
+#define LIBSSH2_STATE_INITIAL_KEX 0x00000001
+#define LIBSSH2_STATE_EXCHANGING_KEYS 0x00000002
+#define LIBSSH2_STATE_NEWKEYS 0x00000004
+#define LIBSSH2_STATE_AUTHENTICATED 0x00000008
+#define LIBSSH2_STATE_KEX_ACTIVE 0x00000010
/* session.flag helpers */
#ifdef MSG_NOSIGNAL
@@ -1144,6 +1149,11 @@ ssize_t _libssh2_send(libssh2_socket_t s
int _libssh2_kex_exchange(LIBSSH2_SESSION * session, int reexchange,
key_exchange_state_t * state);
+unsigned char *_libssh2_kex_agree_instr(unsigned char *haystack,
+ size_t haystack_len,
+ const unsigned char *needle,
+ size_t needle_len);
+
/* Let crypt.c/hostkey.c expose their method structs */
const LIBSSH2_CRYPT_METHOD **libssh2_crypt_methods(void);
const LIBSSH2_HOSTKEY_METHOD **libssh2_hostkey_methods(void);
Index: libssh2-1.11.0/src/packet.c
===================================================================
--- libssh2-1.11.0.orig/src/packet.c
+++ libssh2-1.11.0/src/packet.c
@@ -605,14 +605,13 @@ authagent_exit:
* layer when it has received a packet.
*
* The input pointer 'data' is pointing to allocated data that this function
- * is asked to deal with so on failure OR success, it must be freed fine.
- * The only exception is when the return code is LIBSSH2_ERROR_EAGAIN.
+ * will be freed unless return the code is LIBSSH2_ERROR_EAGAIN.
*
* This function will always be called with 'datalen' greater than zero.
*/
int
_libssh2_packet_add(LIBSSH2_SESSION * session, unsigned char *data,
- size_t datalen, int macstate)
+ size_t datalen, int macstate, uint32_t seq)
{
int rc = 0;
unsigned char *message = NULL;
@@ -657,6 +656,70 @@ _libssh2_packet_add(LIBSSH2_SESSION * se
break;
}
+ if(session->state & LIBSSH2_STATE_INITIAL_KEX) {
+ if(msg == SSH_MSG_KEXINIT) {
+ if(!session->kex_strict) {
+ if(datalen < 17) {
+ LIBSSH2_FREE(session, data);
+ session->packAdd_state = libssh2_NB_state_idle;
+ return _libssh2_error(session,
+ LIBSSH2_ERROR_BUFFER_TOO_SMALL,
+ "Data too short extracting kex");
+ }
+ else {
+ const unsigned char *strict =
+ (unsigned char *)"kex-strict-s-v00@openssh.com";
+ struct string_buf buf;
+ unsigned char *algs = NULL;
+ size_t algs_len = 0;
+
+ buf.data = (unsigned char *)data;
+ buf.dataptr = buf.data;
+ buf.len = datalen;
+ buf.dataptr += 17; /* advance past type and cookie */
+
+ if(_libssh2_get_string(&buf, &algs, &algs_len)) {
+ LIBSSH2_FREE(session, data);
+ session->packAdd_state = libssh2_NB_state_idle;
+ return _libssh2_error(session,
+ LIBSSH2_ERROR_BUFFER_TOO_SMALL,
+ "Algs too short");
+ }
+
+ if(algs_len == 0 ||
+ _libssh2_kex_agree_instr(algs, algs_len, strict, 28)) {
+ session->kex_strict = 1;
+ }
+ }
+ }
+
+ if(session->kex_strict && seq) {
+ LIBSSH2_FREE(session, data);
+ session->socket_state = LIBSSH2_SOCKET_DISCONNECTED;
+ session->packAdd_state = libssh2_NB_state_idle;
+ libssh2_session_disconnect(session, "strict KEX violation: "
+ "KEXINIT was not the first packet");
+
+ return _libssh2_error(session, LIBSSH2_ERROR_SOCKET_DISCONNECT,
+ "strict KEX violation: "
+ "KEXINIT was not the first packet");
+ }
+ }
+
+ if(session->kex_strict && session->fullpacket_required_type &&
+ session->fullpacket_required_type != msg) {
+ LIBSSH2_FREE(session, data);
+ session->socket_state = LIBSSH2_SOCKET_DISCONNECTED;
+ session->packAdd_state = libssh2_NB_state_idle;
+ libssh2_session_disconnect(session, "strict KEX violation: "
+ "unexpected packet type");
+
+ return _libssh2_error(session, LIBSSH2_ERROR_SOCKET_DISCONNECT,
+ "strict KEX violation: "
+ "unexpected packet type");
+ }
+ }
+
if(session->packAdd_state == libssh2_NB_state_allocated) {
/* A couple exceptions to the packet adding rule: */
switch(msg) {
@@ -1341,6 +1404,15 @@ _libssh2_packet_ask(LIBSSH2_SESSION * se
return 0;
}
+ else if(session->kex_strict &&
+ (session->state & LIBSSH2_STATE_INITIAL_KEX)) {
+ libssh2_session_disconnect(session, "strict KEX violation: "
+ "unexpected packet type");
+
+ return _libssh2_error(session, LIBSSH2_ERROR_SOCKET_DISCONNECT,
+ "strict KEX violation: "
+ "unexpected packet type");
+ }
packet = _libssh2_list_next(&packet->node);
}
return -1;
@@ -1402,7 +1474,10 @@ _libssh2_packet_require(LIBSSH2_SESSION
}
while(session->socket_state == LIBSSH2_SOCKET_CONNECTED) {
- int ret = _libssh2_transport_read(session);
+ int ret;
+ session->fullpacket_required_type = packet_type;
+ ret = _libssh2_transport_read(session);
+ session->fullpacket_required_type = 0;
if(ret == LIBSSH2_ERROR_EAGAIN)
return ret;
else if(ret < 0) {
Index: libssh2-1.11.0/src/packet.h
===================================================================
--- libssh2-1.11.0.orig/src/packet.h
+++ libssh2-1.11.0/src/packet.h
@@ -71,6 +71,6 @@ int _libssh2_packet_burn(LIBSSH2_SESSION
int _libssh2_packet_write(LIBSSH2_SESSION * session, unsigned char *data,
unsigned long data_len);
int _libssh2_packet_add(LIBSSH2_SESSION * session, unsigned char *data,
- size_t datalen, int macstate);
+ size_t datalen, int macstate, uint32_t seq);
#endif /* __LIBSSH2_PACKET_H */
Index: libssh2-1.11.0/src/session.c
===================================================================
--- libssh2-1.11.0.orig/src/session.c
+++ libssh2-1.11.0/src/session.c
@@ -464,6 +464,8 @@ libssh2_session_init_ex(LIBSSH2_ALLOC_FU
session->abstract = abstract;
session->api_timeout = 0; /* timeout-free API by default */
session->api_block_mode = 1; /* blocking API by default */
+ session->state = LIBSSH2_STATE_INITIAL_KEX;
+ session->fullpacket_required_type = 0;
session->packet_read_timeout = LIBSSH2_DEFAULT_READ_TIMEOUT;
session->flag.quote_paths = 1; /* default behavior is to quote paths
for the scp subsystem */
@@ -1186,6 +1188,7 @@ libssh2_session_disconnect_ex(LIBSSH2_SE
const char *desc, const char *lang)
{
int rc;
+ session->state &= ~LIBSSH2_STATE_INITIAL_KEX;
session->state &= ~LIBSSH2_STATE_EXCHANGING_KEYS;
BLOCK_ADJUST(rc, session,
session_disconnect(session, reason, desc, lang));
Index: libssh2-1.11.0/src/transport.c
===================================================================
--- libssh2-1.11.0.orig/src/transport.c
+++ libssh2-1.11.0/src/transport.c
@@ -187,6 +187,7 @@ fullpacket(LIBSSH2_SESSION * session, in
struct transportpacket *p = &session->packet;
int rc;
int compressed;
+ uint32_t seq = session->remote.seqno;
if(session->fullpacket_state == libssh2_NB_state_idle) {
session->fullpacket_macstate = LIBSSH2_MAC_CONFIRMED;
@@ -318,7 +319,7 @@ fullpacket(LIBSSH2_SESSION * session, in
if(session->fullpacket_state == libssh2_NB_state_created) {
rc = _libssh2_packet_add(session, p->payload,
session->fullpacket_payload_len,
- session->fullpacket_macstate);
+ session->fullpacket_macstate, seq);
if(rc == LIBSSH2_ERROR_EAGAIN)
return rc;
if(rc) {
@@ -329,6 +330,11 @@ fullpacket(LIBSSH2_SESSION * session, in
session->fullpacket_state = libssh2_NB_state_idle;
+ if(session->kex_strict &&
+ session->fullpacket_packet_type == SSH_MSG_NEWKEYS) {
+ session->remote.seqno = 0;
+ }
+
return session->fullpacket_packet_type;
}
@@ -1091,6 +1097,10 @@ int _libssh2_transport_send(LIBSSH2_SESS
session->local.seqno++;
+ if(session->kex_strict && data[0] == SSH_MSG_NEWKEYS) {
+ session->local.seqno = 0;
+ }
+
ret = LIBSSH2_SEND(session, p->outbuf, total_length,
LIBSSH2_SOCKET_SEND_FLAGS(session));
if(ret < 0)

View File

@@ -1,26 +0,0 @@
From bde10825f1271769d56a0e99793da61d37abc23c Mon Sep 17 00:00:00 2001
From: Josef Cejka <jcejka@suse.com>
Date: Thu, 28 Mar 2024 23:38:47 +0100
Subject: [PATCH] transport: check ETM on remote end when receiving (#1332)
We should check if encrypt-then-MAC feature is enabled in remote end's
configuration.
Fixes #1331
---
src/transport.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/transport.c b/src/transport.c
index 531f5aa15a..af175d3fa1 100644
--- a/src/transport.c
+++ b/src/transport.c
@@ -425,7 +425,7 @@ int _libssh2_transport_read(LIBSSH2_SESSION * session)
make the checks below work fine still */
}
- etm = encrypted && session->local.mac ? session->local.mac->etm : 0;
+ etm = encrypted && session->remote.mac ? session->remote.mac->etm : 0;
/* read/use a whole big chunk into a temporary area stored in
the LIBSSH2_SESSION struct. We will decrypt data from that