verifyfse.sh 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #!/bin/bash
  2. # Copyleft 2020 Jeff Cliff
  3. #
  4. # This program is free software: you can redistribute it and/or modify
  5. # it under the terms of the GNU General Public License as published by
  6. # the Free Software Foundation, either version 3 of the License, or (at
  7. # your option) any later version.
  8. #
  9. # This program is distributed in the hope that it will be useful, but
  10. # WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. # General Public License for more details.
  13. #
  14. # You should have received a copy of the GNU General Public License
  15. # along with this program, like at COPYING.GPL. If not, see <https://www.gnu.org/licenses/>.
  16. #precondition
  17. #wget https://freespeechextremist.com/media/888a4629af8e592774e0fc9cb047c48f33313ac9739de9bc3cc3ee241af4c2ce.asc?name=warrantcanary.asc
  18. #gpg --import 888a4629af8e592774e0fc9cb047c48f33313ac9739de9bc3cc3ee241af4c2ce.asc\?name\=warrantcanary.asc
  19. TMPFILE=`mktemp`
  20. TMPFILE1=`mktemp`
  21. TMPFILE2=`mktemp`
  22. TMPFILE3=`mktemp`
  23. successfile=$TMPFILE3
  24. echo "gpg: using RSA key 768A07A25F0D2AE3816E00AAC7C3A3098FB70D9D" >> $successfile
  25. echo "gpg: Good signature from \"FSE Warrant Canary\" [unknown]" >> $successfile
  26. echo "gpg: WARNING: This key is not certified with a trusted signature!" >> $successfile
  27. echo "gpg: There is no indication that the signature belongs to the owner." >> $successfile
  28. echo "Primary key fingerprint: 768A 07A2 5F0D 2AE3 816E 00AA C7C3 A309 8FB7 0D9D" >> $successfile
  29. # echo $TMPFILE
  30. finger warrantcanary@freespeechextremist.com | sed -n '/^-/,/^-----END PGP SIGNATURE-----/p' > $TMPFILE
  31. gpg --verify $TMPFILE 2> $TMPFILE1
  32. #echo "cat $TMPFILE1"
  33. #cat $TMPFILE1
  34. tail -n 5 $TMPFILE1 > $TMPFILE2
  35. diff $successfile $TMPFILE2
  36. if [ $? -ne 0 ]; then
  37. echo "not good"
  38. else
  39. echo "good"
  40. fi