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

Add flag for tracking EtM HMACs

This adds a flag to the type structures to track if we use a
Encrypt-then-MAC cipher instead of Encrypt-and-MAC. EtM is a more secure
hashing mechanism.

Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com>
Reviewed-by: Jon Simons <jon@jonsimons.org>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
This commit is contained in:
Dirkjan Bussink
2019-02-08 19:44:36 +00:00
committed by Andreas Schneider
parent c6608c9211
commit e4c7912b35
4 changed files with 23 additions and 12 deletions

View File

@@ -419,7 +419,7 @@ const char* ssh_get_cipher_out(ssh_session session) {
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 ssh_hmac_type_to_string(session->current_crypto->in_hmac, session->current_crypto->in_hmac_etm);
}
return NULL;
}
@@ -434,7 +434,7 @@ const char* ssh_get_hmac_in(ssh_session session) {
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 ssh_hmac_type_to_string(session->current_crypto->out_hmac, session->current_crypto->out_hmac_etm);
}
return NULL;
}