diff options
Diffstat (limited to 'lib/cipher_int.c')
-rw-r--r-- | lib/cipher_int.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/cipher_int.c b/lib/cipher_int.c index 058fe7a6f8..e01157cde1 100644 --- a/lib/cipher_int.c +++ b/lib/cipher_int.c @@ -110,8 +110,15 @@ _gnutls_cipher_init(cipher_hd_st *handle, const cipher_entry_st *e, SR_FB(cc->setkey(handle->handle, key->data, key->size), cc_cleanup); if (iv) { - if (unlikely(cc->setiv == NULL)) /* the API doesn't accept IV */ + /* the API doesn't accept IV */ + if (unlikely(cc->setiv == NULL)) { + if (cc->aead_encrypt) { + if (handle->handle) + handle->deinit(handle->handle); + goto fallback; + } return gnutls_assert_val(GNUTLS_E_INVALID_REQUEST); + } SR(cc->setiv(handle->handle, iv->data, iv->size), cc_cleanup); } |