1*b0d17251Schristos#! /usr/bin/env perl 2*b0d17251Schristos 3*b0d17251Schristos# Copyright 2018-2021 The OpenSSL Project Authors. All Rights Reserved. 4*b0d17251Schristos# 5*b0d17251Schristos# Licensed under the Apache License 2.0 (the "License"). You may not use 6*b0d17251Schristos# this file except in compliance with the License. You can obtain a copy 7*b0d17251Schristos# in the file LICENSE in the source distribution or at 8*b0d17251Schristos# https://www.openssl.org/source/license.html 9*b0d17251Schristos 10*b0d17251Schristosuse strict; 11*b0d17251Schristos 12*b0d17251Schristosuse OpenSSL::Test qw(:DEFAULT srctop_file); 13*b0d17251Schristosuse OpenSSL::Test::Utils; 14*b0d17251Schristos 15*b0d17251Schristossetup("test_algorithmid"); 16*b0d17251Schristos 17*b0d17251Schristos# eecert => cacert 18*b0d17251Schristosmy %certs_info = 19*b0d17251Schristos ( 20*b0d17251Schristos 'ee-cert' => 'ca-cert', 21*b0d17251Schristos 'ee-cert2' => 'ca-cert2', 22*b0d17251Schristos 23*b0d17251Schristos # 'ee-pss-sha1-cert' => 'ca-cert', 24*b0d17251Schristos # 'ee-pss-sha256-cert' => 'ca-cert', 25*b0d17251Schristos # 'ee-pss-cert' => 'ca-pss-cert', 26*b0d17251Schristos # 'server-pss-restrict-cert' => 'rootcert', 27*b0d17251Schristos 28*b0d17251Schristos ( 29*b0d17251Schristos disabled('ec') 30*b0d17251Schristos ? () 31*b0d17251Schristos : ( 32*b0d17251Schristos 'ee-cert-ec-explicit' => 'ca-cert-ec-named', 33*b0d17251Schristos 'ee-cert-ec-named-explicit' => 'ca-cert-ec-explicit', 34*b0d17251Schristos 'ee-cert-ec-named-named' => 'ca-cert-ec-named', 35*b0d17251Schristos # 'server-ed448-cert' => 'root-ed448-cert' 36*b0d17251Schristos 'server-ecdsa-brainpoolP256r1-cert' => 'rootcert', 37*b0d17251Schristos ) 38*b0d17251Schristos ) 39*b0d17251Schristos ); 40*b0d17251Schristosmy @pubkeys = 41*b0d17251Schristos ( 42*b0d17251Schristos 'testrsapub', 43*b0d17251Schristos disabled('dsa') ? () : 'testdsapub', 44*b0d17251Schristos disabled('ec') ? () : qw(testecpub-p256 tested25519pub tested448pub) 45*b0d17251Schristos ); 46*b0d17251Schristosmy @certs = sort keys %certs_info; 47*b0d17251Schristos 48*b0d17251Schristosplan tests => 49*b0d17251Schristos scalar @certs 50*b0d17251Schristos + scalar @pubkeys; 51*b0d17251Schristos 52*b0d17251Schristosforeach (@certs) { 53*b0d17251Schristos ok(run(test(['algorithmid_test', '-x509', 54*b0d17251Schristos srctop_file('test', 'certs', "$_.pem"), 55*b0d17251Schristos srctop_file('test', 'certs', "$certs_info{$_}.pem")]))); 56*b0d17251Schristos} 57*b0d17251Schristos 58*b0d17251Schristosforeach (sort @pubkeys) { 59*b0d17251Schristos ok(run(test(['algorithmid_test', '-spki', srctop_file('test', "$_.pem")]))); 60*b0d17251Schristos} 61