sk89q/skmclauncher — pull request #14 by BaconRanch (2012-08-05 04:23:39+00:00)
Title: Feature: Ability for users to trust third party certificates

sk89q uses his skmclauncher for easy, automatic distribution of client addons for his SKCraft multiplayer servers. He does this by creating a ZIP archive containing all client addons and their corresponding configuration files. In an update, the skmclauncher downloads and installs the contents of this ZIP archive to the end user's minecraft directory. For security, however, this ZIP archive must be signed by one of three certificates that are included with the launcher itself: mclogin.cer, mcupdate.cer, or sk89q.cer. Since sk89q is the owner of sk89q.cer, he simply signs the ZIP archive with the sk89q.cer certificate.

As a server administrator myself, I too would like to take advantage of this automatic client update system. Unfortunately, I do not have the ability to sign ZIP archives with any of the aforementioned certificates, and, as a result, any archive I create will not be installed by the launcher, as it fails to validate. While I could create a fork of the launcher and include my own certificate, I decided it would be a better idea to include a new feature: the ability for users to trust a third party certificate.

Here's how it works. In the custom update location's XML file, server administrators can add a URL that points to a certificate. The launcher will download this certificate and it will present UI asking users if they want to trust it. If a user says yes, the launcher will accept the certificate and it will allow any ZIP or JAR archives signed with the accepted certificate to validate for the corresponding update. If, on the other hand, the user says no, the update is cancelled.

This feature takes a convenience once reserved only for sk89q and opens it up to any and all server administrators without compromising security.

By the way, I noticed that the current version of the skmclauncher simply denies the installation of file types it doesn't understand. I've seen messages like "Not sure how to validate .txt files." In response to this, I have also added the same feature for file extensions. Server administrators can list file extensions in their update XML file, which the launcher will ask users to trust. This is useful for various configuration files that, for one reason or another, a server admin may not choose to package up in a ZIP archive for distribution.