Skip to content

fix(crypto): SHA256 认证默认使用 JDBC 兼容的 2048 迭代数 - #28

Merged
853749458 merged 2 commits into
huaweicloud-samples:masterfrom
Brambledd:master
Sep 18, 2026
Merged

853749458 merged 2 commits into
huaweicloud-samples:masterfrom
Brambledd:master

Conversation

@Brambledd

Copy link
Copy Markdown

Brambledd and others added 2 commits September 18, 2026 14:51
GaussDB authType=10 的 SHA256 认证中,服务器即使报文携带 iteration=10000,实际仍以 2048 次迭代校验 proof;官方 JDBC 驱动对协议 3.0/3.50 客户端硬编码 2048(ConnectionFactoryImpl.server_iteration_350)。旧实现无条件信任报文值,导致 ClientProof 计算错误,登录被拒(28P01 用户名或密码不合法),而相同密码经 JDBC 可正常登录。

新增 sha256Iterations 连接参数:默认 2048 对齐 JDBC;设为 'server' 时信任报文值(等价 JDBC 3.51 行为);支持连接串与 GAUSSSHA256ITERATIONS 环境变量,非法取值抛 RangeError。补充单元测试覆盖默认值、'server' 模式、自定义值、边界校验及参数传递链路。
fix(crypto): SHA256 认证默认使用 JDBC 兼容的 2048 迭代数
@853749458
853749458 merged commit 7c7e502 into huaweicloud-samples:master Sep 18, 2026
1 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants