From fed8f021f29adcfe12c111455ff22a4c58b4371d Mon Sep 17 00:00:00 2001 From: Ylian Saint-Hilaire Date: Sun, 29 Oct 2023 18:01:37 -0700 Subject: [PATCH] Fix recoverable exception in mesh accelerator. --- meshaccelerator.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/meshaccelerator.js b/meshaccelerator.js index c492f92b..5e663383 100644 --- a/meshaccelerator.js +++ b/meshaccelerator.js @@ -32,7 +32,20 @@ module.exports.processMessage = function(message) { const sign = crypto.createSign('SHA384'); sign.end(Buffer.from(message.data, 'binary')); process.send(sign.sign(message.key).toString('binary')); - } catch (e) { process.send(null); } + } catch (ex) { + // If this exception happens, try again. + if (ex.code == 'ERR_OSSL_DSO_COULD_NOT_LOAD_THE_SHARED_LIBRARY') { + try { + const sign = crypto.createSign('SHA384'); + sign.end(Buffer.from(message.data, 'binary')); + process.send(sign.sign(message.key).toString('binary')); + } catch (ex) { + process.send(null); + } + } else { + process.send(null); + } + } break; } case 'setState': {