diff -Nur skey-1.1.5.orig/skey.c skey-1.1.5/skey.c --- skey-1.1.5.orig/skey.c 2004-11-12 23:09:02.382529123 +0100 +++ skey-1.1.5/skey.c 2004-11-12 23:23:09.864378849 +0100 @@ -46,6 +46,17 @@ char passwd[SKEY_MAX_PW_LEN+1], key[SKEY_BINKEY_SIZE]; char buf[33], *seed, *slash, *t; + /* If we were called as otp-METHOD, set algorithm based on that */ + if ((slash = strrchr(argv[0], '/'))) + slash++; + else + slash = argv[0]; + if (strncmp(slash, "otp-", 4) == 0) { + slash += 4; + if (skey_set_algorithm(slash) == NULL) + errx(1, "Unknown hash algorithm %s", slash); + } + while ((i = getopt(argc, argv, "fn:p:t:x")) != -1) { switch(i) { case 'f': diff -Nur skey-1.1.5.orig/skey.1 skey-1.1.5/skey.1 --- skey-1.1.5.orig/skey.1 2004-11-12 23:09:02.375530148 +0100 +++ skey-1.1.5/skey.1 2004-11-12 23:41:43.298268426 +0100 @@ -6,7 +6,7 @@ .Dt SKEY 1 .Os .Sh NAME -.Nm skey +.Nm skey, otp-md4, otp-md5, otp-sha1 .Nd respond to an OTP challenge .Sh SYNOPSIS .Nm @@ -27,13 +27,24 @@ .Pp .Em S/Key uses 64 bits of information, transformed by the -.Tn MD4 +.Tn MD5 algorithm into 6 English words. The user supplies the words to authenticate himself to programs like .Xr login 1 or .Xr ftpd 8 . .Pp +When +.Nm skey +is invoked as +.Nm otp-method , +.Nm skey +will use +.Ar method +as the hash function where +.Ar method +is currently one of md4, md5, or sha1. +.Pp Example use of the .Em S/Key program