xrtSshKexExchangeInit
使用同一动态缓冲池初始化连接级 KEX 交换对象;空池使用全局分配器。
| 参数 | 说明 |
|---|---|
| xsshkexexchange* pExchange | 交换对象 |
| xnetbufpool* pPool | 池 |
| xsshrole Role | 本地角色 |
示例已编译验证
sshkexexchangeinit obj; xrtSshKexExchangeInit(&obj, pExchange, pPool, Role);
xrtSshKexExchangeClear
释放全部 transcript 动态块,并安全清除 KEX 密钥和 SessionId。
| 参数 | 说明 |
|---|---|
| xsshkexexchange* pExchange | 交换对象 |
示例已编译验证
/* 释放全部 transcript 动态块,并安全清除 KEX 密钥和 SessionId。 */ result = xrtSshKexExchangeClear(pExchange);
xrtSshKexExchangeVersionPrepare
XRT_API xsshcode xrtSshKexExchangeVersionPrepare( xsshkexexchange* pExchange, const xsshtransportcore* pCore, xsshtransportdirection Direction, xstrview Version );
示例已编译验证
/* XRT_API xsshcode xrtSshKexExchangeVersionPrepare( xsshkexexchange* pExchange, const xsshtransportcore* pCore, xsshtransportdirection Direction, xstrview Version ); */ result = xrtSshKexExchangeVersionPrepare();
xrtSshKexExchangeVersionCommit
transport 已提交对应 identification 后,发布连接级稳定版本串。
| 参数 | 说明 |
|---|---|
| xsshkexexchange* pExchange | 交换对象 |
| const xsshtransportcore* pCore | 核心对象 |
示例已编译验证
/* transport 已提交对应 identification 后,发布连接级稳定版本串。 */ result = xrtSshKexExchangeVersionCommit(pExchange, pCore);
xrtSshKexExchangeVersionAbort
transport 尚未提交对应 identification 时放弃暂存副本。
| 参数 | 说明 |
|---|---|
| xsshkexexchange* pExchange | 交换对象 |
| const xsshtransportcore* pCore | 核心对象 |
示例已编译验证
/* transport 尚未提交对应 identification 时放弃暂存副本。 */ result = xrtSshKexExchangeVersionAbort(pExchange, pCore);
xrtSshKexExchangeKexInitPrepare
XRT_API xsshcode xrtSshKexExchangeKexInitPrepare( xsshkexexchange* pExchange, const xsshtransportcore* pCore, xsshtransportdirection Direction, xbytesview Payload );
示例已编译验证
sshkexexchangekexinitprepare obj; xrtSshKexExchangeKexInitPrepare(&obj);
xrtSshKexExchangeKexInitCommit
transport 已提交同一方向和 packet 序号后,发布本代 KEXINIT。
| 参数 | 说明 |
|---|---|
| xsshkexexchange* pExchange | 交换对象 |
| const xsshtransportcore* pCore | 核心对象 |
示例已编译验证
sshkexexchangekexinitcommit obj; xrtSshKexExchangeKexInitCommit(&obj, pExchange, pCore);
xrtSshKexExchangeKexInitAbort
transport 状态和 packet 计数尚未推进时放弃暂存 KEXINIT。
| 参数 | 说明 |
|---|---|
| xsshkexexchange* pExchange | 交换对象 |
| const xsshtransportcore* pCore | 核心对象 |
示例已编译验证
sshkexexchangekexinitabort obj; xrtSshKexExchangeKexInitAbort(&obj, pExchange, pCore);
xrtSshKexExchangeReady
判断版本串、双方 KEXINIT 与 transport 状态是否可以开始本代方法交换。
| 参数 | 说明 |
|---|---|
| const xsshkexexchange* pExchange | 交换对象 |
| const xsshtransportcore* pCore | 核心对象 |
示例已编译验证
/* 判断版本串、双方 KEXINIT 与 transport 状态是否可以开始本代方法交换。 */ result = xrtSshKexExchangeReady(pExchange, pCore);
xrtSshKexExchangeTranscript
返回 READY、METHOD 或 COMPLETE 阶段的稳定 transcript 借用视图。
| 参数 | 说明 |
|---|---|
| xsshkexexchange* pExchange | 交换对象 |
| xsshkextranscript* pTranscript | Transcrt 参数 |
示例已编译验证
/* 返回 READY、METHOD 或 COMPLETE 阶段的稳定 transcript 借用视图。 */ result = xrtSshKexExchangeTranscript(pExchange, pTranscript);
xrtSshKexExchangeBeginWithPrivate
使用显式 Curve25519 私钥开始本代 KEX,并在成功后晋升下一代动态缓冲。
| 参数 | 说明 |
|---|---|
| xsshkexexchange* pExchange | 交换对象 |
| xsshtransportcore* pCore | 核心对象 |
| xbytesview ServerHostKey | ServerHostKey 参数 |
| xbytesview PrivateKey | PrvateKey 参数 |
示例已编译验证
/* 使用显式 Curve25519 私钥开始本代 KEX,并在成功后晋升下一代动态缓冲。 */ result = xrtSshKexExchangeBeginWithPrivate(pExchange, pCore, ServerHostKey, PrivateKey);
xrtSshKexExchangeSession
返回 METHOD 或 COMPLETE 阶段可推进的 KEX 会话。
| 参数 | 说明 |
|---|---|
| xsshkexexchange* pExchange | 交换对象 |
示例已编译验证
/* 返回 METHOD 或 COMPLETE 阶段可推进的 KEX 会话。 */ result = xrtSshKexExchangeSession(pExchange);
xrtSshKexExchangeSessionConst
返回 METHOD 或 COMPLETE 阶段的只读 KEX 会话。
| 参数 | 说明 |
|---|---|
| const xsshkexexchange* pExchange | 交换对象 |
示例已编译验证
/* 返回 METHOD 或 COMPLETE 阶段的只读 KEX 会话。 */ result = xrtSshKexExchangeSessionConst(pExchange);
xrtSshKexExchangeComplete
确认 KEX 会话和 transport 均已完成本代双向密钥切换。
| 参数 | 说明 |
|---|---|
| xsshkexexchange* pExchange | 交换对象 |
| const xsshtransportcore* pCore | 核心对象 |
示例已编译验证
/* 确认 KEX 会话和 transport 均已完成本代双向密钥切换。 */ result = xrtSshKexExchangeComplete(pExchange, pCore);
xrtSshKexExchangeFail
终止交换,放弃未发布的下一代材料并清除本代临时秘密。
| 参数 | 说明 |
|---|---|
| xsshkexexchange* pExchange | 交换对象 |
示例已编译验证
/* 终止交换,放弃未发布的下一代材料并清除本代临时秘密。 */ result = xrtSshKexExchangeFail(pExchange);