Open imjma opened 4 months ago
Ok, I found where caused the different. v2 the splitKmsKey is hard coded the length
splitKmsKey(buffer) {
const dataKey = buffer.slice(0, 32);
const hmacKey = buffer.slice(32);
return {
dataKey, hmacKey,
};
},
v3 is using half length of key
const halveKey = (key: Uint8Array) => {
const half = Math.floor(key.length / 2);
return {
dataKey: key.slice(0, half),
hmacKey: key.slice(half),
};
};
the length of key in my localstack is 32, so it had different hmac after calculation. Is there any solution for this? Thanks
v2.0.2 code
v3.1.0 code
It throws the error
Anything is not correct when I upgrade from v2 to v3? Thanks