Fix running mingw dhparam test under wine

The dhparam test was failing to properly handle line endings when
running a mingw configured build under wine.

Fixes #13557

Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/13923)
This commit is contained in:
Matt Caswell 2021-01-21 16:55:42 +00:00
parent fa2a7490c0
commit b1eae34bbe

View File

@ -36,11 +36,13 @@ sub checkdhparams {
#Text file. Check it looks like PEM
open(PEMFILE, '<', $file) or die $!;
if (my $firstline = <PEMFILE>) {
chomp($firstline);
$firstline =~ s/\R$//;
if ($firstline eq "-----BEGIN DH PARAMETERS-----") {
$pemtype = "PKCS3";
} elsif ($firstline eq "-----BEGIN X9.42 DH PARAMETERS-----") {
$pemtype = "X9.42";
} else {
$pemtype = "";
}
} else {
$pemtype = "";