freebsd-nq/libexec/ftpd/skey-stuff.c
Andrey A. Chernov 43658eac64 Implement alternative strategy if it is impossible to confirm
password: ask for it, but don't tell that S/key password required.
It looks like non-s/key system from outside.

Additionally tell that s/key required when it is so for normal case
1996-10-18 17:09:26 +00:00

29 lines
624 B
C

/* Author: Wietse Venema, Eindhoven University of Technology.
*
* $Id: skey-stuff.c,v 1.3 1996/09/22 21:53:34 wosch Exp $
*/
#include <stdio.h>
#include <pwd.h>
#include <skey.h>
/* skey_challenge - additional password prompt stuff */
char *skey_challenge(name, pwd, pwok)
char *name;
struct passwd *pwd;
int pwok;
{
static char buf[128];
struct skey skey;
/* Display s/key challenge where appropriate. */
if (pwd == NULL || skeychallenge(&skey, pwd->pw_name, buf))
sprintf(buf, "Password required for %s.", name);
else if (!pwok)
strcat(buf, " (s/key required)");
return (buf);
}