mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-08-22 18:17:09 +00:00
parser: equality tests: convert to using sha256sum for the hashes
There is a general industry wide effort to move off of md5 and even sha1 (see recent kernel changes). While in this particular use case it doesn't make a difference (besides slightly lowering the chance of a collision) switch to sha256sum to make sure our code doesn't depend on tools that are deprecated and there is an effort to remove. Signed-off-by: John Johansen <john.johansen@canonical.com>
This commit is contained in:
parent
bf7b80c478
commit
027b508da8
@ -103,7 +103,7 @@ hash_binary_policy()
|
|||||||
printf %s "$2" | ${APPARMOR_PARSER} --features-file "${_SCRIPTDIR}/features_files/$features_file" ${flags} > "$tmpdir/$1.bin" 2>"$dump"
|
printf %s "$2" | ${APPARMOR_PARSER} --features-file "${_SCRIPTDIR}/features_files/$features_file" ${flags} > "$tmpdir/$1.bin" 2>"$dump"
|
||||||
rc=$?
|
rc=$?
|
||||||
if [ $rc -eq 0 ] ; then
|
if [ $rc -eq 0 ] ; then
|
||||||
hash=$(md5sum "${tmpdir}/$1.bin" | cut -d ' ' -f 1)
|
hash=$(sha256sum "${tmpdir}/$1.bin" | cut -d ' ' -f 1)
|
||||||
rc=$?
|
rc=$?
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user