Openfire

I upgraded my ejabberd server to openfire today. It is really nice. ejabberd was very stable and worked extremely well but really lacked a management interface. Openfire has a fantastic interface that really makes it easy to configure. Even migrating my users across was painless.

Openfire have also announced a beta of their next release. It has an invisibility option. Once there is client support this should allow you to control who can see you presence. This is a feature that I and others have been waiting for.

Ubuntu and MAC Addresses on Parallels Clones

I have been trying to clone a ubuntu install on parallels using the Parallels clone function. Unfortunately the network interface failed to work with the new MAC address assigned to the virtual interface during cloning. ifconfig didn’t show the interface at all and lshw -C network showed the interface as disabled.
Eventually I found that the mac address is used in the udev rule that creates the network device. Changing the file /etc/udev/rules.d/70-persistent-net.rules to have the correct mac address fixed things.

Using Hardware Security Modules

Hardware Security Modules (HSM) are hardware modules that can be used to store cryptographic secrets such as the private keys needed for asymmetric signing operations. These modules come in a variety of form factors including PCI cards, network appliances, usb modules and smart cards.

The alternative to using an HSM is to store your private keys in files on disk. Normally these files are encrypted but there are still some applications that use private keys in files and do not encrypt them!

Using the right HSM can provide significant security improvements over storing keys in files. It may provide the following benefits

  • Easy to see where your keys are. They are not scattered all over the disk but instead are held in a well controlled location.
  • Keys can be generated on the HSM. So there is no chance that the key will ever have appeared on disk.
  • Private keys can not be extracted from the HSM.
  • The module may provide acceleration of cryptographic operations.
  • A mechanism for securely backing up the keys to another HSM.

Typically the HSM will come with drivers and a hardware independent API called pkcs11 that allows you to access the features of the HSM. pkcs11 allows you to create objects such as keys on the HSM and to perform cryptographic operations with those keys.

There are two approaches to writing software that uses the HSM.

  1. Use pkcs11 directly
  2. Use a general purpose cryptographic library like OpenSSL

Accessing the HSM via OpenSSL can be done via a pkcs11 engine that acts as an interface between OpenSSL and the pkcs11 API described above.

Using an HSM

There are various reasons for using pkcs11 directly

  1. Much existing crypto software that doesn’t already support HSMs is written in such a way as to make it difficult to add engine support.
  2. You can not use OpenSSL to do key generation in an HSM, for that you must use pkcs11.
  3. pkcs11 is easy once you get used to it and the standard is well documented.
  4. The OpenSSL documentation is very hard to follow.

However, I prefer the OpenSSL approach for several reasons

  1. Most existing software already uses OpenSSL to perform cryptographic operations in software.
  2. Once you figure it out, the OpenSSL documentation is very good
  3. It is likely that your application will not want to use the HSM for every cryptographic operation. For example, calculating hashes may be much faster in software.
  4. I think that key generation is a totally separate thing from key use. Why does every application that uses a key come with a different application for generating that key? A key is just a key – it doesn’t care what it will be used for.

Skype Crash OS X

For the last few months Skype has been crashing every time I tried to start it on my MacBook Pro. There were error messages in the crash log like this

Thread 0 Crashed:
0   <<00000000>>        0xffff07d7 __memcpy + 55 (cpu_capabilities.h:228)
1   ...ickTimeComponents.component      0x991fa700 _SGVideoGetChannelDeviceList + 2069
2   ...ple.CoreServices.CarbonCore      0x90cd0a53 CallComponentFunctionCommon + 513
3   ...ickTimeComponents.component      0x991edb29 _SGVideoComponentDispatch + 123
4   ...ple.CoreServices.CarbonCore      0x90cd0738 CallComponentDispatch + 34

Which led me to think it was something to do with Quicktime and/or video. So it occurred to me that starting iChat and opening the video preview before starting skype might help. It does!

libpcap on OS X

Earlier I wrote about a problem with libpcap on OS X. This is the call in the code that breaks the wireless connection.

/* ask pcap to find a valid device for use to sniff on */
dev = pcap_lookupdev(errbuf);

but replace it with this (en1 is my wireless interface)

dev="en1";

and then use dev in other libpcap functions and it works fine.

Firmware

One of the tv cards in my mythtv backend requires the driver to load firmware at boot time. The driver for this card was crashing repeatedly so I have been keeping an eye out for updates. The firmware received an upgrade a few months ago but it was still crashing and it was weeks before I realized that the old firmware was still being loaded. It turns out that you have to actually remove the power from the system before it will reload the firmware. A reboot is not sufficient. This really needs to be in BIG letters somewhere on the linuxtv site.

Anyway I now have a whole month of uptime on the backend. This is only the second time I have had the system so stable in the 3-4 years I have been running mythtv.

libpcap on OSX

The other day I was playing with libpcap on my MacBook Pro. Every time I tried to run the code my wireless network connection was disconnected.

After a bit of playing around I also found this was happening with tcpdump. It appears that running tcpdump -i en1 where en1 is the wireless network interface works fine. I guess the problem is something to do with the call to scan for interfaces.