aboutsummaryrefslogtreecommitdiffstats
path: root/recipes-security/optee-imx/optee-test/0001-use-python3-instead-of-python.patch
blob: 20f190af9cd1083c2eaa4236311cf59dd680548f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
From 6271160639002a2580d80b75b5397a96d56329f2 Mon Sep 17 00:00:00 2001
From: Scott Branden <scott.branden@broadcom.com>
Date: Fri, 27 Dec 2019 12:54:28 -0800
Subject: [PATCH] use python3 instead of python

use python3 instead of python as python2 is EOL January 2020.

Signed-off-by: Scott Branden <scott.branden@broadcom.com>
Reviewed-by: Jerome Forissier <jerome@forissier.org>
Tested-by: Jerome Forissier <jerome@forissier.org> (QEMU, CFG_GCM_NIST_VECTORS=y)
Upstream-Status: Backport from v3.8.0
---
 scripts/file_to_c.py       | 4 ++--
 scripts/rsp_to_gcm_test.py | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/scripts/file_to_c.py b/scripts/file_to_c.py
index ae16f52..b4ce2a2 100755
--- a/scripts/file_to_c.py
+++ b/scripts/file_to_c.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 # SPDX-License-Identifier: BSD-2-Clause
 #
 # Copyright (c) 2018, Linaro Limited
@@ -29,7 +29,7 @@ def main():
 
     f.write("const uint8_t " + args.name + "[] = {\n")
     i = 0
-    for x in array.array("B", inf.read()):
+    for x in array.array("B", map(ord, (inf.read()))):
         f.write("0x" + '{0:02x}'.format(x) + ",")
         i = i + 1
         if i % 8 == 0:
diff --git a/scripts/rsp_to_gcm_test.py b/scripts/rsp_to_gcm_test.py
index 0543541..e4418be 100755
--- a/scripts/rsp_to_gcm_test.py
+++ b/scripts/rsp_to_gcm_test.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 
 modes = {'encrypt': 0, 'decrypt': 1}
 
-- 
2.7.4