From 8626a2dca09ce5da30563e42b70065b67af110a6 Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Mon, 18 Sep 2017 22:26:56 +0200 Subject: [PATCH] [fix] actually it's 45 chars since it's base64 encoded --- dynette.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dynette.rb b/dynette.rb index 74bf6c9..13bce36 100755 --- a/dynette.rb +++ b/dynette.rb @@ -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