| 1 | #!/usr/bin/perl |
| 2 | |
| 3 | use strictscip-perl cpan POSIX-strptime 0.13 strict/; |
| 4 | printscip-perl cpan POSIX-strptime 0.13 main/print(). "1..1\n"; |
| 5 | |
| 6 | if ( !$ENVscip-perl cpan POSIX-strptime 0.13 main/`%ENV`.{TEST_SIGNATURE} ) { |
| 7 | printscip-perl cpan POSIX-strptime 0.13 main/print(). "ok 1 # skip Set the environment variable", |
| 8 | " TEST_SIGNATURE to enable this test\n"; |
| 9 | } |
| 10 | elsif ( !-s 'SIGNATURE' ) { |
| 11 | printscip-perl cpan POSIX-strptime 0.13 main/print(). "ok 1 # skip No signature file found\n"; |
| 12 | } |
| 13 | elsif ( !eval { requirescip-perl cpan POSIX-strptime 0.13 main/require(). Module::Signature; 1 } ) { |
| 14 | printscip-perl cpan POSIX-strptime 0.13 main/print(). "ok 1 # skip ", |
| 15 | "Next time around, consider install Module::Signature, ", |
| 16 | "so you can verify the integrity of this distribution.\n"; |
| 17 | } |
| 18 | elsif ( !eval { requirescip-perl cpan POSIX-strptime 0.13 main/require(). Socket; Socket::inet_atonscip-perl cpan POSIX-strptime 0.13 Socket/inet_aton().('pool.sks-keyservers.net') } ) |
| 19 | { |
| 20 | printscip-perl cpan POSIX-strptime 0.13 main/print(). "ok 1 # skip ", "Cannot connect to the keyserver\n"; |
| 21 | } |
| 22 | else { |
| 23 | ( Module::Signature::verifyscip-perl cpan POSIX-strptime 0.13 Module/Signature/verify().() == Module::Signature::SIGNATURE_OKscip-perl cpan POSIX-strptime 0.13 Module/Signature/SIGNATURE_OK().() ) |
| 24 | or printscip-perl cpan POSIX-strptime 0.13 main/print(). "not "; |
| 25 | printscip-perl cpan POSIX-strptime 0.13 main/print(). "ok 1 # Valid signature\n"; |
| 26 | } |
| 27 | |
| 28 | __END__ |