<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.3.2" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>

<channel>
	<title>Delta XMPP Project &#187; Psi</title>
	<link>http://delta.affinix.com</link>
	<description>Building an XMPP/Jabber Platform</description>
	<pubDate>Wed, 23 Apr 2008 23:22:50 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.2</generator>
	<language>en</language>
			<item>
		<title>Installing the StartCom root into Debian/Ubuntu</title>
		<link>http://delta.affinix.com/2007/09/17/startcom-and-debian-ubuntu/</link>
		<comments>http://delta.affinix.com/2007/09/17/startcom-and-debian-ubuntu/#comments</comments>
		<pubDate>Tue, 18 Sep 2007 01:50:08 +0000</pubDate>
		<dc:creator>justin</dc:creator>
		
		<category><![CDATA[Psi]]></category>

		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://delta.affinix.com/2007/09/17/startcom-and-debian-ubuntu/</guid>
		<description><![CDATA[For whatever reason, the ca-certificates package of Debian/Ubuntu does not contain the StartCom root certificate.  This may have changed by the time you read this article, but otherwise you&#8217;ll probably want to add this root yourself.  Here is how to do it the &#8220;right way&#8221;.
First, securely get a hold of the StartCom root [...]]]></description>
			<content:encoded><![CDATA[<p>For whatever reason, the ca-certificates package of Debian/Ubuntu does not contain the StartCom root certificate.  This may have changed by the time you read this article, but otherwise you&#8217;ll probably want to add this root yourself.  Here is how to do it the &#8220;right way&#8221;.</p>
<p>First, securely get a hold of the StartCom root certificate.  One easy way to do this is to use Firefox 2.0 to visit <a href="https://cert.startcom.org/?app=1">this page</a>, and right-click save-as on the StartCom Root CA link.  It is important that you save-as on the file, because otherwise Firefox will try to import the CA into its own storage and not actually save it to a file like you want.  It seems like it would be even simpler to just extract the StartCom root from Firefox&#8217;s own storage, since it is already present on your local machine, but I can&#8217;t figure out how to do that.  Save the file as startcom.crt.</p>
<p>Next:</p>
<pre><code>sudo mkdir -p /usr/share/ca-certificates/startcom
sudo cp startcom.crt /usr/share/ca-certificates/startcom/
sudo dpkg-reconfigure ca-certificates</code></pre>
<p>In the reconfigure application, choose Ask mode, and select the startcom certificate to have it enabled.  You might also take this moment to disable the weird CAs in there.  I have no idea how or why Debian decided to trust the CAs that they do.  Personally, I enable only the mozilla certs and the startcom cert.</p>
<p>That&#8217;s all!  StartCom is installed.  Now it should work with Psi and Subversion, among other programs.</p>
<p>(Credit to <a href="http://www.amazon.com/gp/blog/post/PLNK18Q0JHUO2XROP">Ralf Hildebrandt</a> for the dpkg-reconfigure hint.)</p>
]]></content:encoded>
			<wfw:commentRss>http://delta.affinix.com/2007/09/17/startcom-and-debian-ubuntu/feed/</wfw:commentRss>
		</item>
		<item>
		<title>QCA and Smartcards</title>
		<link>http://delta.affinix.com/2007/08/21/qca-and-smartcards/</link>
		<comments>http://delta.affinix.com/2007/08/21/qca-and-smartcards/#comments</comments>
		<pubDate>Tue, 21 Aug 2007 09:05:49 +0000</pubDate>
		<dc:creator>justin</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<category><![CDATA[Psi]]></category>

		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://delta.affinix.com/2007/08/21/qca-and-smartcards/</guid>
		<description><![CDATA[In public key cryptography, it is critical to keep your private key, well, private.  One of the major features of QCA 2.0 is support for smartcard devices, and these devices allow convenient and safe storage of private keys.  Smartcards perform cryptographic operations in hardware, never revealing the keys to the requesting computer.  [...]]]></description>
			<content:encoded><![CDATA[<p>In public key cryptography, it is critical to keep your private key, well, <em>private</em>.  One of the major features of QCA 2.0 is support for smartcard devices, and these devices allow convenient and safe storage of private keys.  Smartcards perform cryptographic operations in hardware, never revealing the keys to the requesting computer.  Traditionally, smartcards have a &#8220;credit card&#8221; form-factor and require a reader device, but today there also exist smartcards which have the form-factor of a USB mass storage device (they are not &#8220;cards&#8221; at all).  The term &#8220;smartcard&#8221; can apply to either kind of device, as can &#8220;smart token&#8221; or simply &#8220;token&#8221;.</p>
<p>Since QCA has a pluggable backend system, changing out software algorithms for hardware calls is easily possible by writing a proper plugin.  However, there is much more to using smartcards than simply substituting a private key call.  Smartcards may not always be present in the computer, and may contain many stored keys.  QCA offers complete smartcard support, allowing you to discover available smartcards, track inserts and removals, enumerate keys on the devices and prompt for PINs, all using a friendly Qt-based API.</p>
<p>The QCA distribution contains an example application called CMS Signer.  It exists mainly to demonstrate using keys from smartcards in a GUI application, although it also works with on-disk keys.  CMS, or Cryptographic Message Syntax, is a standard format for storing various types of secure payloads.  In the case of the CMS Signer application, the CMS format is used to store digital signature data created from X.509 certificates (fun fact: S/MIME email consists of CMS-formatted parts wrapped in MIME).  It is possible to configure and use smartcards completely within the CMS Signer GUI, and I&#8217;ll demonstrate this below.</p>
<p>First, we need a smartcard.  For this article, I&#8217;m using an ePass2000 USB device.</p>
<p><img src="/image/cmssigner/epass.png" /></p>
<p>I don&#8217;t necessarily recommend it, as I&#8217;ve not managed to get it to work under non-Windows operating systems.  However, it is cute and it works, and the Windows drivers are available online for free (I find this very convenient, as I&#8217;ve managed to misplace the drivers to some of my other smartcard devices&#8230;).  Most important of all though, is that it supports the PKCS#11 standard. This means the device should be compatible with all other software also supporting the PKCS#11 standard, such as Firefox and QCA.</p>
<p>In CMS Signer, there is a place to perform PKCS#11 configuration.</p>
<p><img src="/image/cmssigner/pic1.png" /></p>
<p>In here, we must set the path to the PKCS#11 DLL file (on other platforms this may be a .so or .dylib file).  For the ePass2000, this is <strong>C:\WINDOWS\system32\ep2pk11.dll</strong>.  There are also some other low-level options you can set, but generally the defaults should be fine.  The PKCS#11 provider plugin for QCA was written by Alon Bar-Lev, and it makes use of his pkcs11-helper library, which is where most of these options come from.</p>
<p><img src="/image/cmssigner/pic3.png" /></p>
<p>It is unfortunate that this configuration step is needed at all, but there is currently no known or standard way to locate a user&#8217;s desired PKCS#11 DLL files.  You would have to perform a very similar configuration step in Firefox as well.</p>
<p>Now that the drivers are configured, it should be possible to browse for our smartcard.</p>
<p><img src="/image/cmssigner/pic4.png" /></p>
<p>We can then choose a key:</p>
<p><img src="/image/cmssigner/pic5.png" /></p>
<p>The key is then imported into a local keyring.  It is important to keep in mind that only the public portion of the key is imported.  The private portion is not extractable from the smartcard.  We can select this key to be used for signing, and enter some data to sign:</p>
<p><img src="/image/cmssigner/pic6.png" /></p>
<p>&#8230; and hit the Sign button, which prompts for a PIN:</p>
<p><img src="/image/cmssigner/pic7.png" /></p>
<p>&#8230; and now the CMS-format signature is generated:</p>
<p><img src="/image/cmssigner/pic8.png" /></p>
<p>CMS Signer can also perform signature verification, as long as the Text and Signature fields are filled.  Since they are filled at this time, we can immediately verify the signature after signing.</p>
<p><img src="/image/cmssigner/pic9.png" /></p>
<p>Looks good. <img src='http://delta.affinix.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Both Psi 0.11 and KDE 4 use QCA.  In the future, expect to see smartcard support in these projects.</p>
]]></content:encoded>
			<wfw:commentRss>http://delta.affinix.com/2007/08/21/qca-and-smartcards/feed/</wfw:commentRss>
		</item>
		<item>
		<title>In-place builds</title>
		<link>http://delta.affinix.com/2006/10/22/in-place-builds/</link>
		<comments>http://delta.affinix.com/2006/10/22/in-place-builds/#comments</comments>
		<pubDate>Mon, 23 Oct 2006 04:53:41 +0000</pubDate>
		<dc:creator>justin</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<category><![CDATA[Psi]]></category>

		<guid isPermaLink="false">http://delta.affinix.com/2006/10/22/in-place-builds/</guid>
		<description><![CDATA[It may not be widely known that Psi (as well as QCA and Qt) can be built and used &#8220;in-place&#8221;.  This means you configure and make, but there is no &#8216;make install&#8217; step.  This can be convenient if you don&#8217;t want to install these packages system-wide.
Of course, you can always just set a [...]]]></description>
			<content:encoded><![CDATA[<p>It may not be widely known that Psi (as well as QCA and Qt) can be built and used &#8220;in-place&#8221;.  This means you configure and make, but there is no &#8216;make install&#8217; step.  This can be convenient if you don&#8217;t want to install these packages system-wide.</p>
<p>Of course, you can always just set a prefix within your home directory (or other user-writable area) when building sources if you don&#8217;t wish to install system-wide.  However, in-place builds are extra convenient for the developer, as it saves the trouble of having to do &#8216;make install&#8217; every time something is changed.</p>
<p>So while this is not anything new for Psi development, and nor is the idea particularly revolutionary, it might be something you didn&#8217;t know you could do and so I&#8217;m documenting it here.  Personally, I develop everything in-place.</p>
<p><b>Qt</b>:</p>
<p>Qt 3 is/was always built in-place.  You extract it where you want it to end up, configure and make.  There is no &#8216;make install&#8217; step.  With Qt 4, they changed it to behave more like other packages.  Now the prefix defaults to somewhere in /usr/local, and there&#8217;s a &#8216;make install&#8217;.  However, the old way is still supported if you pass the directory of where you extracted Qt to -prefix.  That is:</p>
<pre><code>$ tar zxvf qt-x11-opensource-src-[version].tar.gz
$ cd qt-x11-opensource-src-[version]
$ ./configure -prefix $PWD
$ make</code></pre>
<p>This is not a hack or a way to trick Qt.  It is actually a supported feature, and when Qt is done configuring you&#8217;ll notice it says:</p>
<pre><code>Qt is now configured for building. Just run 'make'.
Once everything is built, Qt is installed.
You should not run 'make install'.</code></pre>
<p>Another feature of Qt 4 is that qmake is aware of the installation location.  This allows it to locate the necessary files it needs without QTDIR.  Additionally, all subtools (e.g. moc) are invoked using their full path.  This means you don&#8217;t even need the Qt 4 bin directory in your PATH.  Finally, if you&#8217;re using gcc, qmake also uses rpath when linking.  This means you don&#8217;t need Qt 4&#8217;s lib directory to be specified anywhere either.  No need for /etc/ld.so.conf or LD_LIBRARY_PATH.  You simply build Qt, go into your project directory, and run qmake.</p>
<pre><code>$ cd /path/to/myproject
$ /path/to/qt/bin/qmake
$ make</code></pre>
<p><b>QCA</b>:</p>
<p>Like Qt, QCA (as of 2.0 beta2, I believe) supports in-place builds by pointing prefix to $PWD.</p>
<pre><code>$ ./configure --prefix=$PWD</code></pre>
<p>Note: If you&#8217;re building against an in-place Qt, and you didn&#8217;t put Qt&#8217;s bin directory in your PATH, then you&#8217;re going to have to tell configure where Qt is.  Do this with &#8211;qtdir.  For example:</p>
<pre><code>$ ./configure --prefix=$PWD --qtdir=/path/to/qt</code></pre>
<p>Unlike Qt, QCA doesn&#8217;t use rpath.  This may change in the future, but for now you will need to put QCA&#8217;s lib directory in your LD_LIBRARY_PATH if you want to use it in-place:</p>
<pre><code>$ export LD_LIBRARY_PATH=$PWD/lib</code></pre>
<p>There&#8217;s actually one hidden secret you must do next, and it is sort of cheating.  You need to copy crypto.prf into your qmake feature directory.  This is so projects that need QCA can find QCA.</p>
<pre><code>$ cp crypto.prf /path/to/qt/mkspecs/features</code></pre>
<p>Fortunately, this file doesn&#8217;t ever change, so if you later modify QCA in-place, there&#8217;s no need to copy this file again.</p>
<p><b>QConf</b>:</p>
<p>With the latest development version (as of October 22nd, 2006), qconf can be run without doing &#8216;make install&#8217;.  In fact, you can run it from another location, and it locates its data files relative to the executable.  This allows it to work similar to qmake, in that you can invoke it by specifying the full path.  Unlike qmake, however, this is not dependent on the prefix.  That is, you can configure qconf with the default prefix of /usr/local, and you can still run qconf from anywhere without installing it.</p>
<pre><code>$ ./configure --qtdir=/path/to/qt
$ make
$ cd /path/to/myproject
$ /path/to/qconf
$ ./configure ...</code></pre>
<p><b>Psi</b>:</p>
<p>Psi can be built and used in-place.  Once compiled, just run it.</p>
<pre><code>$ ./configure --qtdir=/path/to/qt
$ make
$ ./psi</code></pre>
<p>That&#8217;s it!</p>
<p>You can build and use all the Psi tools without mucking with your system, and without ever doing &#8216;make install&#8217; either.</p>
]]></content:encoded>
			<wfw:commentRss>http://delta.affinix.com/2006/10/22/in-place-builds/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Iris and iChat</title>
		<link>http://delta.affinix.com/2006/02/16/iris-and-ichat/</link>
		<comments>http://delta.affinix.com/2006/02/16/iris-and-ichat/#comments</comments>
		<pubDate>Fri, 17 Feb 2006 07:42:26 +0000</pubDate>
		<dc:creator>justin</dc:creator>
		
		<category><![CDATA[Jabber]]></category>

		<category><![CDATA[Programming]]></category>

		<category><![CDATA[Psi]]></category>

		<guid isPermaLink="false">http://delta.affinix.com/2006/02/16/iris-and-ichat/</guid>
		<description><![CDATA[Ok, so we can do this now:

That&#8217;s presence using Link-Local Messaging (a.k.a. Apple&#8217;s Bonjour Chat protocol, now documented in JEP-0174).  Presence is delivered via local DNS Service Discovery.  Chat is done via peer-to-peer Jabber.
Doing Bonjour presence is not all that new actually.  The JDNS subsystem has been able to do it since [...]]]></description>
			<content:encoded><![CDATA[<p>Ok, so we can do this now:</p>
<p><img src="/image/irisichat.png"></p>
<p>That&#8217;s presence using Link-Local Messaging (a.k.a. Apple&#8217;s Bonjour Chat protocol, now documented in <a href="http://www.jabber.org/jeps/jep-0174.html">JEP-0174</a>).  Presence is delivered via local DNS Service Discovery.  Chat is done via peer-to-peer Jabber.</p>
<p>Doing Bonjour presence is not all that new actually.  The <a href="http://psi.anywise.org/cgi-bin/cvsweb.cgi/iris/irisnet/jdns/">JDNS</a> subsystem has been able to do it since last year.  What is notable this time around is that I&#8217;m doing it via the new Iris DNS API, which is an abstraction layer, and JDNS is just one possible backend.  And there&#8217;s also an avatar / buddy icon.  That&#8217;s good old icon_32.png from Psi. <img src='http://delta.affinix.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>If you want to try it yourself, have a look at the irisnet command-line tool (now committed to the CVS).  Quite a few rough edges remain, but it should work.  Here is what I ran:</p>
<pre>./irisnet pserv justin@ubuntu _presence._tcp 5298
"txtvers=1,1st=Justin,port.p2pj=5298,status=dnd,
msg=coding on iris stuff,
phsh=b12eebe7b5a2f2673aba2f6eb0f3264939a78f67"
-a null:icon_32.png</pre>
<p>Yeah, it&#8217;s pretty long. <img src='http://delta.affinix.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  It is supposed to be a single line, but I&#8217;ve broken it up for readability.  &#8220;irisnet pserv&#8221; means to publish a service.  Then it goes: JID, service type, port, list of attributes.  The -a means to add an extra DNS record, in this case the avatar image (yeah, iChat delivers avatars over DNS, don&#8217;t ask questions).</p>
<p>The value of the phsh attribute is the SHA1 hash of the avatar image in hexidecimal.  I used the &#8217;sha1sum&#8217; program to do this, which is present on most Linux installations at least:</p>
<pre>$ sha1sum icon_32.png
b12eebe7b5a2f2673aba2f6eb0f3264939a78f67  icon_32.png</pre>
<p>I don&#8217;t know when we&#8217;ll see Link-Local Messaging in Psi, but it shouldn&#8217;t be too hard to do at this point.</p>
]]></content:encoded>
			<wfw:commentRss>http://delta.affinix.com/2006/02/16/iris-and-ichat/feed/</wfw:commentRss>
		</item>
		<item>
		<title>ServiceResolver</title>
		<link>http://delta.affinix.com/2006/02/11/serviceresolver/</link>
		<comments>http://delta.affinix.com/2006/02/11/serviceresolver/#comments</comments>
		<pubDate>Sat, 11 Feb 2006 08:52:46 +0000</pubDate>
		<dc:creator>justin</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<category><![CDATA[Psi]]></category>

		<guid isPermaLink="false">http://delta.affinix.com/2006/02/11/serviceresolver/</guid>
		<description><![CDATA[There are three ways Psi might locate a Jabber service.  ServiceResolver covers all three, on all platforms, and makes it easy.
To demonstrate how ServiceResolver works, below you can see some output of my &#8216;irisnet&#8217; commandline tool (which still in development).
The main way to find a Jabber server is via SRV.  ServiceResolver looks up [...]]]></description>
			<content:encoded><![CDATA[<p>There are three ways Psi might locate a Jabber service.  ServiceResolver covers all three, on all platforms, and makes it easy.</p>
<p>To demonstrate how ServiceResolver works, below you can see some output of my &#8216;irisnet&#8217; commandline tool (which still in development).</p>
<p>The main way to find a Jabber server is via SRV.  ServiceResolver looks up the SRV records of a given type on a given domain, as well as the address (A/AAAA) records for each:</p>
<pre>$ ./irisnet rservd sapo.pt _xmpp-client._tcp
[213.13.146.7] port=5222
[213.13.146.8] port=5222</pre>
<p>You can also lookup non-SRV (&#8221;plain&#8221;) services.  This is done by pre-supplying the port to use, which is returned with each address record found:</p>
<pre>$ ./irisnet rservp gmail.com 5222
[216.239.57.107] port=5222
[64.233.161.107] port=5222
[64.233.171.107] port=5222</pre>
<p>Lastly, suppose there&#8217;s a JEP-0174 / iChat service instance on the LAN called someguy@macbox.  In this case, DNS-SD is used:</p>
<pre>$ ./irisnet rservi someguy@macbox _presence._tcp
[192.168.1.156] port=5298</pre>
<p>There may be three different input methods, but there is only one output method: a list of address &#038; port pairs.  The list is always sorted in the order in which the addresses should be tried.  Priorities and weights are taken care of for you.</p>
<p>With cross-platform capability, pluggable backends, and seamless Bonjour support, the Iris DNS system is shaping up to be one of the most simple and capable such systems in existence.  I suppose I don&#8217;t feel so bad about it taking forever to finish, because we really have something cool here.</p>
]]></content:encoded>
			<wfw:commentRss>http://delta.affinix.com/2006/02/11/serviceresolver/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Process Termination Handling</title>
		<link>http://delta.affinix.com/2006/02/01/process-termination-handling/</link>
		<comments>http://delta.affinix.com/2006/02/01/process-termination-handling/#comments</comments>
		<pubDate>Wed, 01 Feb 2006 10:38:45 +0000</pubDate>
		<dc:creator>justin</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<category><![CDATA[Psi]]></category>

		<guid isPermaLink="false">http://delta.affinix.com/2006/02/01/process-termination-handling/</guid>
		<description><![CDATA[I just threw together some code for handling when a process is requested to terminate.  The motive is so I can quit a console application cleanly.  With GUI apps, detecting when the user wishes to exit is a trivial task, since any GUI toolkit worth anything will tell you when a window closes [...]]]></description>
			<content:encoded><![CDATA[<p>I just threw together some code for handling when a process is requested to terminate.  The motive is so I can quit a console application cleanly.  With GUI apps, detecting when the user wishes to exit is a trivial task, since any GUI toolkit worth anything will tell you when a window closes (via an &#8216;X&#8217; button or ALT-F4 or whatever).  However, console apps, especially those that run indefinitely, and barring those that have interactive UIs such as curses or prompts, are commonly exited by using Ctrl-C.  Fortunately, tracking this kind of event wasn&#8217;t too bad to implement.  Windows has a handler function specifically for console breaking, and Unix has signals (I trap SIGINT, SIGHUP, and SIGTERM, per the glibc manual).</p>
<p>The JDNS commandline tool has an argument to specify how long it should run, which is just plain silly.  And my network interface monitoring test program had a similar option too&#8230;  Until tonight!  Now I can just hit ctrl-C and the app will quit.  Clean exits are essential when valgrinding, and so this will make my life much easier.</p>
<p>And now that I&#8217;ve thought about it some more, this code may also be useful in GUI apps like Psi, for when a system shutdown occurs.  However, I think the Windows code I have is for console only, so that will have to be resolved before it is useful there..</p>
]]></content:encoded>
			<wfw:commentRss>http://delta.affinix.com/2006/02/01/process-termination-handling/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Network Interface Detection</title>
		<link>http://delta.affinix.com/2006/01/29/network-interface-detection/</link>
		<comments>http://delta.affinix.com/2006/01/29/network-interface-detection/#comments</comments>
		<pubDate>Sun, 29 Jan 2006 20:25:36 +0000</pubDate>
		<dc:creator>justin</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<category><![CDATA[Psi]]></category>

		<guid isPermaLink="false">http://delta.affinix.com/2006/01/29/network-interface-detection/</guid>
		<description><![CDATA[Right now I&#8217;m working on detecting when network interfaces come and go, so that, for example, Psi can go online when your network connection becomes active.  There is a nice debate as to what constitutes a network connection, but I think for our purposes I&#8217;ve decided this will be a non-loopback interface bound to [...]]]></description>
			<content:encoded><![CDATA[<p>Right now I&#8217;m working on detecting when network interfaces come and go, so that, for example, Psi can go online when your network connection becomes active.  There is a nice debate as to what constitutes a network connection, but I think for our purposes I&#8217;ve decided this will be a non-loopback interface bound to a gateway.  This code will be part of IrisNet, which is the new network subsystem for Iris.</p>
<p>Time for platform-specific coding fun again.</p>
]]></content:encoded>
			<wfw:commentRss>http://delta.affinix.com/2006/01/29/network-interface-detection/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Integrity Messenger Copyright Violation and Psi</title>
		<link>http://delta.affinix.com/2005/01/23/integrity-messenger-copyright-violation-and-psi/</link>
		<comments>http://delta.affinix.com/2005/01/23/integrity-messenger-copyright-violation-and-psi/#comments</comments>
		<pubDate>Mon, 24 Jan 2005 02:59:10 +0000</pubDate>
		<dc:creator>justin</dc:creator>
		
		<category><![CDATA[Psi]]></category>

		<guid isPermaLink="false">http://delta.affinix.com/2005/01/23/integrity-messenger-copyright-violation-and-psi/</guid>
		<description><![CDATA[Integrity Messenger is an instant messaging company, whose software is meant to operate with their own proprietary network (although later versions claim to have compatiblity with AIM, ICQ, Yahoo, MSN).  Their software is primarily based on the Psi Jabber client.  However, due to heavy user interface modification (like skinning), this is not easy [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.integritymessenger.com/">Integrity Messenger</a> is an instant messaging company, whose software is meant to operate with their own proprietary network (although later versions claim to have compatiblity with AIM, ICQ, Yahoo, MSN).  Their software is primarily based on the <a href="http://psi-im.org/">Psi Jabber client</a>.  However, due to heavy user interface modification (like skinning), this is not easy to notice just by looking at it.  This copyright breach occurred in mid-2002, but due to my lack of resources, there was just no way I could hire lawyers to fight this.  I&#8217;ve been working with the Free Software Foundation to resolve the matter ever since the beginning, but because all of this is volunteer (pro-bono), going through the legal motions is a painstakingly slow process that can take years. <img src='http://delta.affinix.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />  As such, Integrity Messenger flourished despite our efforts, although these days it seems they are now defunct.</p>
<p>Initially, Integrity Messenger tried to hire me in May 2002, such that they could acquire the rights to the program.  However, I was already bound to a full time job at another company and had to decline.  At this point, the guy who was trying to hire me (Christian Rishel) told me that one day I&#8217;d get &#8220;f*cked&#8221;.  I didn&#8217;t suspect at the time that maybe he meant something about my Psi program.  So despite my decline, the company proceeded with their original plan anyway, but without my copyright permission.  I didn&#8217;t find out about this until August of that year.</p>
<p>This page will become more complete as I add to it.</p>
<hr />
<p>I suspect the most interesting stuff is the visible evidence, so first up are some screenshots of the graphical interface for Integrity Messenger and Psi, as they would have been sometime in 2002 (shots are of Integrity Messenger 3.36 and Psi 0.8.6, both released in 2002).  Note that these similarities may or may not exist anymore, as the interface for Integrity Messenger has undergone many changes over the past 3 years.</p>
<p>Here&#8217;s a shot of both main windows, Psi on the right.  As you can see, the group headers and system message icon are the same, aside from some graphical adjustments.  Also, I&#8217;ve opened the right-click menus to show that some of the text and shortcuts are identical (note: the &#8216;x&#8217; icon for Integrity Messenger&#8217;s &#8220;Remove&#8221; item is also an old Psi icon, although by 0.8.6 we had replaced it with a Trash can).</p>
<p><img src="/integrity_psi/menus.png"></p>
<p>This one speaks for itself:</p>
<p><img src="/integrity_psi/sounds.png"></p>
]]></content:encoded>
			<wfw:commentRss>http://delta.affinix.com/2005/01/23/integrity-messenger-copyright-violation-and-psi/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Crossplatform Thoughts on Psi/Mac and the Lowest Common Denominator</title>
		<link>http://delta.affinix.com/2003/10/22/crossplatform-thoughts-on-psimac-and-the-lowest-common-denominator/</link>
		<comments>http://delta.affinix.com/2003/10/22/crossplatform-thoughts-on-psimac-and-the-lowest-common-denominator/#comments</comments>
		<pubDate>Thu, 23 Oct 2003 02:30:50 +0000</pubDate>
		<dc:creator>justin</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<category><![CDATA[Psi]]></category>

		<guid isPermaLink="false">http://delta.affinix.com/2003/10/22/crossplatform-thoughts-and-psimac-and-the-lowest-common-denominator/</guid>
		<description><![CDATA[I&#8217;ve been thinking about the issues of crossplatform programming lately now that I want to improve Psi/Mac.  The program feels alien to MacOS X for two reasons: 1) widgets do not match those of native applications, both in looks and in behavior, and 2) the organization of the application does not make sense when [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been thinking about the issues of crossplatform programming lately now that I want to improve Psi/Mac.  The program feels alien to MacOS X for two reasons: 1) widgets do not match those of native applications, both in looks and in behavior, and 2) the organization of the application does not make sense when compared to one that is native.</p>
<p>Native widgets are a hot issue.  Qt works by emulating the widget look &#038; behavior of the platform.  Under Windows, this is very easy to do, since the widgets are quite basic.  Also, the notion of a &#8220;native widget&#8221; under Windows is less defined.  Many applications get away with having their own widgets, and so the Windows look and feel has never been drastically changed.  Even Windows XP, which supports theming, does so by grafting a simple look &#038; feel system atop the usual widgets.  Qt supports XP themes quite well.  Under X11, there is no such thing as a standard widget.  I suppose you could say that would be Motif, and Qt does a fine job of emulating it (even though I can&#8217;t stand it), but these days people run all sorts of fancy KDE desktops using advanced styles like Keramik.  However, KDE is Qt-native, so this isn&#8217;t really any trouble for Qt.  Instead of Qt trying to figure out how to look like the desktop, the desktop is telling Qt how to look.  Try Qt under GNOME, and we lose all sense of native look and feel.  The Mac is by far the most troublesome style to emulate, not just because of complexity (it is complex), but also because it is so high-level that Apple can do things like change the TabWidget look and all apps conform to it.  Qt/Mac on Panther (OS X 10.3) shows the older TabWidget style, emphasizing this problem.</p>
<p>Why does Qt not use native widgets?  Trolltech will tell you it is more powerful this way.  Certainly it is, you can do whatever you want with your Qt widgets, like drawing a line across a button or making your own freaky QScrollBar clone that has extra gadgets on it or whatever.  Because the Qt style system breaks down high level widgets into separate parts for rendering, you could actually invent a widget that does not exist on Mac, but still has an Aqua look and feel.  However, in many cases, this is overkill.  Yes, custom widgets are handy, but do we often need custom widgets that look derived from native widgets?  I say no.  Consider the &#8216;BusyWidget&#8217; from Psi, which just shows the logo as a bunch of spinning panels.  This is a custom widget.  It does not exist on any platform, it is something I wrote.  However, it is not something impossible to write without Qt.  I could easily make it with Objective-C using native Cocoa and it would look exactly the same.  We do not want to rule out custom widgets.  What we do want to rule out are customized variations of native widgets.  We can trade this flexibility for true native look and feel, which is essentially what the wxWindows toolkit does.  So why not just use wxWindows?  Well, having native widget wrapping is only part of this battle.  Qt is a more ideal framework in my opinion.  It is almost like a platform of its own, and even defines extensions to the C++ language like signals, slots, objects, rtti, etc.  It turns C++ into a wannabe Objective-C / Java.  Whether this is a good idea or not is left up to the reader, but I consider it very powerful to be able to do these extras while retaining the use of C++.</p>
<p>Now, at some point, someone is bound to bring up the issue of the Lowest Common Denominator.  This is generally what crossplatform applications have problems with, the rule being that if you can&#8217;t do something everywhere, then you just don&#8217;t do it.  Personally I think this is a stupid limitation.  Crossplatform applications should take advantage of platform-specific functionality whenever possible, otherwise the value of the underlying platform is lost.  With Qt, we are not stuck in a box.  We are natively compiled C++, not confined in a VM like Java, which means we can do whatever we please on each platform.  The goal with crossplatform code then, in my opinion, is to have highly portable code, but not necessarily &#8220;write once run anywhere&#8221; code.  We want to share as much code as we can to avoid redundancy, but beyond that we want to write code that is specific to each platform in question.</p>
<p>Consider the text-entry widget on Mac.  It has built in on-the-fly spell checking.  This is a great move by Apple, and it reminds me of KDE.  Instead of simple widgets like on Windows where apps have to supply most of the functionality, apps under Mac can use highly advanced widgets that have a lot of functionality on their own already, and can be upgraded through the OS easily.  This allows for more power, consistency, and rapid development of apps.  How can we use this widget with Qt?  Well, we can&#8217;t.  This is because QTextEdit, like all Qt widgets, is not a native widget.  Could Qt be altered to use the native Cocoa widget?  Presumably.  At what loss?  The ability to do things we would never want, like drawing all over it with QPainter.  I think it is clear that in the majority of cases, we would rather use the native widget.  Then, of course, we also need a way to access the properties of the native widget so that we can do further platform-specific functions to it.  On the Mac, we would like to enable the spell check mode (if we have to do that), but this function would not exist on other platforms.  How do you access Cocoa widgets from C++ ?  Good question, perhaps it is not easily possible.  wxWindows probably does not support this.  Qt does not support native widgets, so this is not possible either.  So what is the answer, write the whole GUI in Cocoa?</p>
<p>No!  Well, sort of.  In the end it will all be Cocoa, whether we are creating widgets via Objective-C widgets or using them through a wrapper.  However, it is simply not efficient to have to recode everything in Objective-C.  Just because you want to port to another platform should not mean rewriting all of your code.  The point I made earlier was that emphasis should be placed on code reusability.  Some may say that abstracting the GUI completely out of an app is the logical thing to do.  In some cases, I agree.  If you are porting to a PDA, sure.  If you are porting to Mac, you&#8217;d probably want to do this to some extent.  Licq, the unix ICQ client, has a completely abstracted GUI system, and there are both Qt and Gtk versions.  However, there is a ton of redundancy here.</p>
<p>I can appreciate the need to rework a GUI for a particular platform.  When you consider the Mac, the GUI design guidelines are drastically different from Windows.  Configuration dialogs generally take effect on-the-fly.  There are no &#8220;OK&#8221; or &#8220;Apply&#8221; buttons.  Apps use a global menubar at the top of the screen.  Some apps use that weird &#8220;brushed metal&#8221; look.  It is sensible then, that one might want to recreate their GUI completely for Mac.  However, consider all of the various dialogs that we have.  Do they all need to be recreated on Mac?  And if so, do the entire dialogs need adjustment or only partly?  For instance, some dialogs might be perfectly fine in their current state, aside from the ordering and alignment of the buttons at the base of the dialog.  It would make more sense to reuse the code for this dialog, but to change the button positioning to match the Mac.  Why code the use of a scrollbar in Objective-C when you&#8217;ve already done it in C++?  It&#8217;s not like a scrollbar is only available on certain platforms.  The solution, then, is to have generic bindings to all native widgets, and also platform-specific bindings so that extra functionality can be used if necessary.  Qt is in a great position to do this, and even have fallback to emulated widgets if we really really wanted to make a frankenstein widget with native look.  However, for some dialogs it might be more optimal to recode them completely, and this could be done with some Objective-C code wrapped in a C/C++ library.  Psi has a ton of backend code, from the XMPP library to all of the internal contact management and accounting.  It makes sense to be able to reuse as much as possible when making a MacOS X Jabber client, instead of starting from scratch.  However, it should be used in such a way that it is not at the loss of native look, behavior, and functionality.</p>
<p>This, I think, sums up all of my thoughts about cross-platform programming.  Rule of the day: code should be as portable and reusable as possible.</p>
]]></content:encoded>
			<wfw:commentRss>http://delta.affinix.com/2003/10/22/crossplatform-thoughts-on-psimac-and-the-lowest-common-denominator/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
