please note that since I did not specify iv (which the docs says is optional) it was undefined in AES_CBC_decrypt_bytes but now gets converted to null because of the default value specified in the constructor. the constructor call super() which then calls:
this.AES_reset(key, iv, padding);
which calls:
this.AES_set_iv(iv);
inside AES_set_iv we have:
if (iv !== undefined) {
if (!is_bytes(iv)) {
throw new TypeError('unexpected iv type');
}
since 'iv' has been set to null we have is_bytes(null) which is false. the error is in the AES_CBC class which sets iv to null instead of leaving it undefined.
Hi, I just tried to upgrade from 0.0.11 to 0.22.0 and my code doesn't work anymore because of this error:
following the code it seems an error of asmycrypto. I call:
which calls
AES_CBC_decrypt_bytes(data, key, padding, iv)
, which calls:please note that since I did not specify
iv
(which the docs says is optional) it wasundefined
inAES_CBC_decrypt_bytes
but now gets converted tonull
because of the default value specified in the constructor. the constructor call super() which then calls:which calls:
inside
AES_set_iv
we have:since 'iv' has been set to
null
we haveis_bytes(null)
which is false. the error is in the AES_CBC class which sets iv to null instead of leaving it undefined.