File: reject-with-real-ssh-keygen.sh

package info (click to toggle)
python-sshsig 0.2.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 236 kB
  • sloc: python: 901; sh: 53; makefile: 9
file content (31 lines) | stat: -rwxr-xr-x 598 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#/usr/bin/env bash
set -o errexit -o nounset
cd $(dirname "$0")

for C in ../testdata/sshsig/*; do
  echo Checking $C

  ! ssh-keygen -Y verify \
    -f "$C/allowed_signers" \
    -I "nobody@example.com" \
    -n git \
    -s "$C/message.sig" \
    < "$C/message"

  ! ssh-keygen -Y verify \
    -f "$C/allowed_signers" \
    -I $(cat $C/signer_identity) \
    -n notgit \
    -s "$C/message.sig" \
    < "$C/message"

  ! ssh-keygen -Y verify \
    -f "$C/allowed_signers" \
    -I $(cat $C/signer_identity) \
    -n git \
    -s "$C/message.sig" \
    < <(echo bad message)

done

echo All done.