summaryrefslogtreecommitdiff
path: root/cipher/mac.c
diff options
context:
space:
mode:
authorDmitry Eremin-Solenikov <dbaryshkov@gmail.com>2013-12-27 12:37:11 +0400
committerWerner Koch <wk@gnupg.org>2014-01-13 10:40:30 +0100
commit8439a379c86ef1088465ea70ac10840759a1638e (patch)
treedda6a6addc52283111b88105e693203d405ff059 /cipher/mac.c
parent36c9e0e4eb4f935da90df1c8df484d1940bda5eb (diff)
downloadlibgcrypt-8439a379c86ef1088465ea70ac10840759a1638e.tar.gz
Add a function to retrieve algorithm used by MAC handler
* cipher/mac.c (_gcry_mac_get_algo): New function, returns used algo. * src/visibility.c (gcry_mac_get_algo): New wrapper. * src/visibility.h: Hanlde gcry_mac_get_algo. * src/gcrypt-int.h (_gcry_mac_get_algo): New. * src/gcrypt.h.in (gcry_mac_get_algo): New. * src/libgcrypt.def (gcry_mac_get_algo): New. * src/libgcrypt.vers (gcry_mac_get_algo): New. * doc/gcrypt.texi: Document gcry_mac_get_algo. * tests/basic.c (check_one_mac): Verify gcry_mac_get_algo. Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Diffstat (limited to 'cipher/mac.c')
-rw-r--r--cipher/mac.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/cipher/mac.c b/cipher/mac.c
index 3daf2ee3..7805467a 100644
--- a/cipher/mac.c
+++ b/cipher/mac.c
@@ -369,6 +369,13 @@ _gcry_mac_verify (gcry_mac_hd_t hd, const void *buf, size_t buflen)
}
+int
+_gcry_mac_get_algo (gcry_mac_hd_t hd)
+{
+ return hd->algo;
+}
+
+
unsigned int
_gcry_mac_get_algo_maclen (int algo)
{