11<?php
22/**
3- * SigTool v0.2.3 (last modified: 2018.12.20 ).
3+ * SigTool v0.2.3 (last modified: 2019.01.25 ).
44 * Generates signatures for phpMussel using main.cvd and daily.cvd from ClamAV.
55 *
66 * Package location: GitHub <https://github.com/phpMussel/SigTool>.
@@ -19,7 +19,7 @@ class SigTool
1919 public $ Ver = '0.2.3 ' ;
2020
2121 /** Last modified date. */
22- public $ Modified = '2018.12.20 ' ;
22+ public $ Modified = '2019.01.25 ' ;
2323
2424 /** Script user agent. */
2525 public $ UA = 'SigTool v%s (https://github.com/phpMussel/SigTool) ' ;
@@ -138,7 +138,7 @@ public function read(string $In, &$Arr, int $Depth = 0)
138138 }
139139
140140 /**
141- * Process one line of YAML. Parameters reference variables set by calling method.
141+ * Process a single line of YAML. Parameters reference variables set by calling method.
142142 *
143143 * @param string $ThisLine
144144 * @param string $ThisTab
@@ -302,7 +302,7 @@ public function fetch($URI, $Timeout = 600)
302302 public function shorthand (&$ Data )
303303 {
304304 while (true ) {
305- $ Check = md5 ( $ Data ) . ': ' . strlen ($ Data );
305+ $ Check = hash ( ' sha256 ' , $ Data ) . ': ' . strlen ($ Data );
306306 foreach ([
307307 ["\x11" , 'Win ' ],
308308 ["\x12" , 'W(?:in)?32 ' ],
@@ -419,7 +419,7 @@ public function shorthand(&$Data)
419419 '' ,
420420 ''
421421 ], $ Data );
422- if (md5 ( $ Data ) . ': ' . strlen ($ Data ) === $ Check ) {
422+ if (hash ( ' sha256 ' , $ Data ) . ': ' . strlen ($ Data ) === $ Check ) {
423423 break ;
424424 }
425425 }
@@ -750,7 +750,7 @@ public function fixPath($Path)
750750 if (!empty ($ Set [5 ]) && !empty ($ Set [4 ]) && !empty ($ Meta [$ Set [4 ]]['Files ' ]['Checksum ' ][0 ]) && !empty ($ Meta [$ Set [4 ]]['Version ' ])) {
751751 /** We use the format Y.z.B for signature file versioning. */
752752 $ Meta [$ Set [4 ]]['Version ' ] = date ('Y.z.B ' , time ());
753- $ Meta [$ Set [4 ]]['Files ' ]['Checksum ' ][0 ] = md5 ( $ FileData ) . ': ' . strlen ($ FileData );
753+ $ Meta [$ Set [4 ]]['Files ' ]['Checksum ' ][0 ] = hash ( ' sha256 ' , $ FileData ) . ': ' . strlen ($ FileData );
754754 }
755755
756756 echo $ L10N ['Done ' ];
@@ -1065,7 +1065,7 @@ function ($Matches) use ($Char, $Length) {
10651065 if (!empty ($ Meta [$ FileSet ]['Files ' ]['Checksum ' ][0 ]) && !empty ($ Meta [$ FileSet ]['Version ' ])) {
10661066 /** We use the format Y.z.B for signature file versioning. */
10671067 $ Meta [$ FileSet ]['Version ' ] = date ('Y.z.B ' , time ());
1068- $ Meta [$ FileSet ]['Files ' ]['Checksum ' ][0 ] = md5 ( $ FileData ) . ': ' . strlen ($ FileData );
1068+ $ Meta [$ FileSet ]['Files ' ]['Checksum ' ][0 ] = hash ( ' sha256 ' , $ FileData ) . ': ' . strlen ($ FileData );
10691069 }
10701070 file_put_contents ($ SigTool ->fixPath (__DIR__ . '/ ' . $ FileSet ), $ FileData );
10711071 $ Handle = gzopen ($ SigTool ->fixPath (__DIR__ . '/ ' . $ FileSet . '.gz ' ), 'wb ' );
0 commit comments