From: TANABE Hiroyasu Date: Sat, 30 Aug 2014 21:56:31 +0000 (-0400) Subject: RT1325,2973: Add more extensions to c_rehash X-Git-Tag: OpenSSL_1_0_2-beta3~64 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=8475416fe7d72c373f3fa77d9d27d9f92342a6b8;p=oweals%2Fopenssl.git RT1325,2973: Add more extensions to c_rehash Add .crt/.cer/.crl to the filenames parsed. I also updated the podpage (since it didn't exist when this ticket was first created, nor when it was re-created seven years later). Reviewed-by: Tim Hudson (cherry picked from commit 80ec8d4e3ee212786dc3092b1c97305b871827f0) --- diff --git a/doc/apps/c_rehash.pod b/doc/apps/c_rehash.pod index c564e86315..9f2a15b736 100644 --- a/doc/apps/c_rehash.pod +++ b/doc/apps/c_rehash.pod @@ -14,7 +14,8 @@ B =head1 DESCRIPTION -B scans directories and calculates a hash value of each C<.pem> +B scans directories and calculates a hash value of each +C<.pem>, C<.crt>, C<.cer>, or C<.crl> file in the specified directory list and creates symbolic links for each file, where the name of the link is the hash value. This utility is useful as many programs that use OpenSSL require @@ -42,7 +43,7 @@ incrementing the B value. Duplicates are found by comparing the full SHA-1 fingerprint. A warning will be displayed if a duplicate is found. -A warning will also be displayed if there are B<.pem> files that +A warning will also be displayed if there are files that cannot be parsed as either a certificate or a CRL. The program uses the B program to compute the hashes and diff --git a/tools/c_rehash.in b/tools/c_rehash.in index bfc4a69ed4..683b413df2 100644 --- a/tools/c_rehash.in +++ b/tools/c_rehash.in @@ -75,7 +75,7 @@ sub hash_dir { } } closedir DIR; - FILE: foreach $fname (grep {/\.pem$/} @flist) { + FILE: foreach $fname (grep {/\.(pem)|(crt)|(cer)|(crl)$/} @flist) { # Check to see if certificates and/or CRLs present. my ($cert, $crl) = check_file($fname); if(!$cert && !$crl) {