9 Star 0 Fork 19

src-openEuler/libssh2

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-session-support-server-banners-up-to-8192-bytes-was-256.patch 1.22 KB
一键复制 编辑 原始数据 按行查看 历史
bitianyuan 提交于 2024-11-06 15:51 . backport some upstream patches
From 1a9e8811f7fa7538a52e2dd0150a094368471bf3 Mon Sep 17 00:00:00 2001
From: Anders Borum <[email protected]>
Date: Tue, 8 Oct 2024 08:11:02 +0200
Subject: [PATCH] session: support server banners up to 8192 bytes (was: 256)
If server had banner exceeding 256 bytes there wasn't enough room in
`_LIBSSH2_SESSION.banner_TxRx_banner`. Only the first 256 bytes would be
read making the first packet read fail but also dooming key exchange as
`session->remote.banner` didn't include everything.
This change bumps the banner buffer to 8KB to match OpenSSH.
Fixes #1442
Closes #1443
Reference:https://github.com/libssh2/libssh2/commit/1a9e8811f7fa7538a52e2dd0150a094368471bf3
Conflict:NA
---
src/libssh2_priv.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/libssh2_priv.h b/src/libssh2_priv.h
index ee1d8b5..b1f32b1 100644
--- a/src/libssh2_priv.h
+++ b/src/libssh2_priv.h
@@ -742,7 +742,7 @@ struct _LIBSSH2_SESSION
/* State variables used in libssh2_banner_send() */
libssh2_nonblocking_states banner_TxRx_state;
- char banner_TxRx_banner[256];
+ char banner_TxRx_banner[8192];
ssize_t banner_TxRx_total_send;
/* State variables used in libssh2_kexinit() */
--
2.43.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-openeuler/libssh2.git
[email protected]:src-openeuler/libssh2.git
src-openeuler
libssh2
libssh2
master

搜索帮助