Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

With respect to "Check authenticity of cpan mods installed", I know that every tarball accepted on CPAN has a few checksum attributes computed and stored in the corresponding CPAN author directory.

For example, let's say you are interested in this specific distribution release:

https://cpan.metacpan.org/authors/id/A/AN/ANDK/CPAN-Checksums-2.12.tar.gz

You can find the "checksum" for every file on ANDK directory at

https://www.cpan.org/authors/id/A/AN/ANDK/CHECKSUMS

This file has a data structure encoded in Perl itself, and the bit that matters for the tarball in question is

'CPAN-Checksums-2.12.tar.gz' => { 'md5' => 'a98eaa3f96c052ee73690459d8e7a4f4', 'md5-ungz' => 'e49a4710110f8a6a916ece44165ee1e8', 'mtime' => '2016-06-14', 'sha256' => '99600fb2d1a007f84e16b5eae608ffbc288bd0af92fbcc5d73120 +d43ee5d2d38', 'sha256-ungz' => 'aaddaf9ca455863e3f28c55e26741251640ee477906e3e03 +8f5e330ccf406970', 'size' => 14868 },

So you can write code to make sure the downloaded tarball matches the corresponding attributes / checksums.

For example, the commands below (on OS X) manually "check" the size and md5 sum of the .gz file.

$ curl -O https://cpan.metacpan.org/authors/id/A/AN/ANDK/CPAN-Checksum +s-2.12.tar.gz $ stat -f '%N %z' CPAN-Checksums-2.12.tar.gz CPAN-Checksums-2.12.tar.gz 14868 $ md5 CPAN-Checksums-2.12.tar.gz MD5 (CPAN-Checksums-2.12.tar.gz) = a98eaa3f96c052ee73690459d8e7a4f4

I think some CPAN clients (especiallly CPAN which is part of Perl core) may be configured to verify those checksums while downloading and installing. Someone else may correct me or point to the specific incantations to make that work.


In reply to Re: New to perl - Check authenticity of cpan mods installed/used by ferreira
in thread New to perl - Check authenticity of cpan mods installed/used by gradius85

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (7)
As of 2024-04-19 13:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found