summaryrefslogtreecommitdiffstats
path: root/BaseTools/Source/Python/Pkcs7Sign/Pkcs7Sign.py
diff options
context:
space:
mode:
Diffstat (limited to 'BaseTools/Source/Python/Pkcs7Sign/Pkcs7Sign.py')
-rw-r--r--BaseTools/Source/Python/Pkcs7Sign/Pkcs7Sign.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/BaseTools/Source/Python/Pkcs7Sign/Pkcs7Sign.py b/BaseTools/Source/Python/Pkcs7Sign/Pkcs7Sign.py
index 14e92a5d8b..a44781f2e8 100644
--- a/BaseTools/Source/Python/Pkcs7Sign/Pkcs7Sign.py
+++ b/BaseTools/Source/Python/Pkcs7Sign/Pkcs7Sign.py
@@ -19,6 +19,7 @@
'''
Pkcs7Sign
'''
+from __future__ import print_function
import os
import sys
@@ -75,9 +76,8 @@ if __name__ == '__main__':
#
# Create command line argument parser object
#
- parser = argparse.ArgumentParser(prog=__prog__, usage=__usage__, description=__copyright__, conflict_handler='resolve')
+ 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("--version", action='version', version=__version__)
group.add_argument("-e", action="store_true", dest='Encode', help='encode file')
group.add_argument("-d", action="store_true", dest='Decode', help='decode file')
parser.add_argument("-o", "--output", dest='OutputFile', type=str, metavar='filename', help="specify the output filename", required=True)
@@ -121,7 +121,7 @@ if __name__ == '__main__':
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].decode())
+ print(Version[0])
#
# Read input file into a buffer and save input filename
@@ -141,11 +141,11 @@ if __name__ == '__main__':
try:
if args.MonotonicCountStr.upper().startswith('0X'):
- args.MonotonicCountValue = (int)(args.MonotonicCountStr, 16)
+ args.MonotonicCountValue = (long)(args.MonotonicCountStr, 16)
else:
- args.MonotonicCountValue = (int)(args.MonotonicCountStr)
+ args.MonotonicCountValue = (long)(args.MonotonicCountStr)
except:
- args.MonotonicCountValue = (int)(0)
+ args.MonotonicCountValue = (long)(0)
if args.Encode:
#
@@ -251,9 +251,9 @@ if __name__ == '__main__':
sys.exit(1)
else:
if args.SignatureSizeStr.upper().startswith('0X'):
- SignatureSize = (int)(args.SignatureSizeStr, 16)
+ SignatureSize = (long)(args.SignatureSizeStr, 16)
else:
- SignatureSize = (int)(args.SignatureSizeStr)
+ SignatureSize = (long)(args.SignatureSizeStr)
if SignatureSize < 0:
print("ERROR: The value of option --signature-size can't be set to negative value!")
sys.exit(1)