[OTR-dev] proposed API change

Adam Fritzler mid at zigamorph.net
Tue Jan 25 22:26:17 EST 2005


I'm new here, but I just happened to see Ian's last post about making an
API change and wanted to recommend another.

libotr currently keeps at least two (at first glance at least, maybe
there's more) globals.  I think it's generally frowned upon to have
libraries with internal globals, and for the thing I'm working on it,
it is kind of annoying.  I'm working on a proxy solution[1] that
potentially has several entirely unrelated users coexisting.  In an
optimal environment, you of course wouldn't use a "public service" proxy
to do your crypto, but the APIs are such that it'd be a lot less
annoying if libotr didn't keep globals, even for the single-user case.
As it stands now, the private key files and fingerprint store must be
shared by anyone who uses the proxy!

I suggest making a "libotr context" struct that gets passed to all
functions, and moving the globals to there.  It's a straightforward
change, but I can make a patch if necessary. 

asf.


[1] See http://www.zigamorph.net/timps/






More information about the OTR-dev mailing list