mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-12-02 01:17:52 +03:00
session: add getters for session cipher names
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
committed by
Andreas Schneider
parent
22d6c36800
commit
93370d61ba
@@ -642,6 +642,8 @@ LIBSSH_API int ssh_event_remove_session(ssh_event event, ssh_session session);
|
|||||||
LIBSSH_API void ssh_event_free(ssh_event event);
|
LIBSSH_API void ssh_event_free(ssh_event event);
|
||||||
LIBSSH_API const char* ssh_get_clientbanner(ssh_session session);
|
LIBSSH_API const char* ssh_get_clientbanner(ssh_session session);
|
||||||
LIBSSH_API const char* ssh_get_serverbanner(ssh_session session);
|
LIBSSH_API const char* ssh_get_serverbanner(ssh_session session);
|
||||||
|
LIBSSH_API const char* ssh_get_cipher_in(ssh_session session);
|
||||||
|
LIBSSH_API const char* ssh_get_cipher_out(ssh_session session);
|
||||||
|
|
||||||
#ifndef LIBSSH_LEGACY_0_4
|
#ifndef LIBSSH_LEGACY_0_4
|
||||||
#include "libssh/legacy.h"
|
#include "libssh/legacy.h"
|
||||||
|
|||||||
@@ -309,6 +309,38 @@ const char* ssh_get_serverbanner(ssh_session session) {
|
|||||||
return session->serverbanner;
|
return session->serverbanner;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief get the name of the input for the given session.
|
||||||
|
*
|
||||||
|
* @param[in] session The SSH session.
|
||||||
|
*
|
||||||
|
* @return Returns cipher name or NULL.
|
||||||
|
*/
|
||||||
|
const char* ssh_get_cipher_in(ssh_session session) {
|
||||||
|
if ((session != NULL) &&
|
||||||
|
(session->current_crypto != NULL) &&
|
||||||
|
(session->current_crypto->in_cipher != NULL)) {
|
||||||
|
return session->current_crypto->in_cipher->name;
|
||||||
|
}
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief get the name of the output cipher for the given session.
|
||||||
|
*
|
||||||
|
* @param[in] session The SSH session.
|
||||||
|
*
|
||||||
|
* @return Returns cipher name or NULL.
|
||||||
|
*/
|
||||||
|
const char* ssh_get_cipher_out(ssh_session session) {
|
||||||
|
if ((session != NULL) &&
|
||||||
|
(session->current_crypto != NULL) &&
|
||||||
|
(session->current_crypto->out_cipher != NULL)) {
|
||||||
|
return session->current_crypto->out_cipher->name;
|
||||||
|
}
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Disconnect impolitely from a remote host by closing the socket.
|
* @brief Disconnect impolitely from a remote host by closing the socket.
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user