add more buffer clearing
This commit is contained in:
parent
5ef6a844d6
commit
0ec6a65858
1 changed files with 7 additions and 1 deletions
|
@ -283,7 +283,12 @@ class InboundGroupSession(object):
|
||||||
message_index
|
message_index
|
||||||
)
|
)
|
||||||
self._check_error(ret)
|
self._check_error(ret)
|
||||||
return bytes_to_native_str(ffi.unpack(export_buffer, export_length))
|
export_str = bytes_to_native_str(ffi.unpack(export_buffer, export_length))
|
||||||
|
|
||||||
|
# clear out copies of the key
|
||||||
|
lib.memset(export_buffer, 0, export_length)
|
||||||
|
|
||||||
|
return export_str
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def import_session(cls, session_key):
|
def import_session(cls, session_key):
|
||||||
|
@ -313,6 +318,7 @@ class InboundGroupSession(object):
|
||||||
)
|
)
|
||||||
obj._check_error(ret)
|
obj._check_error(ret)
|
||||||
finally:
|
finally:
|
||||||
|
# clear out copies of the key
|
||||||
if byte_session_key is not session_key:
|
if byte_session_key is not session_key:
|
||||||
for i in range(0, len(byte_session_key)):
|
for i in range(0, len(byte_session_key)):
|
||||||
byte_session_key[i] = 0
|
byte_session_key[i] = 0
|
||||||
|
|
Loading…
Reference in a new issue