Skip to content

Commit

Permalink
improve getting the seed in cond_unlock
Browse files Browse the repository at this point in the history
  • Loading branch information
danielhrisca committed Feb 29, 2024
1 parent 60f0c59 commit f6d68e2
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions pyxcp/master/master.py
Original file line number Diff line number Diff line change
Expand Up @@ -1790,12 +1790,13 @@ def cond_unlock(self, resources=None):
length = result.length
if length == 0:
continue
if length > MAX_PAYLOAD:
remaining = length - len(seed)
while remaining > 0:
result = self.getSeed(types.XcpGetSeedMode.REMAINING, resource_value)
seed.extend(list(result.seed))
remaining = result.length

while length - len(seed) > 0:
result = self.getSeed(types.XcpGetSeedMode.REMAINING, resource_value)
seed.extend(list(result.seed))

seed = seed[: length] # maybe there are some padding bytes

result, key = getKey(
self.logger,
self.seedNKeyDLL,
Expand Down

0 comments on commit f6d68e2

Please sign in to comment.