summaryrefslogtreecommitdiff
path: root/lib/cipher_int.c
diff options
context:
space:
mode:
authorDaiki Ueno <dueno@redhat.com>2019-04-30 14:42:51 +0200
committerDaiki Ueno <dueno@redhat.com>2019-05-03 13:59:23 +0200
commit1401ff434fffe4420e35d996f08d52ecac41d133 (patch)
treeb60a9b9de4ea99ce635352cacf4437113913909f /lib/cipher_int.c
parentd0571e0e934557f5fb0683cd52295b077f2969aa (diff)
downloadgnutls-tmp-getiv.tar.gz
crypto: add private API to retrieve internal IVtmp-getiv
For FIPS validation purposes, this adds a new function _gnutls_cipher_get_iv() that exposes internal IV after encryption and decryption. The function is not generally useful because the IV value can be easily calculated from the initial IV and the subsequent ciphertext but for FIPS validation purposes. Signed-off-by: Daiki Ueno <dueno@redhat.com>
Diffstat (limited to 'lib/cipher_int.c')
-rw-r--r--lib/cipher_int.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/cipher_int.c b/lib/cipher_int.c
index c6032ff053..40bf64f8bc 100644
--- a/lib/cipher_int.c
+++ b/lib/cipher_int.c
@@ -101,6 +101,7 @@ _gnutls_cipher_init(cipher_hd_st *handle, const cipher_entry_st *e,
handle->auth = cc->auth;
handle->tag = cc->tag;
handle->setiv = cc->setiv;
+ handle->getiv = cc->getiv;
/* if cc->init() returns GNUTLS_E_NEED_FALLBACK we
* use the default ciphers */
@@ -126,6 +127,7 @@ _gnutls_cipher_init(cipher_hd_st *handle, const cipher_entry_st *e,
handle->auth = _gnutls_cipher_ops.auth;
handle->tag = _gnutls_cipher_ops.tag;
handle->setiv = _gnutls_cipher_ops.setiv;
+ handle->getiv = _gnutls_cipher_ops.getiv;
/* otherwise use generic cipher interface
*/