Re: md5 sum integrity check for downloaded PHP tarball?
| From: | Ian Ball | Date: | Tue, 06 Aug 2002 22:26:03 +0000 |
| Subject: | Re: md5 sum integrity check for downloaded PHP tarball? | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-111446@lists.php.net to get a copy of this message | ||
Hi,
Thanks for the answer, but unfortunately this is not what I was looking for,
probably because my question made it a little obscure what information I was
looking for. I am looking for an md5 sum or something that I can use to
check a downloaded PHP tarball with. With most sites, say the kernel
archives for example, publich an md5 sum next to the tarball. One downloads
both the tarball and md5 sum and checks if the md5 sum of the tarball matches
the one in the md5 file. If they don't match, alarms ring. So, where on the
PHP site do I find such an md5 sum that I can use to check the integrity of a
downloaded PHP tarball?
Ian
On Tuesday 06 August 2002 17:18, Danny Shepherd wrote:
> Try
>
> <?php
>
> if (!function_exists('md5_file'))
> {
> // Function only exists in PHP4.2.2+
> // So we'll add it manually if it's not present
> function md5_file($inFile)
> {
> if (file_exists($inFile))
> {
> $fd = fopen($inFile, 'rb');
> $fileContents = fread($fd, filesize($inFile));
> fclose ($fd);
> return md5($fileContents);
> }
> else
> return false;
> }
> }
>
> //$downloadedapp = path/to/your/downloaded/app
> //$publishedMD5string = md5string you want to use in the comparison
>
> if (md5_file($downloadedapp)==$publishedMD5String)
> echo "File & md5string match - file is Ok";
> else
> echo "File & md5string are different, wrong/corrupt file or md5string";
>
> ?>
>
> HTH
>
> Danny.
>
>
> ----- Original Message -----
> From: "Ian Ball" <ian23@midori.shacknet.nu>
> To: <php-general@lists.php.net>
> Sent: Tuesday, August 06, 2002 3:56 PM
> Subject: [PHP] md5 sum integrity check for downloaded PHP tarball?
>
> > Hi,
> >
> > I am just wondering if there is any possibility to check the integrity of
>
> a
>
> > downloaded PHP tarball with a published md5 sum or similar from
> > somewhere. This needs to be done because of security concerns in the
> > company I work
>
> for.
>
> > I've looked around on the PHP site but didn't find anything.
> >
> > Ian
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php