Skip to content
Extraits de code Groupes Projets
Valider 2cebfa54 rédigé par Ilya Zhitomirskiy's avatar Ilya Zhitomirskiy
Parcourir les fichiers

fixed couple of specs, removed the federation fallback, and fixed the public...

fixed couple of specs, removed the federation fallback, and fixed the public hashtag pages (not displaying the publisher)
parent 352be4d0
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -58,7 +58,8 @@
%h2
= "##{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
......
module Diaspora
module Encryptable
LAST_FALLBACK_TIME = "Sept 19 2011 17:00 UTC "
# Check that signature is a correct signature of #signable_string by person
#
# @param [String] signature The signature to be verified.
......@@ -20,9 +18,6 @@ module Diaspora
end
log_string = "event=verify_signature status=complete guid=#{self.guid}"
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}"
Rails.logger.info(log_string)
validity
......
......@@ -21,18 +21,9 @@ describe Diaspora::Encryptable do
@comment.verify_signature(sig, bob.person).should be_true
end
context "fallback" 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 ))
@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
it 'does not verify the fallback after rollout window' do
sig = Base64.encode64s(bob.encryption_key.sign( "SHA", @comment.signable_string ))
@comment.verify_signature(sig, bob.person).should be_false
end
end
end
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter