diff options
| author | Jon Simons <jon@jonsimons.org> | 2014-02-03 22:37:25 -0800 |
|---|---|---|
| committer | Andreas Schneider <asn@cryptomilk.org> | 2014-02-06 11:13:20 +0100 |
| commit | 13f4e31ad1c83045635417ee7c58fdf384a1bb97 (patch) | |
| tree | f796c4bc4ac0bf7c635cce74f8c680cd61b9d589 /src | |
| parent | da5fa4ef66ae97dfab36c9d67f156fcc234af30c (diff) | |
session: add getters for session cipher names
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'src')
| -rw-r--r-- | src/session.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/session.c b/src/session.c index 4d63a19d..01b540f6 100644 --- a/src/session.c +++ b/src/session.c @@ -310,6 +310,38 @@ const char* ssh_get_serverbanner(ssh_session session) { } /** + * @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. * * Suitable if you forked and want to destroy this session. |
