diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-13 14:25:47 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-13 14:25:47 +0000 |
commit | 4ed1a6e1d4fcb1ba272a4fb3931b33d1c6fbee0d (patch) | |
tree | 26048107dbe7d72d60d9339d90f5cfe678937863 /t/at-least-2048.t | |
parent | Initial commit. (diff) | |
download | debian-keyring-4ed1a6e1d4fcb1ba272a4fb3931b33d1c6fbee0d.tar.xz debian-keyring-4ed1a6e1d4fcb1ba272a4fb3931b33d1c6fbee0d.zip |
Adding upstream version 2023.12.24.upstream/2023.12.24
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 't/at-least-2048.t')
-rwxr-xr-x | t/at-least-2048.t | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/t/at-least-2048.t b/t/at-least-2048.t new file mode 100755 index 0000000..07be53b --- /dev/null +++ b/t/at-least-2048.t @@ -0,0 +1,22 @@ +#!/bin/sh +# Looks for revoked keys in our active keyrings +set -e + +find_too_short () { + k=$1 + gpg --no-options --no-auto-check-trustdb --no-default-keyring \ + --keyring "./output/keyrings/$k" --list-keys --with-colons \ + | awk -F: -v keyring=$1 \ + 'BEGIN { ok = 1 } \ + /^pub/ { fpr = $5 ; if ($3 < 2048 && $4 < 18) { print keyring ":\t0x" $5 " is smaller than 2048 bits"; ok = 0 } } \ + /^sub/ { if ($2 != "r" && $2 != "e" && $3 < 2048 && $4 < 18) { print keyring ":\t0x" fpr " has subkey smaller than 2048 bits"; ok = 0 } } \ + END { if (!ok) { exit 1 } }' +} + +fail=0 +for keyring in debian-keyring.gpg debian-maintainers.gpg \ + debian-nonupload.gpg debian-role-keys.gpg; do + find_too_short $keyring +done + +exit $fail |