Skip to content
Snippets Groups Projects
Commit 1064678d authored by Markus Reiter's avatar Markus Reiter
Browse files

Add audit for unversioned URLs with checksum.

parent 6b3555eb
No related branches found
No related tags found
No related merge requests found
......@@ -248,6 +248,7 @@ module Cask
return unless cask.sha256
check_sha256_no_check_if_latest
check_sha256_no_check_if_unversioned
check_sha256_actually_256
check_sha256_invalid
end
......@@ -260,6 +261,12 @@ module Cask
add_error "you should use sha256 :no_check when version is :latest"
end
def check_sha256_no_check_if_unversioned
return if cask.sha256 == :no_check
add_error "Use `sha256 :no_check` when URL is unversioned." if cask.url.unversioned?
end
def check_sha256_actually_256
odebug "Verifying sha256 string is a legal SHA-256 digest"
return unless cask.sha256.is_a?(Checksum)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment