From fe6c2c7f31c3a7a3241812d2f7f37fdf37183a89 Mon Sep 17 00:00:00 2001 From: oepen Date: Thu, 1 Sep 2011 14:30:21 +0000 Subject: [PATCH] Make pylint happy git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@513 96b47cad-a561-4643-ad3b-153ac7d7599c --- .../src/vpicc/virtualsmartcard/cards/ePass.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/virtualsmartcard/src/vpicc/virtualsmartcard/cards/ePass.py b/virtualsmartcard/src/vpicc/virtualsmartcard/cards/ePass.py index 76547bb..8ba7a68 100644 --- a/virtualsmartcard/src/vpicc/virtualsmartcard/cards/ePass.py +++ b/virtualsmartcard/src/vpicc/virtualsmartcard/cards/ePass.py @@ -77,12 +77,13 @@ class PassportSAM(SAM): """ MRZ_information = self.mrz2[0:10] + self.mrz2[13:20] + self.mrz2[21:28] - H = hashlib.sha1(MRZ_information).digest() + H = hashlib.sha1(MRZ_information).digest() #pylint: disable=E1101 self.KSeed = H[:16] self.KEnc = self.derive_key(self.KSeed, 1) self.KMac = self.derive_key(self.KSeed, 2) - def derive_key(self, seed, c): + @staticmethod + def derive_key(seed, c): """ Derive a key according to TR-PKI mrtds ICC read-only access v1.1 annex E.1. @@ -90,7 +91,7 @@ class PassportSAM(SAM): Returns: Ka + Kb Note: Does not adjust parity. Nobody uses that anyway ...""" D = seed + struct.pack(">i", c) - H = hashlib.sha1(D).digest() + H = hashlib.sha1(D).digest() #pylint: disable=E1101 Ka = H[0:8] Kb = H[8:16] return Ka + Kb @@ -127,7 +128,8 @@ class PassportSAM(SAM): self.current_SE.ssc = stringtoint(rnd_icc[-4:] + rnd_ifd[-4:]) return SW["NORMAL"], Eicc + Micc - def _mac(self, key, data, ssc = None, dopad=True): + @staticmethod + def _mac(key, data, ssc = None, dopad=True): """ Compute a message authentication code using a given key and an optional send sequence counter.""" if ssc: