Fallback to js implementation on WebCrypto EdDSA key generation failure

Workaround random failures in WebKit (Linux).
This commit is contained in:
larabr 2024-09-04 17:46:40 +02:00
parent 2f185481a7
commit f36be640cc

View File

@ -48,7 +48,7 @@ export async function generate(algo) {
seed: b64ToUint8Array(privateKey.d, true)
};
} catch (err) {
if (err.name !== 'NotSupportedError') {
if (err.name !== 'NotSupportedError' && err.name !== 'OperationError') { // Temporary (hopefully) fix for WebKit on Linux
throw err;
}
const seed = getRandomBytes(getPayloadSize(algo));