File: tls-basic-certvalid-mixed.sh

package info (click to toggle)
librelp 1.12.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,516 kB
  • sloc: ansic: 8,223; sh: 5,083; makefile: 146; python: 25
file content (39 lines) | stat: -rwxr-xr-x 1,155 bytes parent folder | download | duplicates (3)
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
#!/bin/bash
. ${srcdir:=$(pwd)}/test-framework.sh
# export OPT_VERBOSE=-v # uncomment for debugging 
export errorlog="error.$LIBRELP_DYN.log"

if ! ./have_tlslib "gnutls"; then
	echo 'Skipping test, missing supported for gnutls in this build'
	exit;
fi
if ! ./have_tlslib "openssl"; then
	echo 'Skipping test, missing supported for openssl in this build'
	exit;
fi

startup_receiver -l openssl -T -a "certvalid" -e "${TESTDIR}/${errorlog}" \
		-x ${srcdir}/tls-certs/ca.pem -y ${srcdir}/tls-certs/cert.pem -z ${srcdir}/tls-certs/key.pem

echo 'Send Message...'
./send -l gnutls -t 127.0.0.1 -p $TESTPORT -m "testmessage" -T -a "certvalid" -e "${TESTDIR}/${errorlog}" \
	-x ${srcdir}/tls-certs/ca.pem -y ${srcdir}/tls-certs/cert.pem -z ${srcdir}/tls-certs/key.pem $OPT_VERBOSE 1>>${OUTFILE} 2>&1

stop_receiver

if test -f $TESTDIR/$errorlog; then
	# Check for "handshake failed"
	check_output --check-only "handshake failed" $TESTDIR/$errorlog
	ret=$?
	if [ $ret == 0 ]; then
		echo "SKIP: Handshake failed, TLS Version most likely to old!"
		exit 77
	else 
		echo $TESTDIR/$errorlog
		cat $TESTDIR/$errorlog
	fi
fi

check_output "testmessage"

terminate