return NJS_ERROR;
}
- if (njs_slow_path(length == 0 || length > 128)) {
+ if (njs_slow_path(length < 1 || length > 128)) {
njs_vm_type_error(vm, "AES-CTR algorithm.length must be between "
"1 and 128");
return NJS_ERROR;
return JS_EXCEPTION;
}
- if (length == 0 || length > 128) {
+ if (length < 1 || length > 128) {
JS_ThrowTypeError(cx, "AES-CTR algorithm.length must be between "
"1 and 128");
return JS_EXCEPTION;
{ name: "AES-CTR", data: "aabbcc", key: "001122330011223300112233001122330011223300112233" },
{ name: "AES-CTR", data: "aabbccdd", length: 129,
exception: "TypeError: AES-CTR algorithm.length must be between 1 and 128" },
+ { name: "AES-CTR", data: "aabbccdd", length: -1,
+ exception: "TypeError: AES-CTR algorithm.length must be between 1 and 128" },
+ { name: "AES-CTR", data: "aabbccdd", length: -4294967291,
+ exception: "TypeError: AES-CTR algorithm.length must be between 1 and 128" },
{ name: "AES-CTR", data: "", length: 128 },
{ name: "AES-CTR", data: "", counter: "ffffffffffffffffffffffffffffffff", length: 128 },