diff options
author | Mario Limonciello <mario.limonciello@amd.com> | 2023-08-29 10:07:58 -0500 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2023-09-15 18:29:45 +0800 |
commit | 2ad01eb5fad24627ab4e196dc54a220753b2238b (patch) | |
tree | bd4974b8a9afc4fe2953b50c5b90b00a70f10546 /tools/crypto/ccp/dbc.py | |
parent | 70f242c1933e9e881c13c31640bb6d56e8b7e738 (diff) | |
download | linux-2ad01eb5fad24627ab4e196dc54a220753b2238b.tar.gz linux-2ad01eb5fad24627ab4e196dc54a220753b2238b.tar.bz2 linux-2ad01eb5fad24627ab4e196dc54a220753b2238b.zip |
crypto: ccp - Fix sample application signature passing
When parameters are sent the PSP returns back it's own signature
for the application to verify the authenticity of the result.
Display this signature to the caller instead of the one the caller
sent.
Fixes: f40d42f116cf ("crypto: ccp - Add a sample python script for Dynamic Boost Control")
Fixes: febe3ed3222f ("crypto: ccp - Add a sample library for ioctl use")
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'tools/crypto/ccp/dbc.py')
-rw-r--r-- | tools/crypto/ccp/dbc.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/crypto/ccp/dbc.py b/tools/crypto/ccp/dbc.py index 3956efe7537a..2b91415b1940 100644 --- a/tools/crypto/ccp/dbc.py +++ b/tools/crypto/ccp/dbc.py @@ -57,7 +57,8 @@ def process_param(device, message, signature, data=None): if type(message) != tuple: raise ValueError("Expected message tuple") arg = ctypes.c_int(data if data else 0) - ret = lib.process_param(device.fileno(), message[0], signature, ctypes.pointer(arg)) + sig = ctypes.create_string_buffer(signature, len(signature)) + ret = lib.process_param(device.fileno(), message[0], ctypes.pointer(sig), ctypes.pointer(arg)) if ret: handle_error(ret) - return arg, signature + return arg.value, sig.value |