50 lines
1.7 KiB
Ruby
50 lines
1.7 KiB
Ruby
class Hashpump < Formula
|
|
desc "Tool to exploit hash length extension attack"
|
|
homepage "https://github.com/bwall/HashPump"
|
|
url "https://github.com/bwall/HashPump/archive/v1.2.0.tar.gz"
|
|
sha256 "d002e24541c6604e5243e5325ef152e65f9fcd00168a9fa7a06ad130e28b811b"
|
|
revision 1
|
|
|
|
bottle do
|
|
cellar :any
|
|
sha256 "01755a1227fb876736e267b3d269ecc673141cbc88cdaf74abbb65461a125d05" => :mojave
|
|
sha256 "479a1f7187b1d126ada855c3368179a97d4cddd5bcd6e869a6418e6f1349d586" => :high_sierra
|
|
sha256 "53dd1f981a635e415dc0459f410a8854b90e04ffc034b87e6abed97bab5027d8" => :sierra
|
|
sha256 "981c229f983ad5b42e4b975e21112ecb0d3715b61b5b278037ceba5a03f82fe8" => :el_capitan
|
|
end
|
|
|
|
option "without-python@2", "Build without python 2 support"
|
|
|
|
deprecated_option "with-python3" => "with-python"
|
|
deprecated_option "without-python" => "without-python@2"
|
|
|
|
depends_on "openssl"
|
|
depends_on "python@2" => :recommended
|
|
depends_on "python" => :optional
|
|
|
|
# Remove on next release
|
|
patch do
|
|
url "https://github.com/bwall/HashPump/pull/14.patch?full_index=1"
|
|
sha256 "ffc978cbc07521796c0738df77a3e40d79de0875156f9440ef63eca06b2e2779"
|
|
end
|
|
|
|
def install
|
|
bin.mkpath
|
|
system "make", "INSTALLLOCATION=#{bin}",
|
|
"CXX=#{ENV.cxx}",
|
|
"install"
|
|
|
|
Language::Python.each_python(build) do |python, _version|
|
|
system python, *Language::Python.setup_install_args(prefix)
|
|
end
|
|
end
|
|
|
|
test do
|
|
output = `#{bin}/hashpump -s '6d5f807e23db210bc254a28be2d6759a0f5f5d99' \\
|
|
-d 'count=10&lat=37.351&user_id=1&long=-119.827&waffle=eggo' \\
|
|
-a '&waffle=liege' -k 14`
|
|
assert_match /0e41270260895979317fff3898ab85668953aaa2/, output
|
|
assert_match /&waffle=liege/, output
|
|
assert_equal 0, $CHILD_STATUS.exitstatus
|
|
end
|
|
end
|