BaseTools: Clean up source files
1. Do not use tab characters 2. No trailing white space in one line 3. All files must end with CRLF Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
This commit is contained in:
@ -1,11 +1,11 @@
|
||||
## @file
|
||||
# This tool can be used to generate new RSA 2048 bit private/public key pairs
|
||||
# in a PEM file format using OpenSSL command line utilities that are installed
|
||||
# This tool can be used to generate new RSA 2048 bit private/public key pairs
|
||||
# in a PEM file format using OpenSSL command line utilities that are installed
|
||||
# on the path specified by the system environment variable OPENSSL_PATH.
|
||||
# This tool can also optionally write one or more SHA 256 hashes of 2048 bit
|
||||
# public keys to a binary file, write one or more SHA 256 hashes of 2048 bit
|
||||
# public keys to a file in a C structure format, and in verbose mode display
|
||||
# one or more SHA 256 hashes of 2048 bit public keys in a C structure format
|
||||
# This tool can also optionally write one or more SHA 256 hashes of 2048 bit
|
||||
# public keys to a binary file, write one or more SHA 256 hashes of 2048 bit
|
||||
# public keys to a file in a C structure format, and in verbose mode display
|
||||
# one or more SHA 256 hashes of 2048 bit public keys in a C structure format
|
||||
# on STDOUT.
|
||||
# This tool has been tested with OpenSSL 1.0.1e 11 Feb 2013
|
||||
#
|
||||
@ -26,7 +26,7 @@ from __future__ import print_function
|
||||
|
||||
import os
|
||||
import sys
|
||||
import argparse
|
||||
import argparse
|
||||
import subprocess
|
||||
from Common.BuildVersion import gBUILD_VERSION
|
||||
|
||||
@ -35,14 +35,14 @@ from Common.BuildVersion import gBUILD_VERSION
|
||||
#
|
||||
__prog__ = 'Rsa2048Sha256GenerateKeys'
|
||||
__version__ = '%s Version %s' % (__prog__, '0.9 ' + gBUILD_VERSION)
|
||||
__copyright__ = 'Copyright (c) 2013 - 2014, Intel Corporation. All rights reserved.'
|
||||
__copyright__ = 'Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.'
|
||||
__usage__ = '%s [options]' % (__prog__)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
#
|
||||
# Create command line argument parser object
|
||||
#
|
||||
#
|
||||
parser = argparse.ArgumentParser(prog=__prog__, version=__version__, usage=__usage__, description=__copyright__, conflict_handler='resolve')
|
||||
group = parser.add_mutually_exclusive_group(required=True)
|
||||
group.add_argument("-o", "--output", dest='OutputFile', type=argparse.FileType('wb'), metavar='filename', nargs='*', help="specify the output private key filename in PEM format")
|
||||
@ -55,7 +55,7 @@ if __name__ == '__main__':
|
||||
|
||||
#
|
||||
# Parse command line arguments
|
||||
#
|
||||
#
|
||||
args = parser.parse_args()
|
||||
|
||||
#
|
||||
@ -75,18 +75,18 @@ if __name__ == '__main__':
|
||||
#
|
||||
try:
|
||||
Process = subprocess.Popen('%s version' % (OpenSslCommand), stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
|
||||
except:
|
||||
except:
|
||||
print('ERROR: Open SSL command not available. Please verify PATH or set OPENSSL_PATH')
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
Version = Process.communicate()
|
||||
if Process.returncode != 0:
|
||||
print('ERROR: Open SSL command not available. Please verify PATH or set OPENSSL_PATH')
|
||||
sys.exit(Process.returncode)
|
||||
print(Version[0])
|
||||
|
||||
|
||||
args.PemFileName = []
|
||||
|
||||
|
||||
#
|
||||
# Check for output file argument
|
||||
#
|
||||
@ -106,7 +106,7 @@ if __name__ == '__main__':
|
||||
if Process.returncode != 0:
|
||||
print('ERROR: RSA 2048 key generation failed')
|
||||
sys.exit(Process.returncode)
|
||||
|
||||
|
||||
#
|
||||
# Check for input file argument
|
||||
#
|
||||
@ -158,7 +158,7 @@ if __name__ == '__main__':
|
||||
for Item in PublicKeyHash:
|
||||
PublicKeyHashC = PublicKeyHashC + '0x%02x, ' % (ord(Item))
|
||||
PublicKeyHashC = PublicKeyHashC[:-2] + '}'
|
||||
|
||||
|
||||
#
|
||||
# Write SHA 256 of 2048 bit binary public key to public key hash C structure file
|
||||
#
|
||||
@ -167,7 +167,7 @@ if __name__ == '__main__':
|
||||
args.PublicKeyHashCFile.close ()
|
||||
except:
|
||||
pass
|
||||
|
||||
|
||||
#
|
||||
# If verbose is enabled display the public key in C structure format
|
||||
#
|
||||
|
Reference in New Issue
Block a user