1#! /usr/bin/env perl 2# Copyright 2020 The OpenSSL Project Authors. All Rights Reserved. 3# 4# Licensed under the Apache License 2.0 (the "License"). You may not use 5# this file except in compliance with the License. You can obtain a copy 6# in the file LICENSE in the source distribution or at 7# https://www.openssl.org/source/license.html 8 9 10use strict; 11use warnings; 12 13use File::Spec; 14use OpenSSL::Test::Utils; 15use OpenSSL::Test qw/:DEFAULT srctop_file/; 16 17setup("test_rusext"); 18 19plan tests => 7; 20 21require_ok(srctop_file('test', 'recipes', 'tconversion.pl')); 22my $pem = srctop_file("test/certs", "grfc.pem"); 23my $out_msb = "grfc.msb"; 24my $out_utf8 = "grfc.utf8"; 25 26ok(run(app(["openssl", "x509", "-text", "-in", $pem, "-out", $out_msb, 27 "-nameopt", "esc_msb", "-certopt", "no_pubkey"]))); 28is(cmp_text($out_msb, srctop_file('test', 'recipes', '25-test_rusext_data', 'grfc.msb')), 29 0, 'Comparing esc_msb output'); 30ok(run(app(["openssl", "x509", "-text", "-in", $pem, "-out", $out_utf8, 31 "-nameopt", "utf8", "-certopt", "no_pubkey"]))); 32is(cmp_text($out_utf8, srctop_file('test', 'recipes', '25-test_rusext_data', 'grfc.utf8')), 33 0, 'Comparing utf8 output'); 34ok(run(app(["openssl", "x509", "-text", "-in", $pem, "-out", $out_utf8, 35 "-certopt", "no_pubkey"]))); 36is(cmp_text($out_utf8, srctop_file('test', 'recipes', '25-test_rusext_data', 'grfc.utf8')), 37 0, 'Comparing cyrillic utf8 output by default'); 38