File: test-badcert.sh

package info (click to toggle)
tlswrapper 0~20241101-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 1,796 kB
  • sloc: ansic: 7,099; sh: 2,342; makefile: 234
file content (34 lines) | stat: -rw-r--r-- 835 bytes parent folder | download | duplicates (2)
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
#!/bin/sh

TCPREMOTEIP=0.0.0.0; export TCPREMOTEIP
TCPREMOTEPORT=0; export TCPREMOTEPORT
TCPLOCALIP=0.0.0.0; export TCPLOCALIP
TCPLOCALPORT=0; export TCPLOCALPORT

cleanup() {
  ex=$?
  rm -rf tlswrappernojail testemptycert
  exit "${ex}"
}
trap "cleanup" EXIT TERM INT

PATH="./:${PATH}"
export PATH

ln -s tlswrapper-test tlswrappernojail
touch testemptycert


ls testcerts | grep '^badcert-' |\
while read name; do
  echo $name
  tlswrapper-test -qr tlswrappernojail -vf "testcerts/${name}" true 2>&1 | sed 's/ (.*)/ /'
  echo $?
done

#echo 'tlswrapper rejects empty PEM cert.'
#tlswrapper-test -qr tlswrappernojail -vf testemptycert true 2>&1
#echo $?; echo
#echo 'tlswrapper rejects unsupported PEM cert.'
#tlswrapper-test -qr tlswrappernojail -vf testcerts/server-ec-prime256v1-ec-secp224r1-unsupported true 2>&1
#echo $?; echo