Skip to content

Commit 3571684

Browse files
committed
Add AesGcmStream destructor with wc_AesFree
1 parent 2534d61 commit 3571684

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

scripts/build_ffi.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -649,6 +649,7 @@ def build_ffi(local_wolfssl, features):
649649
word32 sz, const byte* authIn, word32 authInSz);
650650
int wc_AesGcmDecryptFinal(Aes* aes, const byte* authTag,
651651
word32 authTagSz);
652+
void wc_AesFree(Aes* aes);
652653
"""
653654

654655
if features["AES"] and features["AES_SIV"]:

wolfcrypt/ciphers.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,9 @@ def __init__(self, key, IV, tag_bytes=16):
415415
if ret < 0:
416416
raise WolfCryptError("Init error (%d)" % ret)
417417

418+
def __del__(self):
419+
_lib.wc_AesFree(self._native_object)
420+
418421
def set_aad(self, data):
419422
"""
420423
Set the additional authentication data for the stream

0 commit comments

Comments
 (0)