[Pkg-mozext-commits] [perspectives-extension] 05/18: Pers_client_policy - Add tests for invalid check lengths for weakly seen keys

David Prévot taffit at alioth.debian.org
Fri Oct 25 18:24:29 UTC 2013


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch debian
in repository perspectives-extension.

commit 731eb7cf2f651f9e75ce362e8b0f69508c3fc686
Author: Dave Schaefer <dave.schaefer at gmail.com>
Date:   Mon Oct 7 22:18:26 2013 -0600

    Pers_client_policy - Add tests for invalid check lengths for weakly seen keys
---
 plugin/chrome/content/client_policy.js |   12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/plugin/chrome/content/client_policy.js b/plugin/chrome/content/client_policy.js
index 23886d6..ecea72d 100644
--- a/plugin/chrome/content/client_policy.js
+++ b/plugin/chrome/content/client_policy.js
@@ -216,8 +216,20 @@ get_quorum_duration : function(test_key, results, quorum_size, stale_limit_secs,
 // This technique is implemented by the functions 'key_weakly_seen_by_quorum' and 'inconsistency_check' 
 
 key_weakly_seen_by_quorum : function(test_key, results, quorum_size, check_length){ 
+	if (check_length < 1) {
+		Pers_debug.d_print("error",
+				"Check length cannot be negative when testing for weakly seen certificates!");
+		return false;
+	}
+
  	var cutoff_sec = Pers_util.get_unix_time() - Pers_util.DAY2SEC(check_length); 
 
+	if (cutoff_sec < 1) {
+		Pers_debug.d_print("error",
+				"Check length cannot be larger than the current time when testing for weakly seen certificates!");
+		return false;
+	}
+
 	for(var i = 0; i < results.length; i++) {
 		var seen = false;  
 		for(var j = 0; j < results[i].obs.length; j++) { 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/perspectives-extension.git



More information about the Pkg-mozext-commits mailing list