Hey, to put some context in place, I am writing teamspeak protocol in javascript (nodejs) with help of looking at some projects like splamys audiobot, ts3j or https://github.com/PankTrue/ts3client/tree/master/Ts3Client (I used this project to help me encrypt/decrypt packets with dummy keys) which is unfortunately outdated <3,1 so it does not support "initivexpand2".
I also took packet encryption/decryption functions from that ts3client and compiled them as an native addon as nodejs had some native support issues or I was simply dumb (more likely)
Now to the point, I fully implemented everything up to 3.2.2.1 Verify integrity and the issue lies with the Omega key and trying to import it to verify the integrity, but it always errors out no matter which library I use (crypto, node-forge, elliptic, p256 ...).
handleInitivexpand2 = (keyValue) => {
const omegaHEX = Buffer.from(keyValue.omega, "base64");
const publicKey = crypto.createPublicKey(omegaHEX); //obviously I also tried various parameters and different arguments
...
};
which results in
Error: error:0909006C:PEM routines:get_name:no start line
at Object.createPublicKey (node:internal/crypto/keys:607:12)
at TeamspeakProtocol.handleInitivexpand2 (/home/ts3/ts3.js:204:34)
at TeamspeakProtocol.handleCommand (/home/ts3/ts3.js:198:25)
at Socket.onMessage (/home/ts3/ts3.js:146:30)
at Socket.emit (node:events:513:28)
at UDP.onMessage [as onmessage] (node:dgram:930:8) {
library: 'PEM routines',
function: 'get_name',
reason: 'no start line',
code: 'ERR_OSSL_PEM_NO_START_LINE'
}
(even though error mentions PEM, input can be anything, the code can detect der, pem..., my key simply doesnt seem to be valid, or has extra bytes)
I do not expect you to work in NodeJS or find the solution for me, but could you give me some hint as what exactly the omega is? Is it some ASN,1 Public Key in DER format? Or what exactly it is, I would really appreciate as much information as possible, maybe even "steps".
I even tried to write this verification code in C/C++ with help of google and chatgpt (yes I know, I needed all the help I could) using libtomcrypto, cryptopp or openssl but all of my attempts failed, which means I am missing some information.
Thanks!