1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-11-27 13:21:11 +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

@@ -78,6 +78,16 @@ size_t hmac_digest_len(enum ssh_hmac_e type) {
}
}
const char *ssh_hmac_type_to_string(enum ssh_hmac_e hmac_type)
{
int i = 0;
struct ssh_hmac_struct *ssh_hmactab = ssh_get_hmactab();
while (ssh_hmactab[i].name && (ssh_hmactab[i].hmac_type != hmac_type)) {
i++;
}
return ssh_hmactab[i].name;
}
/* it allocates a new cipher structure based on its offset into the global table */
static struct ssh_cipher_struct *cipher_new(int offset) {
struct ssh_cipher_struct *cipher = NULL;