2012-04-18 23:06:46 -04:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
2014-01-15 23:56:00 -05:00
|
|
|
# Lists all commits after a given commit that do not have a trusted
|
|
|
|
# signature
|
2012-04-18 23:06:46 -04:00
|
|
|
#
|
|
|
|
# Allows for automated detection of potential attacks or false authorship of
|
|
|
|
# commits by validating signatures against trusted public GPG keys.
|
|
|
|
#
|
2014-04-09 18:59:22 -04:00
|
|
|
# Copyright (C) 2012, 2013 Free Software Foundation, Inc.
|
2012-04-18 23:06:46 -04:00
|
|
|
#
|
2013-12-22 09:37:21 -05:00
|
|
|
# This file is part of GNU ease.js.
|
2012-04-18 23:06:46 -04:00
|
|
|
#
|
2012-05-11 19:07:44 -04:00
|
|
|
# This program is free software: you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation, either version 3 of the License, or
|
|
|
|
# (at your option) any later version.
|
2012-04-18 23:06:46 -04:00
|
|
|
#
|
2012-05-11 19:07:44 -04:00
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2012-04-18 23:06:46 -04:00
|
|
|
##
|
|
|
|
|
|
|
|
# default to last unsigned commit (specific to ease.js)
|
|
|
|
chkafter="${1:-1b1790029}"
|
|
|
|
|
|
|
|
# Check every commit after chkcommit (or all commits if chkcommit was not
|
|
|
|
# provided) for a trusted signature, listing invalid commits. %G? will output
|
2013-12-22 01:12:24 -05:00
|
|
|
# "G" if the signature is trusted. In the case of a merge commit, the merge
|
|
|
|
# commit itself need only be signed.
|
2012-04-18 23:06:46 -04:00
|
|
|
t=$'\t'
|
2013-12-22 01:12:24 -05:00
|
|
|
git log --first-parent --pretty="format:%H %aN$t%s$t%G?" "$chkafter.." \
|
2012-04-18 23:06:46 -04:00
|
|
|
| grep -v "${t}G$"
|