Changeset afebb9b in mod_gnutls


Ignore:
Timestamp:
Nov 27, 2018, 6:26:04 PM (4 months ago)
Author:
Krista Karppinen <krista.celestia@…>
Branches:
debian/master, master
Children:
9a834cc
Parents:
0e55076
git-author:
Krista Karppinen <krista.celestia@…> (11/27/18 17:40:33)
git-committer:
Krista Karppinen <krista.celestia@…> (11/27/18 18:26:04)
Message:

Add gnutls-cli version requirement to SNI tests

Since the --sni-hostname option doesn't exist in gnutls-cli client
versions prior to 3.5.12, skip the tests using it if an older version
(or no version) is encountered.

Location:
test
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • test/common.bash

    r0e55076 rafebb9b  
    101101    return 0
    102102}
     103
     104# Usage: require_gnutls_cli ${REQUIRED_VERSION_NUMBER} || exit ${ERROR_CODE}
     105# Require the gnutls-cli binary to be of a given version or newer.
     106# Return error code 1 if older, 2 if not found.
     107function require_gnutls_cli
     108{
     109    local required_version=(${1//./ })
     110
     111    if [[ $(gnutls-cli --version) =~ gnutls-cli[[:space:]]([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+) ]]
     112    then
     113        for i in {0..2}
     114        do
     115            if [ ${BASH_REMATCH[i+1]} -gt ${required_version[i]} ]
     116            then
     117                break;
     118            elif [ ${BASH_REMATCH[i+1]} -lt ${required_version[i]} ]
     119            then
     120                return 1
     121            fi
     122        done
     123        return 0
     124    else
     125        return 2
     126    fi
     127}
  • test/test-31_vhost_SNI_serveralias_match.bash

    r0e55076 rafebb9b  
    11#!/bin/bash
     2set -e
     3: ${srcdir:="."}
     4. ${srcdir}/common.bash
     5
     6require_gnutls_cli 3.5.12 || (echo "Using --sni-hostname requires gnutls-cli version 3.5.12 or newer"; exit 77)
    27${srcdir}/runtests t-31
  • test/test-32_vhost_SNI_serveralias_mismatch.bash

    r0e55076 rafebb9b  
    11#!/bin/bash
     2set -e
     3: ${srcdir:="."}
     4. ${srcdir}/common.bash
     5
     6require_gnutls_cli 3.5.12 || (echo "Using --sni-hostname requires gnutls-cli version 3.5.12 or newer"; exit 77)
    27${srcdir}/runtests t-32
  • test/test-33_vhost_SNI_serveralias_missinghost.bash

    r0e55076 rafebb9b  
    11#!/bin/bash
     2set -e
     3: ${srcdir:="."}
     4. ${srcdir}/common.bash
     5
     6require_gnutls_cli 3.5.12 || (echo "Using --sni-hostname requires gnutls-cli version 3.5.12 or newer"; exit 77)
    27${srcdir}/runtests t-33
Note: See TracChangeset for help on using the changeset viewer.