Skip to content

Commit

Permalink
Swap EncryptData cast
Browse files Browse the repository at this point in the history
  • Loading branch information
astraw38 authored Jun 8, 2020
1 parent 863acf7 commit 9609353
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pycryptoki/mechanism/aes.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def to_c_mech(self):
# Note: data should be a multiple of 16 long.
params = CK_KEY_DERIVATION_STRING_DATA()
pdata, data_len = to_byte_array(self.params["data"])
params.pData = cast(pdata, c_void_p)
params.pData = cast(pdata, CK_BYTE_PTR)
params.ulLen = CK_ULONG(data_len)
self.mech.pParameter = cast(pointer(params), c_void_p)
self.mech.usParameterLen = CK_ULONG(sizeof(params))
Expand Down Expand Up @@ -182,7 +182,7 @@ def to_c_mech(self):
pdata, data_len = to_byte_array(self.params["data"])
# Note: IV should always be a length of 8.
p_iv, _ = to_byte_array(self.params["iv"])
params.pData = cast(pdata, c_void_p)
params.pData = cast(pdata, CK_BYTE_PTR)
params.ulLen = CK_ULONG(data_len)
params.iv = p_iv
self.mech.pParameter = cast(pointer(params), c_void_p)
Expand Down

0 comments on commit 9609353

Please sign in to comment.