1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-12-12 15:41:16 +03:00

Add ssh_send_issue_banner() API

Signed-off-by: Seung Min Park <smpark@pnpsecure.com>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
Seung Min Park
2022-06-16 13:59:46 +09:00
committed by Andreas Schneider
parent 332f1c2e09
commit 4978f30320
6 changed files with 101 additions and 0 deletions

View File

@@ -524,6 +524,30 @@ void ssh_set_auth_methods(ssh_session session, int auth_methods)
session->auth.supported_methods = (uint32_t)auth_methods & 0x3fU;
}
int ssh_send_issue_banner(ssh_session session, const ssh_string banner)
{
int rc = SSH_ERROR;
if (session == NULL) {
return SSH_ERROR;
}
SSH_LOG(SSH_LOG_PACKET,
"Sending a server issue banner");
rc = ssh_buffer_pack(session->out_buffer,
"bS",
SSH2_MSG_USERAUTH_BANNER,
banner);
if (rc != SSH_OK) {
ssh_set_error_oom(session);
return SSH_ERROR;
}
rc = ssh_packet_send(session);
return rc;
}
/* Do the banner and key exchange */
int ssh_handle_key_exchange(ssh_session session) {
int rc;