Report using md5sum for checksums (as info)

This commit is contained in:
Alexandre Aubin 2020-11-28 18:43:15 +01:00
parent 657c33e575
commit ee3d38c177

View file

@ -615,6 +615,25 @@ class Configurations(TestSuite):
"https://github.com/YunoHost/issues/issues/201#issuecomment-391549262"
)
@test()
def src_file_checksum_type(self):
app = self.app
for filename in os.listdir(app.path + "/conf") if os.path.exists(app.path + "/conf") else []:
if not filename.endswith(".src"):
continue
try:
content = open(app.path + "/conf/" + filename).read()
except Exception as e:
yield Warning("Can't open/read %s : %s" % (filename, e))
return
if "SOURCE_SUM_PRG=md5sum" in content:
yield Info("%s: Using md5sum checksum is not so great for "
"security. Consider using sha256sum instead." % filename)
@test()
def systemd_config_specific_user(self):