]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/Rsa2048Sha256Sign/Rsa2048Sha256Sign.py
BaseTools:Fixed Rsa issue and a set define issue.
[mirror_edk2.git] / BaseTools / Source / Python / Rsa2048Sha256Sign / Rsa2048Sha256Sign.py
index d2bb0c998cc7b77b75c2d787621ffa8d987ddd1a..c285a69ec0db0ae9b1a29f25546aef34e3a335f9 100644 (file)
@@ -156,7 +156,7 @@ if __name__ == '__main__':
   PublicKeyHexString = Process.communicate()[0].split('=')[1].strip()\r
   PublicKey = ''\r
   while len(PublicKeyHexString) > 0:\r
-    PublicKey = PublicKey + chr(int(PublicKeyHexString[0:2], 16))\r
+    PublicKey = PublicKey + PublicKeyHexString[0:2]\r
     PublicKeyHexString=PublicKeyHexString[2:]\r
   if Process.returncode != 0:\r
     sys.exit(Process.returncode)\r
@@ -188,7 +188,7 @@ if __name__ == '__main__':
     #\r
     args.OutputFile = open(args.OutputFileName, 'wb')\r
     args.OutputFile.write(EFI_HASH_ALGORITHM_SHA256_GUID.bytes_le)\r
-    args.OutputFile.write(PublicKey)\r
+    args.OutputFile.write(bytearray.fromhex(str(PublicKey)))\r
     args.OutputFile.write(Signature)\r
     args.OutputFile.write(args.InputFileBuffer)\r
     args.OutputFile.close()\r