diff options
author | Paul Selkirk <paul@psgd.org> | 2019-04-02 00:58:41 -0400 |
---|---|---|
committer | Paul Selkirk <paul@psgd.org> | 2019-04-02 00:58:41 -0400 |
commit | 6b0c67ace3678325443aa21a32b2b10daa018e27 (patch) | |
tree | 65d49218a1c57ca67aff2859a4e5a4530b7daeaa /tests | |
parent | 5e420cb84a401a04557d63a60d30f42699270509 (diff) |
Small cleanups in RPC code, e.g. to support null arguments.
- Add support for null pointer arguments in RPCs for get_digest_algorithm_id
and get_public_key. This is years overdue, and would have obviated the need
for get_public_key_len as a separate RPC.
- Refactor pkey_local_get_public_key_len in terms of pkey_local_get_public_key.
- Add more parameter sanity checks to rpc_api.c.
- Add a len_max parameter to hal_xdr_decode_variable_opaque, rather than
having len be an in/out parameter. This brings xdr slightly more in line
with the rest of the code base (again after literal years), and slightly
simplifies several calls in rpc_client.c.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test-xdr.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/test-xdr.c b/tests/test-xdr.c index eedf48d..f084e01 100644 --- a/tests/test-xdr.c +++ b/tests/test-xdr.c @@ -95,8 +95,8 @@ int main(int argc, char *argv[]) printf("\nhal_xdr_decode_variable_opaque:\n"); readptr = buf; while (readptr < bufptr) { - size_t len = bufptr - readptr; - if ((ret = hal_xdr_decode_variable_opaque(&readptr, limit, readbuf, &len)) != HAL_OK) { + size_t len; + if ((ret = hal_xdr_decode_variable_opaque(&readptr, limit, readbuf, &len, bufptr - readptr)) != HAL_OK) { printf("%s\n", hal_error_string(ret)); break; } |