-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtests.sh
executable file
·46 lines (29 loc) · 1.48 KB
/
tests.sh
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/bash
set -e
MSG="test msg"
SSH_DIRECTORY=/tmp/ring-ssh
rm -rf $SSH_DIRECTORY
mkdir $SSH_DIRECTORY
echo "$SSH_DIRECTORY/id_ecdsa" | ssh-keygen -t ecdsa
echo "$SSH_DIRECTORY/id_ed25519" | ssh-keygen -t ed25519
echo "$SSH_DIRECTORY/id_rsa" | ssh-keygen -b 3072 -t rsa
export SSH_DIRECTORY=$SSH_DIRECTORY
## ECDSA Test ##
# generate signature
./git-ring sign --msg "$MSG" --url /~https://github.com/torvalds.keys --github rot256 --ssh-key $SSH_DIRECTORY/id_ecdsa.pub
# check against same ring
./git-ring verify --url /~https://github.com/torvalds.keys --github rot256 --ssh-key $SSH_DIRECTORY/id_ecdsa.pub | grep "$MSG"
# check against superset
./git-ring verify --github torvalds --github gregkh --github rot256 --ssh-key $SSH_DIRECTORY/id_ecdsa.pub | grep "$MSG"
## Ed25519 Test ##
# generate signature
./git-ring sign --msg "$MSG" --gitlab dzaporozhets --ssh-key $SSH_DIRECTORY/id_ed25519.pub
# check against same ring
./git-ring verify --gitlab dzaporozhets --ssh-key $SSH_DIRECTORY/id_ed25519.pub | grep "$MSG"
# check against superset
./git-ring verify --github torvalds --github gregkh --github rot256 --gitlab dzaporozhets --ssh-key $SSH_DIRECTORY/id_ed25519.pub | grep "$MSG"
## RSA Test ##
# generate signature (large ring)
./git-ring sign --msg "$MSG" --allow-empty --github Cloudflare --ssh-key $SSH_DIRECTORY/id_rsa.pub
# check against superset (large ring)
./git-ring verify --github Cloudflare --ssh-key $SSH_DIRECTORY/id_rsa.pub --ssh-key $SSH_DIRECTORY/id_ed25519.pub | grep "$MSG"