I have been trying to port my GNU TLS bindings for Emacs to XEmacs [1]
and most things are trivial, but I don't really grok how to best
connect it into the "lstream" stuff in XEmacs (which Emacs doesn't
seem to have).
I think the best would be if GNU TLS was simply a lstream that could
be used against any underlaying lstream (TCP, process etc) but I'm not
sure it will be possible to implement. (Is it even possible to layer
lstreams?) The GNU TLS library wants as input a file descriptor. I
guess a GNU TLS lstream could create a new file descriptor and hand it
to GNU TLS and then act as a server to that file descriptor, calling
the lstream_* functions in the underlaying lstream to get/receive
data, but this sounds like work and will probably be tricky to debug
and produce complex code.
Another idea is to overload the "network" lstream with GNU TLS
functionality. This is more or less how it works in Emacs.
Does this make sense at all? I guess it might not, since I don't
really understand the design behind "lstream" (and the reason for it
in the first place).
Oh, I forgot to ask, does anyone think native TLS support in XEmacs
would be useful?
[1]
http://josefsson.org/securemacs/