Joachim Breitner: A different Maybe maybe
- Algebraic Data Type Done Differently (PDF-File)
- Algebraic Data Type Done Differently (Literate Haskell Source / LaTeX Source)


The lunar eclipse, as seen from the Catalan countryside. Pics by Jordi Jover.
Many were quite tired by 3 or so, so we started setting up tents and went
to sleep by 4. Sunday was a slow day, dedicated to cleaning up our stuff and
eating leftovers cooked on a new fire. We were back in Val ncia at 8PM or so
and even after showering and cleaning my hair with shampoo, my head still
smelled like smoke. Actually, I think it might still smell a tiny bit
today.
In short, a lovely weekend, which I hope to repeat next year. Too bad
the lunar eclipse bit will be missing for quite a few more years. :)


The lunar eclipse, as seen from the Catalan countryside. Pics by Jordi Jover.
Many were quite tired by 3 or so, so we started setting up tents and went
to sleep by 4. Sunday was a slow day, dedicated to cleaning up our stuff and
eating leftovers cooked on a new fire. We were back in Val ncia at 8PM or so
and even after showering and cleaning my hair with shampoo, my head still
smelled like smoke. Actually, I think it might still smell a tiny bit
today.
In short, a lovely weekend, which I hope to repeat next year. Too bad
the lunar eclipse bit will be missing for quite a few more years. :)
sudo grml-crypt start /media/usb4/cryptoloop $MOUNTPOINTGotcha: don’t confuse sudo’s “password” prompt with grml-crypt’s “Enter LUKS passphrase” prompt, the cryptoloop password won’t bring you anywhere on the sudo prompt. Preparing the CA directory For the CA, create a dedicated directory in the mounted cryptoloop file system. You’re originally supposed to copy the entire EasyRSA directory tree in there, but I’d recommend to only link the files from your system’s EasyRSA directory to automatically take advantage of distribution updates. You’ll need at least these links:
lrwxrwxrwx 1 mh mh 56 Dec 25 23:23 openssl.cnf -> /usr/share/doc/openvpn/examples/easy-rsa/2.0/openssl.cnf lrwxrwxrwx 1 mh mh 52 Dec 25 23:22 pkitool -> /usr/share/doc/openvpn/examples/easy-rsa/2.0/pkitool lrwxrwxrwx 1 mh mh 60 Dec 25 23:23 whichopensslcnf -> /usr/share/doc/openvpn/examples/easy-rsa/2.0/whichopensslcnf
Configuring your CA The only thing you cannot link is the vars file which contains your CA’s local settings:ln -s /usr/share/doc/openvpn/examples/easy-rsa/2.0/openssl.cnf . ln -s /usr/share/doc/openvpn/examples/easy-rsa/2.0/pkitool . ln -s /usr/share/doc/openvpn/examples/easy-rsa/2.0/whichopensslcnf .
Comments have been removed from this file. Better copy the file from /usr/share/doc/openvpn/examples/easy-rsa/2.0/vars and edit it to your needs. I added the two PKCS11 variables since you won’t otherwise be able to issue certificate requests. Creating the CA Next, decide on a shell instance where you will do most operations, and source vars in there. Next, run /usr/share/doc/openvpn/examples/easy-rsa/2.0/clean-all. If you do this in a directory of an already-in-use EasyRSA CA, you’ll need to restore your backup. To actually initialize the CA, run pkitool --initca --pass. If you do not give the --pass parameter, you’ll create a CA that can issue certificates without asking for a passphrase, which might not be a brilliant idea. Choose a reasonably secure pass phrase. Creating Certificates - the simple and suboptimal way You can now simply proceed to create an arbitrary number of pairs of “private” keys and associated certificate by simply calling pkitool <clientname> and/or pkitool --server <servername>. Depending on your security policy, you can mandate the private keys to be protected by a passphrase (adding --pass to the command lines), but you’ll have the expense of being asked for the passphrase every time you start a new openvpn daemon. Creating Certificates the Right Way I have put the “private” in quotes since the keys created this way are not really private: The key was created on the box hosting the CA, was stored on the local (crypted) file system and needs to be moved to the target system via a secure channel. Doing so the right way is harder than expected, so it is usually the better way to keep the private key really private by creating it directly on the target system. On the target system, you need OpenVPN installed, and openssl. After the certificate was created, you can remove openssl again. Creating a private key is part of a key-pair generation process that also leaves a certificate request. The contents of the certificate request is public, and you can safely move it to the CA box and convert it to a certificate by signing the request. You only need to make sure that nobody exchanges your target system’s certificate request for her own before you sign it as you might end up certifying a wrong identity. For the rest of this document we’re going to assume that you have ssh access to the target system and have verified the ssh host key, so that you can be reasonably sure to be connected to the right system. To create a certificate request, you can use this script, which I have called create-easyrsa-cert-req:export EASY_RSA=“$(pwd)” export OPENSSL=“openssl” export PKCS11TOOL=“pkcs11-tool” export GREP=“grep” export KEY_CONFIG=$($EASY_RSA/whichopensslcnf $EASY_RSA) export KEY_DIR=“$EASY_RSA/keys” # Issue rm -rf warning echo NOTE: If you run ./clean-all, I will be doing a rm -rf on $KEY_DIR export KEY_SIZE=1024 export CA_EXPIRE=3650 export KEY_EXPIRE=3650 export KEY_COUNTRY=“DE” export KEY_PROVINCE=“” export KEY_CITY=“” export KEY_ORG=“Zugschlus.de” export KEY_EMAIL=“mh+easyrsa-mh-openvpn@zugschlus.de” export PKCS11_MODULE_PATH=“dummy” export PKCS11_PIN=“dummy”
When called without parameters, it creates a certificate request for an OpenVPN client certificate, and when you call it with “server” as parameter, it will create a server certificate request. In any case, it will leave two files in the current directory. They are named after the current host name, and have the extensions .csr and .key. The .key file is your private key. keep it private! The .csr file is the certificate request which you can now move to the keys subdirectory of your CA directory via scp or other means such as an USB stick. To do the actual signing, invoke pkitool --sign <hostname> and enter the CA passphrase. You can ignore the error message that there was no .key file to chmod. Gotcha, when signing a server certificate, use pkitool --server --sign <hostname>. Move Certificate to the target host You can now move the certificate to the target system. Since you’re probably going to need the root certificate and the certificate revocation list as well, you can move the .key file (if created on the CA system), the .crt file, and ca.crt to the target system. These files are public, so there is no need for a secure channel. Revoking Certificates Since an OpenVPN server’s only means of authentication is to check whether the certificate presented by a client is signed by the “right” CA, the only way to revoke VPN access is to revoke the certificate. This is also done on the CA system by calling /usr/share/doc/openvpn/examples/easy-rsa/2.0/revoke-full <client-name>. This creates a crl.pem file which contains a list of all revoked certificates. You need to have a mechanism to distribute that list to all systems that might need it, and it is recommended to have this automated. Remember, if you do not distribute the .crl file, the systems are not going to know about revoked certificates.#!/bin/bash set -u TMPDIR=“/tmp” export OPENSSL=“openssl” export PKCS11TOOL=“pkcs11-tool” export GREP=“grep” export KEY_CONFIG=“/usr/share/doc/openvpn/examples/easy-rsa/2.0/openssl.cnf” export KEY_DIR=“$TMPDIR/keys.$$” mkdir -p $KEY_DIR export KEY_SIZE=1024 export KEY_EXPIRE=3650 export KEY_COUNTRY=“DE” export KEY_PROVINCE=“” export KEY_CITY=“” export KEY_ORG=“Zugschlus” export KEY_OU=“$(hostname --fqdn)” export KEY_EMAIL=“mh+$(hostname)-ovpn-cert@zugschlus.de” export DEBUG=1 umask 077 if [ “$ 1:-foo ” != “server” ]; then /usr/share/doc/openvpn/examples/easy-rsa/2.0/pkitool --csr $(hostname) else /usr/share/doc/openvpn/examples/easy-rsa/2.0/pkitool --csr --server $(hostname) fi mv $TMPDIR/keys.$$/* . rm -rf $TMPDIR/keys.$$
and everyone else be damnedis an even remote sign of maturity, and because I promised not to seek the controversy in making decisions (while not avoiding it at all cost either).
[ 1 ] Wouter Verhelst [ 5 ] Aigars Mahinovs [ 3 ] Gustavo Franco [ 6 ] Sven Luther [ 3 ] Sam Hocevar [ 1 ] Steve McIntyre [ 2 ] Raphaë Hertzog [ 5 ] Anthony Towns [ 4 ] Simon Richter [ 5 ] NOTA
run $ "echo /etc/pass*" :: IO String -> "/etc/passwd /etc/passwd-" runIO $ "ls -l" - - "wc -l" -> 12 runIO $ "ls -l" - - wcL -> 12In this example, wcL is a pure-Haskell line-counting function.
"i would try dd-wrt (dd-wrt.de) instead..."Mark commented:
"Install OpenWRT 0.9 (not "Kamikaze", which is a ground-up rewrite in pre-alpha). Install X-WRT to get webinf^2 (better web interface for configuration). Read the OpenWRT documentation on how to backup/restore your firmware. Make a backup once after you get everything configured, again before installing any major new packages, and again just before a firmware upgrade. The IRC channel is hit-or-miss but the forums are well-attended by knowledgeable people. Hope this helps."Thanks. That's a great help. sebastian commented:
"Just saw your blog entry, you could have a look at X-WRT, which is an enhanced web configuration frontend to OpenWRT. ( http://x-wrt.org/ ) otherwise, they just plain rock (my opinion) ;-)"Ben Finney commented:
"One warning I'd give is to make clear that OpenWRT happily sets up a 'non-free' repository source for its 'ipkg' package manager. This is necessary to get the Linux 2.4.3x module for most Broadcom wireless chips, and for 'nas' which is apparently needed for WPA encryption. I vaguely recall someone announcing recently that free-software drivers were now available for most Broadcom chipsets, but that's likely only in Linux 2.6.x and may take quite some time to appear in OpenWRT."I'm aware that I'm pretty screwed by the Broadcom chipset, but it's a step forwards from where I am. The reply:
"I'm not sure whether to hope for an improvement. Do you know if the Broadcom chipset on these devices is one that now has free drivers available? If so, possibly we could agitate for those drivers to be backported to the kernel used in OpenWRT."I don't know, but I guess I'll find out soon. Thanks for all the great comments so far, but now I'm not sure whether I want OpenWRT, X-WRT or dd-wrt!
Some people, seeing this connection, and remembering the values of good code, try to improve the legal system by treating it as a computer. People come to me with ideas for hacking the law. The government says that cryptography is a weapon, they say, but the Bill of Rights says we have the right to bear arms. So that means we have a Constitutional right to use cryptography. But the legal system isn t a computer. If you can t convince a judge that what you re proposing is consistent with the values underlying a law, your argument will go nowhere. People go to jail every year because they think they ve found a way to hack the Sixteenth Amendment. The income tax is illegal, they say, or, The income tax is voluntary, see, it says so right here, and then they get convicted of tax evasion and sent to jail. We did convince several judges about the Constitutional dimension of cryptography, but the claim started from the values of the First Amendment, not a mechanical reading of its words. It s a category mistake to treat the legal system as just another architecture with its own specialized language. Code and law are different ways of regulating; they have different textures. All of those people who are required to make the legal system work leave their mark on its outcomes: they make a certain amount of drift and discretion almost inevitable. Code doesn t have such a limit: it can make perfectly hard-nosed bright-line rules and hold everyone in the world to them. Code is capable of a kind of regulatory clarity and intensity that law can only state, never really achieve.I don’t entirely agree with the other article, entitled What I Ate For Breakfast and Other Mysteries of Judicial Decision Making by outspoken Ninth Circuit Judge Alex Kozinski (unofficial site maintained by Aaron Swartz, wikipedia entry). For example, I think critical legal studies has resulted in some interesting insights, some of which actually have practical applciation. Still, Judge Kozinski makes an important point about the numerous factors that act as a check on discretion in judicial decisionmaking:
It is popular in some circles to suppose that judicial decision making can be explained largely by frivolous factors, perhaps for example the relationship between what judges eat and what they decide. Answering questions about such relationships is quite simple - it is like being asked to write a scholarly essay on the snakes of Ireland: There are none. But as far back as I can remember in law school, the notion was advanced with some vigor that judicial decision making is a farce. Under this theory, what judges do is glance at a case and decide who should win - and they do this on the basis of their digestion (or how they slept the night before or some other variety of personal factors). If the judge has a good breakfast and a good night’s sleep, he might feel lenient and jolly, and sympathize with the downtrodden. If he had indigestion or a bad night’s sleep, he might be a grouch and take it out on the litigants. Of course, even judges can’t make both sides lose; I know, I’ve tried. So a grouchy mood, the theory went, is likely to cause the judge to take it out on the litigant he least identifies with, usually the guy who got run over by the railroad or is being foreclosed on by the bank. This theory immodestly called itself Legal Realism. Just to prove that even the silliest idea can be pursued to its illogical conclusion, Legal Realism spawned Critical Legal Studies. As I understand this so-called theory, the notion is that because legal rules don’t mean much anyway, and judges can reach any result they wish by invoking the right incantation, they should engraft their own political philosophy onto the decision-making process and use their power to change the way our society works. So, if you accept that what a judge has for breakfast affects his decisions that day, judges should be encouraged to have a consistent diet so their decisions will consistently favor one set of litigants over the other. I am here to tell you that this is all horse manure. And, like all horse manure, it contains little seeds of truth from which tiny birds can take intellectual nourishment. The little truths are these: Under our law judges do in fact have considerable discretion in certain of their decisions: making findings of fact, interpreting language in the Constitution, statutes and regulations; determining whether officials of the executive branch have abused their discretion; and, fashioning remedies for violations of the law, including fairly sweeping powers to grant injunctive relief. The larger reality, however, is that judges exercise their powers subject to very significant constraints. They simply can’t do anything they well please.Finally, I will link, but not embed, this video of the Anna Nicole Smith court order, for an entirely different perspective on the legal process. You almost don’t really want to have to see this stuff.
Next.