Spot Bug in this Lua Code

1 points by renlinx ↗ HN
key = "SuperSecretKey@007"

password = "lol!0!b00m"

token = sha1.hmac(key,password)

if (sha1.hmac(key,user_input) == token) then

print ("Login Success")

else

print ("Login Failed")

end

Assume that "user_input" is a variable that comes from the user.

2 comments

[ 0.27 ms ] story [ 12.0 ms ] thread
is the bug induced by user_input ? one could submit a function in there
You aren't using any locals. sha1 is not defined anywhere. :)