fixed couple of specs, removed the federation fallback, and fixed the public hashtag pages (not displaying the publisher)

This commit is contained in:
Ilya Zhitomirskiy 2011-09-19 15:52:25 -07:00
parent 352be4d0c0
commit 2cebfa54cc
3 changed files with 5 additions and 18 deletions

View file

@ -58,7 +58,8 @@
%h2 %h2
= "##{params[:name]}" = "##{params[:name]}"
= render 'shared/publisher', :selected_aspects => all_aspects.map{|a| a.id}, :aspect_ids => all_aspects.map{|a| a.id}, :for_all_aspects => true, :aspect => all_aspects.first - if current_user
= render 'shared/publisher', :selected_aspects => all_aspects.map{|a| a.id}, :aspect_ids => all_aspects.map{|a| a.id}, :for_all_aspects => true, :aspect => all_aspects.first
%hr %hr

View file

@ -1,7 +1,5 @@
module Diaspora module Diaspora
module Encryptable module Encryptable
LAST_FALLBACK_TIME = "Sept 19 2011 17:00 UTC "
# Check that signature is a correct signature of #signable_string by person # Check that signature is a correct signature of #signable_string by person
# #
# @param [String] signature The signature to be verified. # @param [String] signature The signature to be verified.
@ -20,9 +18,6 @@ module Diaspora
end end
log_string = "event=verify_signature status=complete guid=#{self.guid}" log_string = "event=verify_signature status=complete guid=#{self.guid}"
validity = person.public_key.verify OpenSSL::Digest::SHA256.new, Base64.decode64(signature), signable_string validity = person.public_key.verify OpenSSL::Digest::SHA256.new, Base64.decode64(signature), signable_string
if !validity && Time.now < Time.parse(LAST_FALLBACK_TIME)
validity = person.public_key.verify "SHA", Base64.decode64(signature), signable_string
end
log_string += " validity=#{validity}" log_string += " validity=#{validity}"
Rails.logger.info(log_string) Rails.logger.info(log_string)
validity validity

View file

@ -21,18 +21,9 @@ describe Diaspora::Encryptable do
@comment.verify_signature(sig, bob.person).should be_true @comment.verify_signature(sig, bob.person).should be_true
end end
context "fallback" do it 'does not verify the fallback after rollout window' do
it "checks the SHA if it's within the week of the rollout window" do sig = Base64.encode64s(bob.encryption_key.sign( "SHA", @comment.signable_string ))
sig = Base64.encode64s(bob.encryption_key.sign( "SHA", @comment.signable_string )) @comment.verify_signature(sig, bob.person).should be_false
@comment.verify_signature(sig, bob.person).should be_true
end
it 'does not verify the fallback after rollout window' do
Kernel::silence_warnings { Diaspora::Encryptable.const_set(:LAST_FALLBACK_TIME,((Time.now - 1.week).to_s))}
sig = Base64.encode64s(bob.encryption_key.sign( "SHA", @comment.signable_string ))
@comment.verify_signature(sig, bob.person).should be_false
end
end end
end end
end end