cryptodotis / irssi-otr

LibOTR functionality in Irssi.
GNU General Public License v2.0
183 stars 24 forks source link

After a key has been generated, it is not possible to create a new one #47

Open dehekkendekrekker opened 10 years ago

dehekkendekrekker commented 10 years ago

To reproduce: 1) Start irssi 2) /load otr 3) /otr genkey foo@bar 4) check with with "ps -eLf|grep irssi" that there are two irssi threads. 5) You will not get a confirmation message that key generation has completed. 6) check with with "ps -eLf|grep irssi" that there is one irssi thread. 7) /otr genkey foo@bar 8) Observe that a message appears that keygen has completed, and a new one is started 9) check with with "ps -eLf|grep irssi" that there is one irssi thread.

dehekkendekrekker commented 10 years ago

This issue is related to #24 and #46

dgoulet commented 9 years ago

(Oh wow... I totally failed to reply before.... Really sorry)

Right, the key generation is a bit wanky and by that I mean that the irssi plugin uses a thread to start the key generation and that thread can not notify the main irssi process of completion else we end up in bad memory territory.

So the way to go around that limitation is that every "otr events" and private message sent/received, the plugin checks if the key generation thread is done and if so will print the completion message in the main process.

Double key generation should work, I just tested out, the previous key will be replaced. Can you confirm that the otr.key file doesn't change with your use case?