Skip to content
This repository has been archived by the owner on Mar 27, 2022. It is now read-only.

Commit

Permalink
Fix Internet Explorer RSA encryption by removing opensearch link tag …
Browse files Browse the repository at this point in the history
…(What??!)
  • Loading branch information
seven1m committed Aug 26, 2008
1 parent b6b86d2 commit 4be9c5e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 0 additions & 2 deletions app/controllers/sessions_controller.rb
@@ -1,6 +1,4 @@
class SessionsController < ApplicationController
filter_parameter_logging :password

skip_before_filter :authenticate_user
before_filter :check_ssl, :except => %w(destroy)

Expand Down
5 changes: 3 additions & 2 deletions app/views/sessions/new.html.erb
Expand Up @@ -6,8 +6,9 @@
rsa.setPublic('<%= @public_modulus %>', '<%= @public_exponent %>');
var res = rsa.encrypt($('password').value);
if (res) {
$('encrypted_password').value = hex2b64(res);
$('password').value = '';
encrypted = linebrk(hex2b64(res), 64);
$('encrypted_password').setAttribute('value', encrypted);
$('password').setAttribute('value', '');
return true;
}
return false;
Expand Down
1 change: 0 additions & 1 deletion themes/aqueouslight/layouts/default.html.erb
Expand Up @@ -9,7 +9,6 @@
<meta http-equiv="Cache-Control" content="no-cache"/>
<link rel="stylesheet" href="/stylesheets/aqueouslight.css" type="text/css" media="screen,projection" />
<link rel="stylesheet" href="/stylesheets/print.css" type="text/css" media="print" />
<link rel="search" type="application/opensearchdescription+xml" href="<%= formatted_opensearch_search_path(:format => 'xml') %>" title="<%= Setting.get(:name, :site) %> Search" />

This comment has been minimized.

Copy link
@seven1m

seven1m Aug 26, 2008

Author Owner

This little “bug” consumed approximately 8 hours of my life. Internet Explorer (and the rsa.js lib) does not properly encrypt when this link tag is present. It appears to work, but then OpenSSL on the server side fails with a less-than-descriptive “padding check failed” error.

<%= javascript_include_tag 'all.pack.js' %>
<%= yield :head %>
</head>
Expand Down

0 comments on commit 4be9c5e

Please sign in to comment.