summaryrefslogtreecommitdiffstats
path: root/libexec/ftpd/skey-stuff.c
diff options
context:
space:
mode:
Diffstat (limited to 'libexec/ftpd/skey-stuff.c')
-rw-r--r--libexec/ftpd/skey-stuff.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/libexec/ftpd/skey-stuff.c b/libexec/ftpd/skey-stuff.c
new file mode 100644
index 0000000..b6aba40
--- /dev/null
+++ b/libexec/ftpd/skey-stuff.c
@@ -0,0 +1,29 @@
+/* Author: Wietse Venema, Eindhoven University of Technology.
+ *
+ * $Id$
+ */
+
+#include <stdio.h>
+#include <string.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);
+}
OpenPOWER on IntegriCloud