@@ -546,8 +546,8 @@ SSLObservatory.prototype = {
546546 var data = this . HTTPSEverywhere . rw . write ( file , store ) ;
547547 } ,
548548
549-
550549 maybeUpdateCertWhitelist : function ( ) {
550+ // We aim to update the cert whitelist every 1-3 days
551551 var due_pref = "extensions.https_everywhere._observatory.whitelist_update_due" ;
552552 var update_due = this . prefs . getIntPref ( due_pref ) ;
553553 var now = Date . now ( ) / 1000 ; // Date.now() is milliseconds, but let's be
@@ -566,6 +566,11 @@ SSLObservatory.prototype = {
566566 this . prefs . setIntPref ( due_pref , next ) ;
567567 this . log ( INFO , "Next whitelist update due at " + next ) ;
568568
569+ this . updateCertWhitelist ( ) ;
570+ } ,
571+
572+ updateCertWhitelist : function ( ) {
573+ // Fetch a new certificate whitelist by XHR and save it to disk
569574 var req = Cc [ "@mozilla.org/xmlextras/xmlhttprequest;1" ]
570575 . createInstance ( Ci . nsIXMLHttpRequest ) ;
571576
@@ -583,7 +588,7 @@ SSLObservatory.prototype = {
583588 var c = 0 ;
584589 for ( var hash in whitelist ) {
585590 c ++ ;
586- if ( typeof hash != "string" || hash . length != 64 ) {
591+ if ( typeof hash != "string" || hash . length != HASHLENGTH ) {
587592 that . log ( WARN , "UNACCEPTABLE WHITELIST HASH " + hash ) ;
588593 return false ;
589594 }
@@ -602,7 +607,6 @@ SSLObservatory.prototype = {
602607 }
603608 }
604609 req . send ( ) ;
605-
606610 } ,
607611
608612 isChainWhitelisted : function ( chainhash ) {
0 commit comments