Previously, generateKey() with an algorithm that has no key
generation, such as HKDF, threw InternalError synchronously instead
of returning a rejected Promise, unlike every other generateKey()
error.
Route the error through the common result path, as required by Web
Cryptography API section 14.3.6.
The issue was introduced in
50e7c9b2 (0.7.10).
default:
njs_vm_internal_error(vm, "not implemented generateKey"
"algorithm: \"%V\"", njs_algorithm_string(alg));
- return NJS_ERROR;
+ goto fail;
}
return njs_webcrypto_result(vm, &value, NJS_OK, retval);