1996-09-22 22:56:57 +01:00
|
|
|
/* Author: Wietse Venema, Eindhoven University of Technology.
|
|
|
|
*
|
1996-10-17 18:46:00 +01:00
|
|
|
* $Id: skey-stuff.c,v 1.4 1996/10/17 17:06:04 ache Exp $
|
1996-09-22 22:56:57 +01:00
|
|
|
*/
|
1994-08-21 20:09:58 +01:00
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <pwd.h>
|
|
|
|
|
|
|
|
#include <skey.h>
|
|
|
|
|
|
|
|
/* skey_challenge - additional password prompt stuff */
|
|
|
|
|
1996-10-17 18:06:04 +01:00
|
|
|
char *skey_challenge(name, pwd, pwok, sflag)
|
1994-08-21 20:09:58 +01:00
|
|
|
char *name;
|
|
|
|
struct passwd *pwd;
|
|
|
|
int pwok;
|
1996-10-17 18:06:04 +01:00
|
|
|
int *sflag;
|
1994-08-21 20:09:58 +01:00
|
|
|
{
|
|
|
|
static char buf[128];
|
|
|
|
struct skey skey;
|
1996-10-17 18:06:04 +01:00
|
|
|
char *username = pwd ? pwd->pw_name : ":";
|
1994-08-21 20:09:58 +01:00
|
|
|
|
|
|
|
/* Display s/key challenge where appropriate. */
|
|
|
|
|
1996-10-17 18:06:04 +01:00
|
|
|
*sflag = skeychallenge(&skey, username, buf);
|
1996-10-17 18:46:00 +01:00
|
|
|
if (*sflag)
|
|
|
|
sprintf(buf, "%s required for %s.",
|
|
|
|
pwok ? "Password" : "S/Key password", name);
|
1994-08-21 20:09:58 +01:00
|
|
|
return (buf);
|
|
|
|
}
|