aboutsummaryrefslogtreecommitdiff
path: root/src/wrapper.c
diff options
context:
space:
mode:
authorDirkjan Bussink <d.bussink@gmail.com>2014-04-20 10:09:39 +0000
committerAndreas Schneider <asn@cryptomilk.org>2014-04-22 10:57:18 +0200
commit6c74d6f891bab99f68fffdb78dec66de369898c7 (patch)
tree3873f820ee92ef9e6696ac27d63590e6b2ceb3f6 /src/wrapper.c
parent262c82ac0661bb0be46477006ed366e401c1620f (diff)
downloadlibssh-6c74d6f891bab99f68fffdb78dec66de369898c7.tar.gz
libssh-6c74d6f891bab99f68fffdb78dec66de369898c7.tar.xz
libssh-6c74d6f891bab99f68fffdb78dec66de369898c7.zip
Add options support for setting and getting HMAC algorithms
BUG: https://red.libssh.org/issues/91 Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'src/wrapper.c')
-rw-r--r--src/wrapper.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/wrapper.c b/src/wrapper.c
index c8dab5a8..f2f0b6ad 100644
--- a/src/wrapper.c
+++ b/src/wrapper.c
@@ -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;