siv: deinit gnutls on unsupported SIV
This commit is contained in:
parent
0ad5f5ea89
commit
70a0f18d52
1 changed files with 4 additions and 1 deletions
|
@ -102,8 +102,11 @@ SIV_CreateInstance(SIV_Algorithm algorithm)
|
|||
init_gnutls();
|
||||
|
||||
/* Check if the cipher is actually supported */
|
||||
if (gnutls_cipher_get_tag_size(calgo) == 0)
|
||||
if (gnutls_cipher_get_tag_size(calgo) == 0) {
|
||||
if (instance_counter == 0)
|
||||
deinit_gnutls();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
instance = MallocNew(struct SIV_Instance_Record);
|
||||
instance->algorithm = calgo;
|
||||
|
|
Loading…
Reference in a new issue