The following issues were found
tests/extmod/ubinascii_crc32.py
3 issues
Line: 8
Column: 5
import binascii
except ImportError:
print("SKIP")
raise SystemExit
try:
binascii.crc32
except AttributeError:
print("SKIP")
Reported by Pylint.
Line: 14
Column: 5
binascii.crc32
except AttributeError:
print("SKIP")
raise SystemExit
print(hex(binascii.crc32(b"The quick brown fox jumps over the lazy dog")))
print(hex(binascii.crc32(b"\x00" * 32)))
print(hex(binascii.crc32(b"\xff" * 32)))
print(hex(binascii.crc32(bytes(range(32)))))
Reported by Pylint.
Line: 1
Column: 1
try:
try:
import ubinascii as binascii
except ImportError:
import binascii
except ImportError:
print("SKIP")
raise SystemExit
Reported by Pylint.
tests/basics/int_divmod_intbig.py
3 issues
Line: 1
Column: 1
# test integer floor division and modulo
# this tests bignum modulo
a = 987654321987987987987987987987
b = 19
print(a % b)
print(a % -b)
print(-a % b)
print(-a % -b)
Reported by Pylint.
Line: 4
Column: 1
# test integer floor division and modulo
# this tests bignum modulo
a = 987654321987987987987987987987
b = 19
print(a % b)
print(a % -b)
print(-a % b)
print(-a % -b)
Reported by Pylint.
Line: 5
Column: 1
# this tests bignum modulo
a = 987654321987987987987987987987
b = 19
print(a % b)
print(a % -b)
print(-a % b)
print(-a % -b)
Reported by Pylint.
tests/basics/int2.py
3 issues
Line: 1
Column: 1
# test basic int operations
# test conversion of bool on RHS of binary op
a = False
print(1 + a)
a = True
print(1 + a)
Reported by Pylint.
Line: 4
Column: 1
# test basic int operations
# test conversion of bool on RHS of binary op
a = False
print(1 + a)
a = True
print(1 + a)
Reported by Pylint.
Line: 6
Column: 1
# test conversion of bool on RHS of binary op
a = False
print(1 + a)
a = True
print(1 + a)
Reported by Pylint.
ports/esp32/boards/UM_TINYS2/manifest.py
3 issues
Line: 1
Column: 1
include("$(PORT_DIR)/boards/manifest.py")
freeze("modules")
Reported by Pylint.
Line: 2
Column: 1
include("$(PORT_DIR)/boards/manifest.py")
freeze("modules")
Reported by Pylint.
Line: 1
Column: 1
include("$(PORT_DIR)/boards/manifest.py")
freeze("modules")
Reported by Pylint.
tests/extmod/ucryptolib_aes128_cbc.py
3 issues
Line: 2
Suggestion:
https://bandit.readthedocs.io/en/latest/blacklists/blacklist_imports.html#b413-import-pycrypto
try:
from Crypto.Cipher import AES
aes = AES.new
except ImportError:
try:
from ucryptolib import aes
except ImportError:
print("SKIP")
Reported by Bandit.
Line: 10
Column: 9
from ucryptolib import aes
except ImportError:
print("SKIP")
raise SystemExit
crypto = aes(b"1234" * 4, 2, b"5678" * 4)
enc = crypto.encrypt(bytes(range(32)))
print(enc)
crypto = aes(b"1234" * 4, 2, b"5678" * 4)
Reported by Pylint.
Line: 1
Column: 1
try:
from Crypto.Cipher import AES
aes = AES.new
except ImportError:
try:
from ucryptolib import aes
except ImportError:
print("SKIP")
Reported by Pylint.
ports/unix/variants/coverage/manifest.py
3 issues
Line: 1
Column: 1
freeze_as_str("frzstr")
freeze_as_mpy("frzmpy")
Reported by Pylint.
Line: 2
Column: 1
freeze_as_str("frzstr")
freeze_as_mpy("frzmpy")
Reported by Pylint.
Line: 1
Column: 1
freeze_as_str("frzstr")
freeze_as_mpy("frzmpy")
Reported by Pylint.
tests/extmod/ucryptolib_aes128_ecb.py
3 issues
Line: 2
Suggestion:
https://bandit.readthedocs.io/en/latest/blacklists/blacklist_imports.html#b413-import-pycrypto
try:
from Crypto.Cipher import AES
aes = AES.new
except ImportError:
try:
from ucryptolib import aes
except ImportError:
print("SKIP")
Reported by Bandit.
Line: 10
Column: 9
from ucryptolib import aes
except ImportError:
print("SKIP")
raise SystemExit
crypto = aes(b"1234" * 4, 1)
enc = crypto.encrypt(bytes(range(32)))
print(enc)
crypto = aes(b"1234" * 4, 1)
Reported by Pylint.
Line: 1
Column: 1
try:
from Crypto.Cipher import AES
aes = AES.new
except ImportError:
try:
from ucryptolib import aes
except ImportError:
print("SKIP")
Reported by Pylint.
tests/extmod/ucryptolib_aes128_ecb_enc.py
3 issues
Line: 5
Suggestion:
https://bandit.readthedocs.io/en/latest/blacklists/blacklist_imports.html#b413-import-pycrypto
# AES128 encryption (anything else, including AES128 decryption,
# is optional).
try:
from Crypto.Cipher import AES
aes = AES.new
except ImportError:
try:
from ucryptolib import aes
Reported by Bandit.
Line: 13
Column: 9
from ucryptolib import aes
except ImportError:
print("SKIP")
raise SystemExit
crypto = aes(b"1234" * 4, 1)
enc = crypto.encrypt(bytes(range(32)))
print(enc)
Reported by Pylint.
Line: 1
Column: 1
# This tests minimal configuration of ucrypto module, which is
# AES128 encryption (anything else, including AES128 decryption,
# is optional).
try:
from Crypto.Cipher import AES
aes = AES.new
except ImportError:
try:
Reported by Pylint.
tests/basics/dict_fixed.py
3 issues
Line: 7
Column: 5
import uerrno
except ImportError:
print("SKIP")
raise SystemExit
# Save a copy of uerrno.errorcode, so we can check later
# that it hasn't been modified.
errorcode_copy = uerrno.errorcode.copy()
Reported by Pylint.
Line: 1
Column: 1
# test that fixed dictionaries cannot be modified
try:
import uerrno
except ImportError:
print("SKIP")
raise SystemExit
# Save a copy of uerrno.errorcode, so we can check later
Reported by Pylint.
Line: 48
Suggestion:
https://bandit.readthedocs.io/en/latest/plugins/b101_assert_used.html
except TypeError:
print("TypeError")
assert uerrno.errorcode == errorcode_copy
Reported by Bandit.
tests/feature_check/reverse_ops.py
3 issues
Line: 1
Column: 1
class Foo:
def __radd__(self, other):
pass
try:
5 + Foo()
except TypeError:
print("TypeError")
Reported by Pylint.
Line: 1
Column: 1
class Foo:
def __radd__(self, other):
pass
try:
5 + Foo()
except TypeError:
print("TypeError")
Reported by Pylint.
Line: 1
Column: 1
class Foo:
def __radd__(self, other):
pass
try:
5 + Foo()
except TypeError:
print("TypeError")
Reported by Pylint.