aboutsummaryrefslogtreecommitdiff
path: root/rpc_misc.c
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2016-06-23 23:06:11 -0400
committerRob Austein <sra@hactrn.net>2016-06-23 23:06:11 -0400
commitc521d7f590ecafaaed378c20e03aa657361f1638 (patch)
tree9590705b131f6ae2ade20598dbeaa28977cf7f73 /rpc_misc.c
parentbf50cf8a7817274a7fb5e02d09a53598e168e22c (diff)
ks_flash returns all-ones instead of all-zeros for "blank" memory, cope.
This will need refactoring once we have a proper test for whether the HSM is initializing after receiving a fresh software load.
Diffstat (limited to 'rpc_misc.c')
-rw-r--r--rpc_misc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/rpc_misc.c b/rpc_misc.c
index 18f4083..8176c6f 100644
--- a/rpc_misc.c
+++ b/rpc_misc.c
@@ -210,7 +210,10 @@ static hal_error_t set_pin(const hal_client_handle_t client,
hal_ks_pin_t p = *pp;
- if (p.iterations == 0)
+ /*
+ * Another all-zeros vs all-ones disagreement between drivers.
+ */
+ if (p.iterations == 0x00000000 || p.iterations == 0xffffffff)
p.iterations = HAL_PIN_DEFAULT_ITERATIONS;
if ((err = hal_get_random(NULL, p.salt, sizeof(p.salt))) != HAL_OK ||