forked from openssl/openssl
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This is a test for nocache provider behavior
A follow-up to openssl#26038
- Loading branch information
Showing
3 changed files
with
61 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
openssl_conf = openssl_init | ||
|
||
# Comment out the next line to ignore configuration errors | ||
config_diagnostics = 1 | ||
|
||
[openssl_init] | ||
providers = provider_sect | ||
|
||
[provider_sect] | ||
test = test_sect | ||
default = default_sect | ||
|
||
[test_sect] | ||
module = ../test/p_test.so | ||
activate = true | ||
|
||
[default_sect] | ||
activate = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#! /usr/bin/env perl | ||
# Copyright 2016-2024 The OpenSSL Project Authors. All Rights Reserved. | ||
# | ||
# Licensed under the Apache License 2.0 (the "License"). You may not use | ||
# this file except in compliance with the License. You can obtain a copy | ||
# in the file LICENSE in the source distribution or at | ||
# https://www.openssl.org/source/license.html | ||
|
||
use strict; | ||
use warnings; | ||
|
||
use OpenSSL::Test qw/:DEFAULT bldtop_file srctop_file bldtop_dir with/; | ||
use OpenSSL::Test::Utils; | ||
|
||
setup("test_nocache"); | ||
|
||
plan tests => 4; | ||
|
||
ok(run(app(["openssl", "list", "-mac-algorithms"], | ||
stdout => "listout.txt")), | ||
"List mac algorithms - default configuration"); | ||
open DATA, "listout.txt"; | ||
my @match = grep /MAC/, <DATA>; | ||
close DATA; | ||
ok(scalar @match > 1 ? 1 : 0, "Several algorithms are listed - default configuration"); | ||
|
||
$ENV{OPENSSL_CONF} = bldtop_file("test", "nocache-and-default.cnf"); | ||
ok(run(app(["openssl", "list", "-mac-algorithms"], | ||
stdout => "listout.txt")), | ||
"List mac algorithms"); | ||
open DATA, "listout.txt"; | ||
my @match = grep /MAC/, <DATA>; | ||
close DATA; | ||
ok(scalar @match > 1 ? 1 : 0, "Several algorithms are listed - nocache-and-default"); |