Skip to content

Commit

Permalink
Do not use "bytes" for a variable name
Browse files Browse the repository at this point in the history
"bytes" is a builtin Python 3 class name.
  • Loading branch information
LudovicRousseau committed Sep 9, 2024
1 parent ca8f657 commit 7ca36e5
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions smartcard/doc/user-guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1375,19 +1375,19 @@ cyphered and each response APDU is uncyphered:
def __init__(self, cardconnection):
CardConnectionDecorator.__init__(self, cardconnection)

def cypher(self, bytes):
def cypher(self, data):
'''Cypher mock-up; you would include the secure channel logics here.'''
print('cyphering', toHexString(bytes))
return bytes
print('cyphering', toHexString(data))
return data

def uncypher(self, data):
'''Uncypher mock-up; you would include the secure channel logics here.'''
print('uncyphering', toHexString(data))
return data

def transmit(self, bytes, protocol=None):
def transmit(self, data, protocol=None):
"""Cypher/uncypher APDUs before transmission"""
cypheredbytes = self.cypher(bytes)
cypheredbytes = self.cypher(data)
data, sw1, sw2 = CardConnectionDecorator.transmit(self, cypheredbytes, protocol)
if [] != data:
data = self.uncypher(data)
Expand Down

0 comments on commit 7ca36e5

Please sign in to comment.