]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/Rsa2048Sha256Sign/Rsa2048Sha256GenerateKeys.py
BaseTools: Move variable out of Global
[mirror_edk2.git] / BaseTools / Source / Python / Rsa2048Sha256Sign / Rsa2048Sha256GenerateKeys.py
index 41bcaa0437c516826fa852ce3278f1dd7aaccb4f..d8048d49a2aeab5b0a9b79424f7509b749e4a9f7 100644 (file)
@@ -51,7 +51,7 @@ if __name__ == '__main__':
   parser.add_argument("--public-key-hash-c", dest='PublicKeyHashCFile', type=argparse.FileType('wb'), help="specify the public key hash filename that is SHA 256 hash of 2048 bit RSA public key in C structure format")\r
   parser.add_argument("-v", "--verbose", dest='Verbose', action="store_true", help="increase output messages")\r
   parser.add_argument("-q", "--quiet", dest='Quiet', action="store_true", help="reduce output messages")\r
-  parser.add_argument("--debug", dest='Debug', type=int, metavar='[0-9]', choices=range(0,10), default=0, help="set debug level")\r
+  parser.add_argument("--debug", dest='Debug', type=int, metavar='[0-9]', choices=range(0, 10), default=0, help="set debug level")\r
 \r
   #\r
   # Parse command line arguments\r
@@ -80,7 +80,7 @@ if __name__ == '__main__':
     sys.exit(1)\r
     \r
   Version = Process.communicate()\r
-  if Process.returncode <> 0:\r
+  if Process.returncode != 0:\r
     print('ERROR: Open SSL command not available.  Please verify PATH or set OPENSSL_PATH')\r
     sys.exit(Process.returncode)\r
   print(Version[0])\r
@@ -103,7 +103,7 @@ if __name__ == '__main__':
       #\r
       Process = subprocess.Popen('%s genrsa -out %s 2048' % (OpenSslCommand, Item.name), stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)\r
       Process.communicate()\r
-      if Process.returncode <> 0:\r
+      if Process.returncode != 0:\r
         print('ERROR: RSA 2048 key generation failed')\r
         sys.exit(Process.returncode)\r
       \r
@@ -125,7 +125,7 @@ if __name__ == '__main__':
     #\r
     Process = subprocess.Popen('%s rsa -in %s -modulus -noout' % (OpenSslCommand, Item), stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)\r
     PublicKeyHexString = Process.communicate()[0].split('=')[1].strip()\r
-    if Process.returncode <> 0:\r
+    if Process.returncode != 0:\r
       print('ERROR: Unable to extract public key from private key')\r
       sys.exit(Process.returncode)\r
     PublicKey = ''\r
@@ -138,7 +138,7 @@ if __name__ == '__main__':
     Process = subprocess.Popen('%s dgst -sha256 -binary' % (OpenSslCommand), stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)\r
     Process.stdin.write (PublicKey)\r
     PublicKeyHash = PublicKeyHash + Process.communicate()[0]\r
-    if Process.returncode <> 0:\r
+    if Process.returncode != 0:\r
       print('ERROR: Unable to extract SHA 256 hash of public key')\r
       sys.exit(Process.returncode)\r
 \r