From 5ac7cdb1cb08cb19677c48c6a609090baf31aea8 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Tue, 15 Jan 2019 22:45:53 +0000 Subject: [PATCH] Make the AES availability cache actually cache things! Ahem. I went to all the effort of setting up a wrapper function that would store the result of the first call to aes_hw_available(), and managed to forget to make it set the flag that said it _had_ stored the result. So the underlying query function was being called every time. --- sshaes.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sshaes.c b/sshaes.c index f79ed6b1..ff777f27 100644 --- a/sshaes.c +++ b/sshaes.c @@ -134,8 +134,10 @@ static bool aes_hw_available_cached(void) { static bool initialised = false; static bool hw_available; - if (!initialised) + if (!initialised) { hw_available = aes_hw_available(); + initialised = true; + } return hw_available; }