EVP: Fix evp_keymgmt_util_copy() for to->keymgmt == NULL
[oweals/openssl.git] / crypto / des / asm / crypt586.pl
index d94528ff7c28d506c4a61da2d15c1aadddcb39b0..e175b4f5515b294043ce4eca1bef97d60bf2baff 100644 (file)
@@ -1,19 +1,21 @@
-#!/usr/local/bin/perl
+#! /usr/bin/env perl
+# Copyright 1995-2020 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
+
 # The inner loop instruction sequence and the IP/FP modifications are from
-# Svend Olaf Mikkelsen <svolaf@inet.uni-c.dk>
-# I've added the stuff needed for crypt() but I've not worried about making
-# things perfect.
-#
+# Svend Olaf Mikkelsen
 
 $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
 push(@INC,"${dir}","${dir}../../perlasm");
 require "x86asm.pl";
 
-$output=pop;
-open STDOUT,">$output";
+$output=pop and open STDOUT,">$output";
 
-&asm_init($ARGV[0],"crypt586.pl");
+&asm_init($ARGV[0]);
 
 $L="edi";
 $R="esi";
@@ -22,7 +24,7 @@ $R="esi";
 &fcrypt_body("fcrypt_body");
 &asm_finish();
 
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";
 
 sub fcrypt_body
        {
@@ -108,7 +110,7 @@ sub D_ENCRYPT
        &and(   $u,             "0xfcfcfcfc"    );              # 2
        &xor(   $tmp1,          $tmp1);                         # 1
        &and(   $t,             "0xcfcfcfcf"    );              # 2
-       &xor(   $tmp2,          $tmp2); 
+       &xor(   $tmp2,          $tmp2);
        &movb(  &LB($tmp1),     &LB($u) );
        &movb(  &LB($tmp2),     &HB($u) );
        &rotr(  $t,             4               );
@@ -172,7 +174,7 @@ sub IP_new
        &R_PERM_OP($l,$tt,$r,14,"0x33333333",$r);
        &R_PERM_OP($tt,$r,$l,22,"0x03fc03fc",$r);
        &R_PERM_OP($l,$r,$tt, 9,"0xaaaaaaaa",$r);
-       
+
        if ($lr != 3)
                {
                if (($lr-3) < 0)