rspec/rules/S4790/python/rule.adoc

35 lines
563 B
Plaintext
Raw Normal View History

include::../description.adoc[]
include::../ask-yourself.adoc[]
include::../recommended.adoc[]
== Sensitive Code Example
----
import hashlib
m = hashlib.md5() // Sensitive
----
----
import hashlib
m = hashlib.sha1() // Sensitive
----
----
import md5 // Sensitive and deprecated since Python 2.5; use the hashlib module instead.
m = md5.new()
import sha // Sensitive and deprecated since Python 2.5; use the hashlib module instead.
m = sha.new()
----
== Compliant Solution
----
import hashlib
2021-02-16 10:34:10 +01:00
m = hashlib.sha512() // Compliant
----
include::../see.adoc[]