*** ./docs/keyinit.1 Tue Jul 20 21:12:02 1993 --- ../skey/./docs/keyinit.1 Fri Jan 29 23:31:41 1999 *************** *** 12,59 **** .SH DESCRIPTION .I keyinit will initialize the system information to allow one to use S/Key to login. ! In the Lab 214 environment this must be done on system ! .I latour ! for telnet access or on system ! .I cube ! for dial\-in access. This is ! not done on system faline where most other password changes are made. ! When you login to the Lab 214 system using S/Key ! you will be on system latour if you use telnet and ! can then use the rlogin command to get to other Lab 214 systems. ! Or if you use dial\-in you will need to use ! .I keyinit ! on system cube and after you login you will be at prompt of the ! terminal server named major. You can then use the command ! .sp 0 ! rlogin ! .sp 0 ! to get to any system connected on the internet. ! To assist in use of S/Key programs for CTRM PC terminal emulator, ! Macintosh and a general purpose PC use ! are available. You may "download" them from the ! directory /usr/local/lib/key on system faline. .sp 1 Note and take care because: .sp 0 1) key accepts anything as a password and generates a list. This can ! cause you troubles if you dont confirm the out put. Most people, when typing in a password, assume if the proper thing happens (you get logged in, or whatever), the proper password was given. Since key doesn't check, the data it gives you may be useless. Of course, you won't find this out until you get on the road and have to use it unless you test it first. SO TEST IT OUT! ! .sp 0 ! Use command rlogin latour -l nobody ! .sp 0 ! or ! .sp 0 ! rlogin cube -i nobody ! .sp 0 ! at the prompt Password: press key till you get the prompt Login: ! .sp0 ! Then give your user ID and at the next Password: prompt give the ! six Engilish words for the sequence number indicated. .sp 1 2) If key is being run on the machine you're keyinit-ted for, it should be able to look up the info, only ask you for your password, --- 12,59 ---- .SH DESCRIPTION .I keyinit will initialize the system information to allow one to use S/Key to login. ! .\" In the Lab 214 environment this must be done on system ! .\" .I latour ! .\" for telnet access or on system ! .\" .I cube ! .\" for dial\-in access. This is ! .\" not done on system faline where most other password changes are made. ! .\" When you login to the Lab 214 system using S/Key ! .\" you will be on system latour if you use telnet and ! .\" can then use the rlogin command to get to other Lab 214 systems. ! .\" Or if you use dial\-in you will need to use ! .\" .I keyinit ! .\" on system cube and after you login you will be at prompt of the ! .\" terminal server named major. You can then use the command ! .\" .sp 0 ! .\" rlogin ! .\" .sp 0 ! .\" to get to any system connected on the internet. ! .\" To assist in use of S/Key programs for CTRM PC terminal emulator, ! .\" Macintosh and a general purpose PC use ! .\" are available. You may "download" them from the ! .\" directory /usr/local/lib/key on system faline. .sp 1 Note and take care because: .sp 0 1) key accepts anything as a password and generates a list. This can ! cause you troubles if you don't confirm the output. Most people, when typing in a password, assume if the proper thing happens (you get logged in, or whatever), the proper password was given. Since key doesn't check, the data it gives you may be useless. Of course, you won't find this out until you get on the road and have to use it unless you test it first. SO TEST IT OUT! ! .\" .sp 0 ! .\" Use command rlogin latour -l nobody ! .\" .sp 0 ! .\" or ! .\" .sp 0 ! .\" rlogin cube -i nobody ! .\" .sp 0 ! .\" at the prompt Password: press key till you get the prompt Login: ! .\" .sp0 ! .\" Then give your user ID and at the next Password: prompt give the ! .\" six Engilish words for the sequence number indicated. .sp 1 2) If key is being run on the machine you're keyinit-ted for, it should be able to look up the info, only ask you for your password, *************** *** 62,68 **** Otherwise, it can ask you for the key and password, and let you know that it can't check them. .sp 1 ! 3) You CAN use back space to make corrections and you may use lower case letters. .SH OPTIONS .B s --- 62,68 ---- Otherwise, it can ask you for the key and password, and let you know that it can't check them. .sp 1 ! 3) You CAN use backspace to make corrections and you may use lower case letters. .SH OPTIONS .B s *************** *** 71,77 **** system will assume you are direct connected over secure communications and prompt you for your secret password. The \-s option also allows one to set the seed and count for complete ! control of the parameters. You can use keyinit -s in compination with the .I key command to set the seed and count if you do not like the defaults. --- 71,77 ---- system will assume you are direct connected over secure communications and prompt you for your secret password. The \-s option also allows one to set the seed and count for complete ! control of the parameters. You can use keyinit -s in combination with the .I key command to set the seed and count if you do not like the defaults. *** ./docs/keyinfo.1 Tue Jul 20 21:12:01 1993 --- ../skey/./docs/keyinfo.1 Sat Jan 30 13:37:20 1999 *************** *** 8,28 **** .SH NAME keyinfo \- Shell script to extract sequence number and seed for S/Key challenges. .SH SYNOPSIS ! .B keyinfo [] .SH DESCRIPTION .I keyinfo Takes an optional S/Key system name and writes the current sequence number and seed found in the S/Key database /etc/skeykeys. The default system is ! the current system. Should be used as ! .sp 0 ! key latour ! .sp 0 ! or ! .sp 0 ! key cube ! .sp 0 ! Host latour is used for telnet via internet access. ! Host cube is used for dial\-in access. .sp 1 Useful in generation a list of passwords for use on a field trip, where telnet is the mode of access, by combining --- 8,29 ---- .SH NAME keyinfo \- Shell script to extract sequence number and seed for S/Key challenges. .SH SYNOPSIS ! .B keyinfo [[@]] .SH DESCRIPTION .I keyinfo Takes an optional S/Key system name and writes the current sequence number and seed found in the S/Key database /etc/skeykeys. The default system is ! the current system. ! .\" Should be used as ! .\" .sp 0 ! .\" key latour ! .\" .sp 0 ! .\" or ! .\" .sp 0 ! .\" key cube ! .\" .sp 0 ! .\" Host latour is used for telnet via internet access. ! .\" Host cube is used for dial\-in access. .sp 1 Useful in generation a list of passwords for use on a field trip, where telnet is the mode of access, by combining *************** *** 30,36 **** .I key in the form .sp 0 ! key \-n `keyinfo latour`|lpr .SH EXAMPLE .sh Usage example: --- 31,37 ---- .I key in the form .sp 0 ! key \-n `keyinfo ` | lp .SH EXAMPLE .sh Usage example: *************** *** 37,43 **** .sp 0 >keyinfo latour .sp 0 ! 0098 la91340 .sp 0 > .LP --- 38,44 ---- .sp 0 >keyinfo latour .sp 0 ! 98 la91340 .sp 0 > .LP *************** *** 44,52 **** .SH OPTIONS .LP .B ! the S/key system to go to get the information The default is system local system which will generate and error comment ! if S/key is not installed on the local system. .SH DIAGNOSTICS .SH BUGS .LP --- 45,55 ---- .SH OPTIONS .LP .B ! the S/key system to go to get the information. The default is system local system which will generate and error comment ! if S/key is not installed on the local system. If a username prefix ! is present ("\fIuser\fP@\fIhost\fP", or just "\fIuser@\fP") ! information for that user will be retrieved. .SH DIAGNOSTICS .SH BUGS .LP *** ./docs/keysu.1 Tue Jul 20 21:12:07 1993 --- ../skey/./docs/keysu.1 Fri Jan 29 23:36:08 1999 *************** *** 14,20 **** .SH OPTIONS .B the ID for the user to become. ! The defalt is root. .SH DIAGNOSTICS .SH FILES .TP --- 14,20 ---- .SH OPTIONS .B the ID for the user to become. ! The default is root. .SH DIAGNOSTICS .SH FILES .TP *************** *** 27,33 **** .BR skey(1), .BR keyinfo(1), .BR keyinit(1), ! .BR keylogin(1) .SH AUTHOR Command by Phil Karn, Neil M. Haller, John S. Walden .SH CONTACT --- 27,33 ---- .BR skey(1), .BR keyinfo(1), .BR keyinit(1), ! .BR keyauth(1) .SH AUTHOR Command by Phil Karn, Neil M. Haller, John S. Walden .SH CONTACT *** ./docs/skey.1 Tue Jul 20 21:12:10 1993 --- ../skey/./docs/skey.1 Fri Jan 29 23:35:48 1999 *************** *** 6,18 **** .TH KEY 1 "20 July 1993" .AT 3 .SH NAME ! S/key \- A proceedure to use one time passwords for accessing computer systems. .SH DESCRIPTION .I S/key ! is a proceedure for using one time password to authenticate access to ! compter systems. It uses 64 bits of information transformed by the MD4 algorithm. The user supplies the 64 bits in the form of 6 English ! words that are generated by a secure computer. Eg a pocket sized smart card or a PC/Macintosh, or a machine at work and printed on a sheet of paper. Example use of the S/key program --- 6,18 ---- .TH KEY 1 "20 July 1993" .AT 3 .SH NAME ! S/key \- A procedure to use one time passwords for accessing computer systems. .SH DESCRIPTION .I S/key ! is a procedure for using one time password to authenticate access to ! computer systems. It uses 64 bits of information transformed by the MD4 algorithm. The user supplies the 64 bits in the form of 6 English ! words that are generated by a secure computer. E.g. a pocket sized smart card or a PC/Macintosh, or a machine at work and printed on a sheet of paper. Example use of the S/key program *************** *** 22,28 **** .sp 0 >key 99 th91334 .sp 0 ! Enter password: .sp 0 OMEN US HORN OMIT BACK AHOY .sp 0 --- 22,28 ---- .sp 0 >key 99 th91334 .sp 0 ! Enter password: .sp 0 OMEN US HORN OMIT BACK AHOY .sp 0 *************** *** 29,44 **** > .sp The programs that are part of the S/Key system are keyinit, key, ! keyinfo, keysu, and keylogin. Keyinit is used to get your ID set up, key is used to get the onetime password each time, keyinfo is used to extract information from the S/Key database and the rest are system routines. ! For Lab 214 you must use keyinit on system latour and then telnet to ! system latour.bellcore.com (IP address 128.96.41.50) or if using dial\-in ! you will routed to system cube for S/Key by the security system. Use keyinit \-s ( for secure option) if you are doing the set up ! over insecure communications lines. These are telnet from outside ! Bellcore and MICOM dialin from off the Bellcore premises. .sp When you do "keyinit" you inform the system of your secret password. Running "key" then generates the --- 29,45 ---- > .sp The programs that are part of the S/Key system are keyinit, key, ! keyinfo, keysu, and keyauth. Keyinit is used to get your ID set up, key is used to get the onetime password each time, keyinfo is used to extract information from the S/Key database and the rest are system routines. ! .\" For Lab 214 you must use keyinit on system latour and then telnet to ! .\" system latour.bellcore.com (IP address 128.96.41.50) or if using dial\-in ! .\" you will routed to system cube for S/Key by the security system. Use keyinit \-s ( for secure option) if you are doing the set up ! over insecure communications lines. ! .\" These are telnet from outside ! .\" Bellcore and MICOM dialin from off the Bellcore premises. .sp When you do "keyinit" you inform the system of your secret password. Running "key" then generates the *************** *** 50,57 **** Password reference numbers count backward from 99. If you don't know this, the syntax for "key" will be confusing. .sp ! When typing in your one-time password to gain access to ! latour, backspace (^H) can be used to make corrections. You can enter the passwords using small letters, even though the "key" program gives them in caps. When you run "key -n 10 `keyinfo` | lpr", and you do not --- 51,58 ---- Password reference numbers count backward from 99. If you don't know this, the syntax for "key" will be confusing. .sp ! When typing in your one-time password to gain access, ! backspace (^H) can be used to make corrections. You can enter the passwords using small letters, even though the "key" program gives them in caps. When you run "key -n 10 `keyinfo` | lpr", and you do not *************** *** 77,89 **** retrieving the output is a big security hole. .sp Macintosh and a general purpose PC use ! are available. You may "download" them from the ! directory /usr/local/lib/key. .LP .SH SEE ALSO .BR keyinit(1), .BR keysu(1), ! .BR keylogin(1), .BR key(1), .BR keyinfo(1) .SH AUTHOR --- 78,91 ---- retrieving the output is a big security hole. .sp Macintosh and a general purpose PC use ! are available. ! .\" You may "download" them from the ! .\" directory /usr/local/lib/key. .LP .SH SEE ALSO .BR keyinit(1), .BR keysu(1), ! .BR keyauth(1), .BR key(1), .BR keyinfo(1) .SH AUTHOR *** ./skey/skeyinit.c Wed Jul 21 20:17:47 1993 --- ../skey/./skey/skeyinit.c Fri Jan 29 22:42:43 1999 *************** *** 15,21 **** int skeylookup __ARGS((struct skey *mp,char *name)); ! #define NAMELEN 2 int main(argc,argv) int argc; --- 15,21 ---- int skeylookup __ARGS((struct skey *mp,char *name)); ! #define NAMELEN 3 int main(argc,argv) int argc; *************** *** 38,44 **** tm = localtime(&now); strftime(tbuf, sizeof(tbuf), "%M%j", tm); gethostname(defaultseed,NAMELEN); ! strcpy(&defaultseed[NAMELEN],tbuf); pp = ppuser = getpwuid(getuid()); strcpy(me,pp->pw_name); --- 38,45 ---- tm = localtime(&now); strftime(tbuf, sizeof(tbuf), "%M%j", tm); gethostname(defaultseed,NAMELEN); ! if (!defaultseed[1]) defaultseed[1] = 'x'; ! strcpy(&defaultseed[NAMELEN - 1],tbuf); pp = ppuser = getpwuid(getuid()); strcpy(me,pp->pw_name); *** ./skey/su.c Tue Jul 20 21:12:15 1993 --- ../skey/./skey/su.c Sat Jan 30 13:04:50 1999 *************** *** 21,27 **** --- 21,31 ---- #include #include #include + #ifdef __sgi + char *readskeypass(char *buf, int n); + #else #include + #endif #include #include "skey.h" *************** *** 56,63 **** --- 60,69 ---- void rip(); char pbuf[256]; char skeyprompt[80]; + #ifndef __sgi struct sgttyb ttyf,ttysave; int fflags,lword,lwordsav; + #endif openlog("su", LOG_ODELAY, LOG_AUTH); *************** *** 124,129 **** --- 130,138 ---- printf("Password:"); fflush(stdout); + #ifdef __sgi + readskeypass(pbuf, sizeof(pbuf)); + #else /* Set normal line editing */ fflags = fcntl(fileno(stdin),F_GETFL,0); fcntl(fileno(stdin),F_SETFL,fflags & ~FNDELAY); *************** *** 159,164 **** --- 168,174 ---- fcntl(fileno(stdin),F_SETFL,fflags); ioctl(fileno(stdin),TIOCSETP,&ttysave); ioctl(fileno(stdin),TIOCLSET,&lwordsav); + #endif if(i == 0 && skeyverify(&skey,pbuf) == 0){ /* S/Key authentication succeeded */ *** ./skey/Makefile Tue Sep 21 20:44:14 1993 --- ../skey/./skey/Makefile Sat Jan 30 11:34:57 1999 *************** *** 4,11 **** # if this machine uses shared libraries, (such as Suns), uncomment the first # line, otherwise, uncomment the second ! LDFLAGS=-Bstatic ! #LDFLAGS= # if this machine has /usr/include/stdlib.h, uncomment the first line, # otherwise, uncomment the second --- 4,11 ---- # if this machine uses shared libraries, (such as Suns), uncomment the first # line, otherwise, uncomment the second ! #LDFLAGS=-Bstatic ! LDFLAGS= # if this machine has /usr/include/stdlib.h, uncomment the first line, # otherwise, uncomment the second *************** *** 17,29 **** CFLAGS=$(CDEBUGFLAGS) $(HASSTDLIB) ! $all: key keylogin skey.init keysu $(LIB) install: all man ! chmod 755 key keylogin skey.init keysu keyinfo keyinit ! chown root keylogin skey.init keysu keyinit ! cp keyinit skey.init key keylogin keysu keyinfo $(LBIN) ! chmod 4755 $(LBIN)/keylogin $(LBIN)/skey.init $(LBIN)/keysu # this assumes things are set up it /etc cp /etc/login /etc/login.$$ cp keylogin /etc/login --- 17,34 ---- CFLAGS=$(CDEBUGFLAGS) $(HASSTDLIB) ! RANLIB=ranlib ! INSTALL=install + all: keyauth key keylogin skey.init keysu $(LIB) + install: all man ! $(INSTALL) -m 755 key keyinfo keyinit $(LBIN) ! $(INSTALL) -m 4755 keylogin keyauth skey.init keysu $(LBIN) ! #chmod 755 key keylogin skey.init keysu keyinfo keyinit ! #chown root keylogin skey.init keysu keyinit ! #cp keyinit skey.init key keylogin keysu keyinfo $(LBIN) ! #chmod 4755 $(LBIN)/keylogin $(LBIN)/skey.init $(LBIN)/keysu # this assumes things are set up it /etc cp /etc/login /etc/login.$$ cp keylogin /etc/login *************** *** 36,61 **** man: cp *.1 /usr/local/man/man1 ! $(LIB): $(LIBOBJS) ar rc $(LIB) $(LIBOBJS) ! ranlib $(LIB) clean: ! rm *.o key keylogin skey.init keysu suid: all chown root keylogin skey.init keysu chmod 4755 keylogin skey.init keysu key: skey.o $(LIB) $(CC) $(CFLAGS) $(LDFLAGS) -o key skey.o $(LIB) ! keylogin: login.o skeylogin.o skeysubr.o md4.o put.o setenv.o getenv.o $(CC) $(CFLAGS) $(LDFLAGS) -o keylogin \ login.o getenv.o setenv.o skeylogin.o $(LIB) ! skey.init: skeyinit.o skeylogin.o skeysubr.o md4.o put.o $(CC) $(CFLAGS) $(LDFLAGS) -o skey.init \ skeyinit.o $(LIB) --- 41,70 ---- man: cp *.1 /usr/local/man/man1 ! $(LIB): $(LIBOBJS) ar rc $(LIB) $(LIBOBJS) ! $(RANLIB) $(LIB) clean: ! rm -f *.o key keylogin skey.init keysu $(LIB) suid: all chown root keylogin skey.init keysu chmod 4755 keylogin skey.init keysu + keyauth: auth.o skeylogin.o skeysubr.o md4.o put.o setenv.o getenv.o $(LIB) + $(CC) $(CFLAGS) $(LDFLAGS) -o keyauth \ + auth.o getenv.o setenv.o skeylogin.o $(LIB) + key: skey.o $(LIB) $(CC) $(CFLAGS) $(LDFLAGS) -o key skey.o $(LIB) ! keylogin: login.o skeylogin.o skeysubr.o md4.o put.o setenv.o getenv.o $(LIB) $(CC) $(CFLAGS) $(LDFLAGS) -o keylogin \ login.o getenv.o setenv.o skeylogin.o $(LIB) ! skey.init: skeyinit.o skeylogin.o skeysubr.o md4.o put.o $(LIB) $(CC) $(CFLAGS) $(LDFLAGS) -o skey.init \ skeyinit.o $(LIB) *** ./skey/setenv.c Tue Jul 20 21:12:10 1993 --- ../skey/./skey/setenv.c Thu Jan 28 20:18:08 1999 *************** *** 91,96 **** --- 91,97 ---- extern char **environ; register char **P; int offset; + char *_findenv(); while (_findenv(name, &offset)) /* if set multiple times */ for (P = &environ[offset];; ++P) *** ./skey/login.c Tue Sep 21 20:44:14 1993 --- ../skey/./skey/login.c Sat Jan 30 13:01:26 1999 *************** *** 31,43 **** --- 31,58 ---- #include #include + #ifdef __sgi + #include + #define UTMPX utmpx + #define ut_time ut_xtime + #else #include + #define UTMPX utmp + #endif #include #include #include #include #include + #ifdef __sgi + #include + #include + #define ANYP O_ANYP + #define CRMOD O_CRMOD + char *readskeypass(char *buf, int n); + #else #include + #endif #include #include #include *************** *** 61,67 **** char lastlog[] = "/usr/adm/lastlog"; struct passwd nouser = {"", "#nope", -1, -1, "", "", "", "", "" }; struct sgttyb ttyb; ! struct utmp utmp; char minusnam[16] = "-"; char *envinit[1]; /* now set by setenv calls */ /* --- 76,82 ---- char lastlog[] = "/usr/adm/lastlog"; struct passwd nouser = {"", "#nope", -1, -1, "", "", "", "", "" }; struct sgttyb ttyb; ! struct UTMPX utmp; char minusnam[16] = "-"; char *envinit[1]; /* now set by setenv calls */ /* *************** *** 291,296 **** --- 306,314 ---- printf("Password:"); fflush(stdout); + #ifdef __sgi + readskeypass(buf, sizeof(buf)); + #else /* Set normal line editing */ fflags = fcntl(fileno(stdin),F_GETFL,0); fcntl(fileno(stdin),F_SETFL,fflags & ~FNDELAY); *************** *** 329,334 **** --- 347,353 ---- fcntl(fileno(stdin),F_SETFL,fflags); ioctl(fileno(stdin),TIOCSETP,&ttysave); ioctl(fileno(stdin),TIOCLSET,&lwordsav); + #endif if(i == 0 && skeyverify(&skey,buf) == 0 && (pwd->pw_passwd[0] != '*' && pwd->pw_passwd[0] != '#' ) ){ *************** *** 423,428 **** --- 442,453 ---- #endif time(&utmp.ut_time); t = ttyslot(); + #ifdef __sgi + if (t > 0) { + pututxline(&utmp); + } + updwtmpx(WTMPX_FILE, &utmp); + #else if (t > 0 && (f = open("/etc/utmp", O_WRONLY)) >= 0) { lseek(f, (long)(t*sizeof(utmp)), 0); SCPYN(utmp.ut_line, tty); *************** *** 433,438 **** --- 458,464 ---- write(f, (char *)&utmp, sizeof(utmp)); close(f); } + #endif quietlog = access(qlog, F_OK) == 0; if ((f = open(lastlog, O_RDWR)) >= 0) { struct lastlog ll; *************** *** 559,564 **** --- 585,597 ---- rootterm(tty) char *tty; { + #ifdef __sgi + /* + * This is wrong! We should parse CONSOLE from /etc/defaults/login, + * and (for IRIX 6.5) check for ID-based privilege mechanism. + */ + return !strcmp(tty, "/dev/console"); + #else register struct ttyent *t; if ((t = getttynam(tty)) != NULL) { *************** *** 566,571 **** --- 599,605 ---- return (1); } return (0); + #endif } showmotd() *************** *** 589,599 **** --- 623,640 ---- stypeof(ttyid) char *ttyid; { + #ifdef __sgi + /* + * This is wrong! We should parse /etc/ttytype somehow. + */ + return "unknown"; + #else register struct ttyent *t; if (ttyid == NULL || (t = getttynam(ttyid)) == NULL) return (UNKNOWN); return (t->ty_type); + #endif } doremotelogin(host) *************** *** 724,729 **** --- 765,771 ---- char buf[128],*cp; long pattern,mask; char *strtok(); + long aton(); int permit_it; fp = fopen("/etc/skey.access","r"); *** ./skey/keyinfo Fri Jul 10 18:05:26 1992 --- ../skey/./skey/keyinfo Sat Jan 30 13:31:19 1999 *************** *** 1,17 **** ! #!/bin/ksh ! # search /etc/skeykeys on system latour for the skey string for ! # this user OR user specified in 1st parameter ! if [ -z "$1" ] ! then ! WHO=`/usr/ucb/whoami` ! else ! WHO=$1 fi ! if [ -f /etc/skeykeys ] ! then ! SKEYINFO=`/usr/bin/grep "^$WHO[ ]" /etc/skeykeys` else ! echo "Obtaining your keyinfo from LATOUR, please wait." 1>&2 ! SKEYINFO=`/usr/ucb/rsh latour cat /etc/skeykeys|/usr/bin/grep "^$WHO[ ]"` fi - echo $SKEYINFO|/usr/bin/awk '{print $2-1,$3}' --- 1,27 ---- ! #!/bin/sh ! # ! # Usage [user@] [host] ! # ! # Search /etc/skeykeys for the skey string. ! # ! WHO=`/bin/echo "$1" | /bin/cut -s -d@ -f1` ! WHERE=`/bin/echo "$1" | /bin/cut -d@ -f2` ! if [ -z "${WHO}" ]; then ! WHO=`/bin/whoami` fi ! ! if [ -z "${WHERE}" ]; then ! if [ -f /etc/skeykeys ]; then ! SKEYINFO=`/usr/bin/grep "^${WHO}[ ]" /etc/skeykeys` ! else ! echo "keyinit has never run successfully on this system." 1>&2 ! exit 1 ! fi else ! echo "Obtaining your keyinfo from ${WHERE}, please wait..." 1>& 2 ! SKEYINFO=`/usr/bsd/rsh ${WHERE} -n cat /etc/skeykeys|/usr/bin/grep "^${WHO}[ ]"` ! fi ! ! if [ -n "${SKEYINFO}" ]; then ! echo "${SKEYINFO}" | /usr/bin/awk '{print $2-1,$3}' fi *** ./skey/skeysubr.c Tue Jul 20 21:12:14 1993 --- ../skey/./skey/skeysubr.c Sat Jan 30 12:55:49 1999 *************** *** 7,12 **** --- 7,15 ---- #include #ifdef __MSDOS__ #include + #elif defined(__sgi) + #include + #include #else /* Assume BSD unix */ #include #include *************** *** 134,139 **** --- 137,179 ---- if((cp = strchr(buf,'\n')) != NULL) *cp = '\0'; } + + #ifdef __sgi + char * + readskeypass(char *buf, int n) + { + struct termio ttyb; + tcflag_t flags; + + /* Disable character echoing. */ + (void) ioctl(fileno(stdin), TCGETA, &ttyb); + flags = ttyb.c_lflag; + ttyb.c_lflag &= ~(ECHO | ECHOE | ECHOK | ECHONL); + (void) ioctl(fileno(stdin), TCSETAF, &ttyb); + + /* Read password */ + fgets(buf, n, stdin); + rip(buf); + + /* Restore character echo. */ + ttyb.c_lflag = flags; + (void) ioctl(fileno(stdin), TCSETAW, &ttyb); + + if (*buf == '\0') { + /* Null line entered; try again with echoing on. */ + printf(" (echo on)\nPassword:"); + fflush(stdout); + fgets(buf, sizeof(buf), stdin); + rip(buf); + } else { + puts(""); + } + + return buf; + } + #endif + + /************************/ #ifdef __MSDOS__ char * *************** *** 151,156 **** --- 191,230 ---- printf("\n"); rip(buf); return buf; + } + #elif defined(__sgi) + char * + readpass(char *buf, int n) + { + struct termio ttyb; + tcflag_t flags; + + /* Disable character echoing. */ + (void) ioctl(fileno(stdin), TCGETA, &ttyb); + flags = ttyb.c_lflag; + ttyb.c_lflag &= ~(ECHO | ECHOE | ECHOK | ECHONL); + (void) ioctl(fileno(stdin), TCSETAF, &ttyb); + + /* Read password */ + fgets(buf, n, stdin); + rip(buf); + + /* Restore character echo. */ + ttyb.c_lflag = flags; + (void) ioctl(fileno(stdin), TCSETAW, &ttyb); + + /* + * after the secret key is taken from the keyboard, the line feed is + * written to standard error instead of standard output. That means that + * anyone using the program from a terminal won't notice, but capturing + * standard output will get the key words without a newline in front of + * them. + */ + fprintf(stderr, "\n"); + fflush(stderr); + sevenbit(buf); + + return buf; } #else char * *** ./skey/skey.h Tue Jul 20 21:12:11 1993 --- ../skey/./skey/skey.h Sat Jan 30 13:05:57 1999 *************** *** 36,42 **** char *put8 __ARGS((char *out,char *s)); int etob __ARGS((char *out,char *e)); void rip __ARGS((char *buf)); ! int skeychallenge __ARGS((struct skey *mp,char *name)); int skeylookup __ARGS((struct skey *mp,char *name)); int skeyverify __ARGS((struct skey *mp,char *response)); --- 36,42 ---- char *put8 __ARGS((char *out,char *s)); int etob __ARGS((char *out,char *e)); void rip __ARGS((char *buf)); ! int skeychallenge __ARGS((struct skey *mp,char *name, char *prompt)); int skeylookup __ARGS((struct skey *mp,char *name)); int skeyverify __ARGS((struct skey *mp,char *response));