1
0
ca-certificates-mozilla/compareoldnew
OBS User autobuild f92238c166 Accepting request 36567 from Base:System
Copy from Base:System/ca-certificates-mozilla based on submit request 36567 from user lnussel

OBS-URL: https://build.opensuse.org/request/show/36567
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/ca-certificates-mozilla?expand=0&rev=1
2010-04-01 16:22:04 +00:00

41 lines
947 B
Bash

#!/bin/bash
# print fingerprints of new or changed certificates
set -e
cleanup()
{
rm -rf new{,.files} old{,.files}
}
showcert()
{
openssl x509 -in "$1" -noout -subject -fingerprint -nameopt multiline,utf8,-esc_msb \
| sed -ne 's/ *commonName *= / CN: /p; s/.*Fingerprint=/ sha1: /p'
}
cleanup
trap cleanup EXIT
mkdir old new
cd old
echo old...
VERBOSE=1 ../extractcerts.pl < ../.osc/certdata.txt | sort > ../old.files
cd ..
cd new
echo new...
VERBOSE=1 ../extractcerts.pl < ../certdata.txt | sort > ../new.files
cd ..
echo '----------------------------'
while read line; do
IFS='#' eval set -- \$line
old="$1"
new="$2"
common="$3"
if [ -n "$old" ]; then
echo "$old has been deleted"
elif [ -n "$new" ]; then
echo "new: $new"
showcert new/$new
elif ! cmp "old/$common" "new/$common"; then
echo "*** $common differs!"
showcert old/$common
showcert old/$common
fi
done < <(comm --output-delimiter='#' old.files new.files)