Home | History | Annotate | Line # | Download | only in ssl-tests
      1  1.1  christos # -*- mode: perl; -*-
      2  1.1  christos # Copyright 2016-2021 The OpenSSL Project Authors. All Rights Reserved.
      3  1.1  christos #
      4  1.1  christos # Licensed under the Apache License 2.0 (the "License").  You may not use
      5  1.1  christos # this file except in compliance with the License.  You can obtain a copy
      6  1.1  christos # in the file LICENSE in the source distribution or at
      7  1.1  christos # https://www.openssl.org/source/license.html
      8  1.1  christos 
      9  1.1  christos 
     10  1.1  christos ## Test DTLS CertStatus messages
     11  1.1  christos 
     12  1.1  christos use strict;
     13  1.1  christos use warnings;
     14  1.1  christos 
     15  1.1  christos package ssltests;
     16  1.1  christos use OpenSSL::Test::Utils;
     17  1.1  christos 
     18  1.1  christos our $fips_mode;
     19  1.1  christos 
     20  1.1  christos our @tests = ();
     21  1.1  christos 
     22  1.1  christos our @tests_standard = (
     23  1.1  christos     {
     24  1.1  christos         name => "certstatus-good",
     25  1.1  christos         server => {
     26  1.1  christos             "CipherString" => "DEFAULT:\@SECLEVEL=0",
     27  1.1  christos             extra => {
     28  1.1  christos                 "CertStatus" => "GoodResponse"
     29  1.1  christos             },
     30  1.1  christos         },
     31  1.1  christos         client => {
     32  1.1  christos             "CipherString" => "DEFAULT:\@SECLEVEL=0",
     33  1.1  christos         },
     34  1.1  christos         test => {
     35  1.1  christos             "Method" => "DTLS",
     36  1.1  christos             "ExpectedResult" => "Success"
     37  1.1  christos         }
     38  1.1  christos     },
     39  1.1  christos     {
     40  1.1  christos         name => "certstatus-bad",
     41  1.1  christos         server => {
     42  1.1  christos             "CipherString" => "DEFAULT:\@SECLEVEL=0",
     43  1.1  christos             extra => {
     44  1.1  christos                 "CertStatus" => "BadResponse",
     45  1.1  christos             },
     46  1.1  christos         },
     47  1.1  christos         client => {
     48  1.1  christos             "CipherString" => "DEFAULT:\@SECLEVEL=0",
     49  1.1  christos         },
     50  1.1  christos         test => {
     51  1.1  christos             "Method" => "DTLS",
     52  1.1  christos             "ExpectedResult" => "ClientFail"
     53  1.1  christos         }
     54  1.1  christos     }
     55  1.1  christos );
     56  1.1  christos 
     57  1.1  christos our @tests_sctp = (
     58  1.1  christos     {
     59  1.1  christos         name => "certstatus-good",
     60  1.1  christos         server => {
     61  1.1  christos             "CipherString" => "DEFAULT:\@SECLEVEL=0",
     62  1.1  christos             extra => {
     63  1.1  christos                 "CertStatus" => "GoodResponse",
     64  1.1  christos             },
     65  1.1  christos         },
     66  1.1  christos         client => {
     67  1.1  christos             "CipherString" => "DEFAULT:\@SECLEVEL=0",
     68  1.1  christos         },
     69  1.1  christos         test => {
     70  1.1  christos             "Method" => "DTLS",
     71  1.1  christos             "UseSCTP" => "Yes",
     72  1.1  christos             "ExpectedResult" => "Success"
     73  1.1  christos         }
     74  1.1  christos     },
     75  1.1  christos     {
     76  1.1  christos         name => "certstatus-bad",
     77  1.1  christos         server => {
     78  1.1  christos             "CipherString" => "DEFAULT:\@SECLEVEL=0",
     79  1.1  christos             extra => {
     80  1.1  christos                 "CertStatus" => "BadResponse",
     81  1.1  christos             },
     82  1.1  christos         },
     83  1.1  christos         client => {
     84  1.1  christos             "CipherString" => "DEFAULT:\@SECLEVEL=0",
     85  1.1  christos         },
     86  1.1  christos         test => {
     87  1.1  christos             "Method" => "DTLS",
     88  1.1  christos             "UseSCTP" => "Yes",
     89  1.1  christos             "ExpectedResult" => "ClientFail"
     90  1.1  christos         }
     91  1.1  christos     },
     92  1.1  christos );
     93  1.1  christos 
     94  1.1  christos if  (!$fips_mode || !disabled("dtls1_2")) {
     95  1.1  christos     push @tests, @tests_standard;
     96  1.1  christos     push @tests, @tests_sctp unless disabled("sctp") || disabled("sock");
     97  1.1  christos }
     98