summaryrefslogtreecommitdiff
blob: 6f80f74a93da6383d316ede157645643ea39be99 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
https://bugs.gentoo.org/71015
allow invokation as otp-foo.
	(03 Mar 2005) -taviso.

--- skey-1.1.5.orig/skey.c
+++ skey-1.1.5/skey.c
@@ -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':
--- skey-1.1.5.orig/skey.1
+++ skey-1.1.5/skey.1
@@ -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
@@ -34,6 +34,17 @@
 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