mirror of
https://cagebreak.project-repo.co/cagebreak.git
synced 2026-08-22 13:34:18 +02:00
Add gpg key validity check
This commit is contained in:
parent
a76f0d6d55
commit
0fce2a807f
2 changed files with 47 additions and 0 deletions
|
|
@ -351,6 +351,7 @@ test('Build without xwayland', find_program('test/build-w-o-xwayland'), env : [
|
|||
test('Copyright and LICENSE', find_program('test/copyright-license'), args : [ cagebreak_main_file + cagebreak_source_strings + cagebreak_header_strings + fuzz_sources + fuzz_headers + fuzz_override_lib ], env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()), ''.join('MESONLICENSE=', meson.project_license())], suite: 'devel' )
|
||||
test('Clang-format (formatting check)', find_program('test/clang-format'), args : [ cagebreak_main_file + cagebreak_source_strings + cagebreak_header_strings + fuzz_sources + fuzz_headers + fuzz_override_lib ], env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'devel')
|
||||
test('Shellcheck (script linting)', find_program('test/shellcheck'), env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'devel')
|
||||
test('GPG key validity', find_program('test/gpg-validity'), args : [ meson.project_version() ], env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'devel')
|
||||
test('Scan-build (static analysis)', find_program('test/scan-build'), env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'devel-long')
|
||||
test('Arguments', find_program('test/arguments'), args : [ meson.project_version() ], env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'basic')
|
||||
test('Environment Variables', find_program('test/environment-variables'), env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'basic')
|
||||
|
|
|
|||
46
test/gpg-validity
Normal file
46
test/gpg-validity
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
#!/bin/bash
|
||||
# Copyright 2023, project-repo and the cagebreak contributors
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
RESULT=0
|
||||
|
||||
# shellcheck disable=2164
|
||||
cd "${MESONCURRENTCONFIGDIR}/keys"
|
||||
stoday=$(date +%s)
|
||||
signingmargin=90
|
||||
|
||||
# shellcheck disable=2046
|
||||
skey11exptime=$(date --date=$(gpg --show-keys cagebreak_signing_key_11\@project-repo.co.pub | tail -2 | head -1 | cut -d " " -f 8 | rev | cut -c2- | rev) '+%s')
|
||||
# shellcheck disable=2046
|
||||
skey12exptime=$(date --date=$(gpg --show-keys cagebreak_signing_key_12\@project-repo.co.pub | tail -2 | head -1 | cut -d " " -f 8 | rev | cut -c2- | rev) '+%s')
|
||||
# shellcheck disable=2046
|
||||
mailexptime=$(date --date=$(gpg --show-keys cagebreak\@project-repo.co.pub | tail -2 | head -1 | cut -d " " -f 8 | rev | cut -c2- | rev) '+%s')
|
||||
|
||||
# signing keys
|
||||
## signing key 11
|
||||
if [[ $(( (stoday - skey11exptime) / 86400 )) -lt $signingmargin ]]
|
||||
then
|
||||
echo "[x] signign key 11"
|
||||
else
|
||||
RESULT=1
|
||||
echo "[ ] signing key 11"
|
||||
fi
|
||||
## signing key 12
|
||||
if [[ $(( (stoday - skey12exptime) / 86400 )) -lt $signingmargin ]]
|
||||
then
|
||||
echo "[x] signign key 12"
|
||||
else
|
||||
RESULT=1
|
||||
echo "[ ] signing key 12"
|
||||
fi
|
||||
|
||||
# email key
|
||||
if [[ $(( (stoday - mailexptime) / 86400 )) -lt $signingmargin ]]
|
||||
then
|
||||
echo "[x] mail key"
|
||||
else
|
||||
RESULT=1
|
||||
echo "[ ] mail key"
|
||||
fi
|
||||
|
||||
exit "${RESULT}"
|
||||
Loading…
Add table
Add a link
Reference in a new issue