diff options
author | Feng, Bob C <bob.c.feng@intel.com> | 2019-01-23 09:27:30 +0800 |
---|---|---|
committer | Feng, Bob C <bob.c.feng@intel.com> | 2019-02-01 11:09:23 +0800 |
commit | 4a3773e5783d60f7142325667de2af53da662142 (patch) | |
tree | 79a7f74e08b3c39798c0934c1a4fc40682d31aa1 /BaseTools/Source | |
parent | 7aef7b7cbf16f79fb17c5ace98b1bc7f15bb90fa (diff) | |
download | edk2-4a3773e5783d60f7142325667de2af53da662142.zip edk2-4a3773e5783d60f7142325667de2af53da662142.tar.gz edk2-4a3773e5783d60f7142325667de2af53da662142.tar.bz2 |
BaseTools:Fixed Rsa issue and a set define issue.
ValueError: non-hexadecimal number found in
fromhex() arg at position 0
Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
Diffstat (limited to 'BaseTools/Source')
-rw-r--r-- | BaseTools/Source/Python/Rsa2048Sha256Sign/Rsa2048Sha256Sign.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/BaseTools/Source/Python/Rsa2048Sha256Sign/Rsa2048Sha256Sign.py b/BaseTools/Source/Python/Rsa2048Sha256Sign/Rsa2048Sha256Sign.py index d2bb0c9..c285a69 100644 --- a/BaseTools/Source/Python/Rsa2048Sha256Sign/Rsa2048Sha256Sign.py +++ b/BaseTools/Source/Python/Rsa2048Sha256Sign/Rsa2048Sha256Sign.py @@ -156,7 +156,7 @@ if __name__ == '__main__': PublicKeyHexString = Process.communicate()[0].split('=')[1].strip()
PublicKey = ''
while len(PublicKeyHexString) > 0:
- PublicKey = PublicKey + chr(int(PublicKeyHexString[0:2], 16))
+ PublicKey = PublicKey + PublicKeyHexString[0:2]
PublicKeyHexString=PublicKeyHexString[2:]
if Process.returncode != 0:
sys.exit(Process.returncode)
@@ -188,7 +188,7 @@ if __name__ == '__main__': #
args.OutputFile = open(args.OutputFileName, 'wb')
args.OutputFile.write(EFI_HASH_ALGORITHM_SHA256_GUID.bytes_le)
- args.OutputFile.write(PublicKey)
+ args.OutputFile.write(bytearray.fromhex(str(PublicKey)))
args.OutputFile.write(Signature)
args.OutputFile.write(args.InputFileBuffer)
args.OutputFile.close()
|