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:
committed by
Andreas Schneider
parent
332f1c2e09
commit
4978f30320
24
src/server.c
24
src/server.c
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user