1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-11-30 13:01:23 +03:00

Add options support for setting and getting HMAC algorithms

BUG: https://red.libssh.org/issues/91

Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
Dirkjan Bussink
2014-04-20 10:09:39 +00:00
committed by Andreas Schneider
parent 262c82ac06
commit 6c74d6f891
5 changed files with 66 additions and 1 deletions

View File

@@ -311,7 +311,7 @@ const char* ssh_get_serverbanner(ssh_session session) {
}
/**
* @brief get the name of the input for the given session.
* @brief get the name of the input cipher for the given session.
*
* @param[in] session The SSH session.
*
@@ -342,6 +342,36 @@ const char* ssh_get_cipher_out(ssh_session session) {
return NULL;
}
/**
* @brief get the name of the input HMAC algorithm for the given session.
*
* @param[in] session The SSH session.
*
* @return Returns HMAC algorithm name or NULL if unknown.
*/
const char* ssh_get_hmac_in(ssh_session session) {
if ((session != NULL) &&
(session->current_crypto != NULL)) {
return ssh_hmac_type_to_string(session->current_crypto->in_hmac);
}
return NULL;
}
/**
* @brief get the name of the output HMAC algorithm for the given session.
*
* @param[in] session The SSH session.
*
* @return Returns HMAC algorithm name or NULL if unknown.
*/
const char* ssh_get_hmac_out(ssh_session session) {
if ((session != NULL) &&
(session->current_crypto != NULL)) {
return ssh_hmac_type_to_string(session->current_crypto->out_hmac);
}
return NULL;
}
/**
* @brief Disconnect impolitely from a remote host by closing the socket.
*