0bab3bd91b3d889bbcb3cab481173f438d271010
[tinc] / src / cipher.c
1 #include "cipher.h"
2 #include "xalloc.h"
3
4 #ifndef DISABLE_LEGACY
5
6 cipher_t *cipher_alloc() {
7         return xzalloc(sizeof(cipher_t));
8 }
9
10 void cipher_free(cipher_t **cipher) {
11         if(cipher && *cipher) {
12                 cipher_close(*cipher);
13                 free(*cipher);
14                 *cipher = NULL;
15         }
16 }
17
18 #endif // DISABLE_LEGACY