New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(agw): activate mypy code scanning in lte except integ_tests #13187
Conversation
Thanks for opening a PR! 💯
Howto
More infoPlease take a moment to read through the Magma project's
If this is your first Magma PR, also consider reading
|
Oops! Looks like you failed the Howto
♻️ Updated: ✅ The check is passing the Python Format Check after the last commit. |
@magma/approvers-agw-pipelined, can someone take a look at this PR? Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM (% NIT discussed offline, adding return types)
Signed-off-by: Alex Jahl <alexander.jahl@tngtech.com>
return hmac.hexdigest() + iv.hex() + enc.hex() | ||
elif encryption_algorithm == PipelineD.HEConfig.AES256_ECB_HMAC_MD5: | ||
aes_cipher = AES.new(key_val, AES.MODE_ECB) | ||
enc = aes_cipher.encrypt(pad(s).encode('utf-8')) |
Check failure
Code scanning / CodeQL
Use of a broken or weak cryptographic algorithm
return hmac.hexdigest() + enc.hex() | ||
elif encryption_algorithm == PipelineD.HEConfig.GZIPPED_AES256_ECB_SHA1: | ||
aes_cipher = AES.new(key_val, AES.MODE_ECB) | ||
enc = aes_cipher.encrypt(pad(s).encode('utf-8')) |
Check failure
Code scanning / CodeQL
Use of a broken or weak cryptographic algorithm
decrypted = cipher.decrypt(codecs.decode(data[32:], 'hex_codec')) | ||
ret = decrypted.decode("utf-8").strip() | ||
aes_cipher = AES.new(key, AES.MODE_ECB) | ||
decrypted = aes_cipher.decrypt(codecs.decode(data[32:], 'hex_codec')) |
Check failure
Code scanning / CodeQL
Use of a broken or weak cryptographic algorithm
logging.error("Unsupported encryption algorithm") | ||
return ret | ||
aes_cipher = AES.new(key, AES.MODE_ECB) | ||
decrypted = aes_cipher.decrypt(codecs.decode(data[32:], 'hex_codec')) |
Check failure
Code scanning / CodeQL
Use of a broken or weak cryptographic algorithm
…gma#13187) Signed-off-by: Alex Jahl <alexander.jahl@tngtech.com>
Signed-off-by: Alex Jahl alexander.jahl@tngtech.com
Summary
Active MyPy scanning for all Python code in
lte
exceptinteg_tests
(is part of a separate PR) and fix all MyPy related errors.Test Plan
Additional Information
This change is not backwards-breaking