Remove NOEXIST entries
[openssl.git] / util / incore
index e6e6ecfd8928158a3a7ffda3daae51c5f104795a..26fcf95033fca7d79db11080de5a35409b0ca299 100755 (executable)
@@ -1,7 +1,11 @@
-#!/usr/bin/env perl
-#
-# Copyright (c) 2011 The OpenSSL Project.
+#! /usr/bin/env perl
+# Copyright 2011-2016 The OpenSSL Project Authors. All Rights Reserved.
 #
+# Licensed under the OpenSSL license (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 script embeds fingerprint into ELF executable object, either
 # application binary or shared library.
 
@@ -382,7 +386,7 @@ if (!$legacy_mode) {
     }
 
     $FINGERPRINT_ascii_value
-                       = $exe->Lookup("FINGERPRINT_ascii_value")       or die;
+                       = $exe->Lookup("FINGERPRINT_ascii_value");
 
 }
 if ($FIPS_text_startX && $FIPS_text_endX) {
@@ -439,9 +443,12 @@ $fingerprint = FIPS_incore_fingerprint();
 
 if ($legacy_mode) {
     print unpack("H*",$fingerprint);
-} else {
+} elsif (defined($FINGERPRINT_ascii_value)) {
     seek(FD,$FINGERPRINT_ascii_value->{st_offset},0)   or die "$!";
     print FD unpack("H*",$fingerprint)                 or die "$!";
+} else {
+    seek(FD,$FIPS_signature->{st_offset},0)            or die "$!";
+    print FD $fingerprint                              or die "$!";
 }
 
 close (FD);