Skip to content

Commit

Permalink
add fixes for some CodeQL warnings
Browse files Browse the repository at this point in the history
* Drop unused import
* Use __le__ instead of __lte__ for TSS2Version
* Drop _port from BaseTPMSimulator subclasses

Signed-off-by: Erik Larsson <who+github@cnackers.org>
  • Loading branch information
whooo committed Sep 23, 2024
1 parent 146c3f4 commit 3063858
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 4 deletions.
1 change: 0 additions & 1 deletion src/tpm2_pytss/internal/crypto.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
from typing import Tuple, Type, Any
import secrets
import inspect
import sys

_curvetable = (
(TPM2_ECC.NIST_P192, ec.SECP192R1),
Expand Down
2 changes: 1 addition & 1 deletion src/tpm2_pytss/internal/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def __lt__(self, other):
x = other if isinstance(other, int) else other._value
return self._value < x

def __lte__(self, other):
def __le__(self, other):
x = other if isinstance(other, int) else other._value
return self._value <= x

Expand Down
2 changes: 0 additions & 2 deletions test/TSS2_BaseTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ class SwtpmSimulator(BaseTpmSimulator):
libname = "libtss2-tcti-swtpm.so"

def __init__(self):
self._port = None
super().__init__()
self.working_dir = tempfile.TemporaryDirectory()

Expand Down Expand Up @@ -120,7 +119,6 @@ class IBMSimulator(BaseTpmSimulator):
libname = "libtss2-tcti-mssim.so"

def __init__(self):
self._port = None
super().__init__()
self.working_dir = tempfile.TemporaryDirectory()

Expand Down

0 comments on commit 3063858

Please sign in to comment.