mirror of
				https://bitbucket.org/jsuto/piler.git
				synced 2025-11-01 00:32:27 +01:00 
			
		
		
		
	| @@ -1,11 +1,11 @@ | |||||||
| <?php | <?php | ||||||
|  |  | ||||||
| define(COUNT, 'count'); | define('COUNT', 'count'); | ||||||
| define(HASH_VALUE, 'hash_value'); | define('HASH_VALUE', 'hash_value'); | ||||||
| define(RESPONSE_STRING, 'response_string'); | define('RESPONSE_STRING', 'response_string'); | ||||||
| define(RESPONSE_TIME, 'response_time'); | define('RESPONSE_TIME', 'response_time'); | ||||||
| define(START_ID, 'start_id'); | define('START_ID', 'start_id'); | ||||||
| define(STOP_ID, 'stop_id'); | define('STOP_ID', 'stop_id'); | ||||||
|  |  | ||||||
| ini_set("session.save_path", "/tmp"); | ini_set("session.save_path", "/tmp"); | ||||||
|  |  | ||||||
| @@ -136,12 +136,12 @@ function get_hash_values() { | |||||||
|  |  | ||||||
|    if(MODE == 'time') { $stop_id = $start_id + $count - 1; } |    if(MODE == 'time') { $stop_id = $start_id + $count - 1; } | ||||||
|  |  | ||||||
|    return array( |    return [ | ||||||
|       START_ID => $start_id, |       START_ID => $start_id, | ||||||
|       STOP_ID => $stop_id, |       STOP_ID => $stop_id, | ||||||
|       COUNT => $count, |       COUNT => $count, | ||||||
|       HASH_VALUE => sha1($s) |       HASH_VALUE => sha1($s) | ||||||
|           ); |    ]; | ||||||
|  |  | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -167,15 +167,24 @@ class TrustedTimestamps | |||||||
|          * |          * | ||||||
|          * every other case (Certificate not found / invalid / openssl is not installed / ts command not known) |          * every other case (Certificate not found / invalid / openssl is not installed / ts command not known) | ||||||
|          * are being handled the same way -> retcode 1 + any retarray NOT containing "message imprint mismatch" |          * are being handled the same way -> retcode 1 + any retarray NOT containing "message imprint mismatch" | ||||||
|  |          * | ||||||
|  |          * For openssl 1.1.x it's 2 lines actually: | ||||||
|  |          * | ||||||
|  |          * Using configuration from /usr/lib/ssl/openssl.cnf | ||||||
|  |          * Verification: OK | ||||||
|  |          * | ||||||
|          */ |          */ | ||||||
|  |  | ||||||
|         if ($retcode === 0 && strtolower(trim($retarray[0])) == "verification: ok") |         if ($retcode === 0) { | ||||||
|         { |            foreach ($retarray as $line) { | ||||||
|  |               if(strtolower(trim($line)) == "verification: ok") { | ||||||
|                  if (self::getTimestampFromAnswer ($base64_response_string) != $response_time) |                  if (self::getTimestampFromAnswer ($base64_response_string) != $response_time) | ||||||
|                     throw new Exception("The responsetime of the request was changed"); |                     throw new Exception("The responsetime of the request was changed"); | ||||||
|  |  | ||||||
|                  return true; |                  return true; | ||||||
|               } |               } | ||||||
|  |            } | ||||||
|  |         } | ||||||
|  |  | ||||||
|         foreach ($retarray as $retline) |         foreach ($retarray as $retline) | ||||||
|         { |         { | ||||||
| @@ -205,5 +214,3 @@ class TrustedTimestamps | |||||||
|         return $tempfilename; |         return $tempfilename; | ||||||
|     } |     } | ||||||
| } | } | ||||||
|  |  | ||||||
| ?> |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user