1*e7be843bSPierre Pronchery#! /usr/bin/env perl 2*e7be843bSPierre Pronchery# Copyright 2016-2024 The OpenSSL Project Authors. All Rights Reserved. 3*e7be843bSPierre Pronchery# 4*e7be843bSPierre Pronchery# Licensed under the Apache License 2.0 (the "License"). You may not use 5*e7be843bSPierre Pronchery# this file except in compliance with the License. You can obtain a copy 6*e7be843bSPierre Pronchery# in the file LICENSE in the source distribution or at 7*e7be843bSPierre Pronchery# https://www.openssl.org/source/license.html 8*e7be843bSPierre Pronchery 9*e7be843bSPierre Proncheryuse strict; 10*e7be843bSPierre Proncheryuse warnings; 11*e7be843bSPierre Pronchery 12*e7be843bSPierre Proncheryuse OpenSSL::Test qw/:DEFAULT bldtop_file srctop_file bldtop_dir with/; 13*e7be843bSPierre Proncheryuse OpenSSL::Test::Utils; 14*e7be843bSPierre Pronchery 15*e7be843bSPierre Proncherysetup("test_nocache"); 16*e7be843bSPierre Pronchery 17*e7be843bSPierre Proncheryplan tests => 4; 18*e7be843bSPierre Pronchery 19*e7be843bSPierre Proncheryok(run(app(["openssl", "list", "-mac-algorithms"], 20*e7be843bSPierre Pronchery stdout => "listout.txt")), 21*e7be843bSPierre Pronchery"List mac algorithms - default configuration"); 22*e7be843bSPierre Proncheryopen DATA, "listout.txt"; 23*e7be843bSPierre Proncherymy @match = grep /MAC/, <DATA>; 24*e7be843bSPierre Proncheryclose DATA; 25*e7be843bSPierre Proncheryok(scalar @match > 1 ? 1 : 0, "Several algorithms are listed - default configuration"); 26*e7be843bSPierre Pronchery 27*e7be843bSPierre Pronchery$ENV{OPENSSL_CONF} = bldtop_file("test", "nocache-and-default.cnf"); 28*e7be843bSPierre Proncheryok(run(app(["openssl", "list", "-mac-algorithms"], 29*e7be843bSPierre Pronchery stdout => "listout.txt")), 30*e7be843bSPierre Pronchery"List mac algorithms"); 31*e7be843bSPierre Proncheryopen DATA, "listout.txt"; 32*e7be843bSPierre Proncherymy @match = grep /MAC/, <DATA>; 33*e7be843bSPierre Proncheryclose DATA; 34*e7be843bSPierre Proncheryok(scalar @match > 1 ? 1 : 0, "Several algorithms are listed - nocache-and-default"); 35