You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
varoutbound_session=newOlm.OutboundGroupSession();outbound_session.create();// exchange these over a secure channelvarsession_id=group_session.session_id();varsession_key=group_session.session_key();varmessage_index=group_session.message_index();varinbound_session=newOlm.InboundGroupSession();inbound_session.create(message_index,session_key);varciphertext=outbound_session.encrypt("Hello");varplaintext=inbound_session.decrypt(ciphertext);
This refers to a nonexistent group_session variable, but I assume that is a typo and outbound_session is meant instead. However, executing those commands produces an error:
> Olm = require('@matrix-org/olm'); await Olm.init()
undefined
> var outbound_session = new Olm.OutboundGroupSession();
undefined
> outbound_session.create();
undefined
> var session_id = outbound_session.session_id();
undefined
> var session_key = outbound_session.session_key();
undefined
> var message_index = outbound_session.message_index();
undefined
> var inbound_session = new Olm.InboundGroupSession();
undefined
> inbound_session.create(message_index, session_key);
/home/raxod502/files/temp/matrix/node_modules/@matrix-org/olm/olm.js:19
if(ia)m=l?require("path").dirname(m)+"/":__dirname+"/",na=()=>{ma||(fs=require("fs"),ma=require("path"))},ja=function(b,c){na();b=ma.normalize(b);return fs.readFileSync(b,c?void 0:"utf8")},la=b=>{b=ja(b,!0);b.buffer||(b=new Uint8Array(b));return b},ka=(b,c,d)=>{na();b=ma.normalize(b);fs.readFile(b,function(e,f){e?d(e):c(f.buffer)})},1<process.argv.length&&process.argv[1].replace(/\\/g,"/"),process.argv.slice(2),process.on("uncaughtException",function(b){throw b;}),process.on("unhandledRejection",
^
Error: OLM.BAD_SESSION_KEY
at /home/raxod502/files/temp/matrix/node_modules/@matrix-org/olm/olm.js:78:251
at O.<anonymous> (/home/raxod502/files/temp/matrix/node_modules/@matrix-org/olm/olm.js:80:92)
at O.create (/home/raxod502/files/temp/matrix/node_modules/@matrix-org/olm/olm.js:96:290)
Node.js v20.15.1
What am I missing? This is matrix-olm installed from npm as linked above, release version 3.2.15.
The text was updated successfully, but these errors were encountered:
The following example code is given at https://www.npmjs.com/package/@matrix-org/olm:
This refers to a nonexistent
group_session
variable, but I assume that is a typo andoutbound_session
is meant instead. However, executing those commands produces an error:What am I missing? This is matrix-olm installed from npm as linked above, release version 3.2.15.
The text was updated successfully, but these errors were encountered: