[fix] actually it's 45 chars since it's base64 encoded

This commit is contained in:
Laurent Peuch 2017-09-18 22:26:56 +02:00
parent d94ecdc058
commit 8626a2dca0

View file

@ -115,7 +115,7 @@ end
if params.has_key?("public_key")
public_key = Base64.decode64(params[:public_key].encode('ascii-8bit'))
# might be 88
unless public_key.length == 24 or public_key.length == 89
unless public_key.length == 24 or public_key.length == 45
halt 400, { :error => "Key is invalid: #{public_key.to_s.encode('UTF-8', {:invalid => :replace, :undef => :replace, :replace => '?'})}" }.to_json
end
end