1 // Copyright 2000-2005 the Contributors, as shown in the revision logs.
2 // Licensed under the Apache Public Source License 2.0 ("the License").
3 // You may not use this file except in compliance with the License.
5 package org.ibex.crypto;
6 import org.ibex.util.*;
11 * Implementation of the "checkpassword" protocol; requires bash and
16 * http://cr.yp.to/checkpwd/interface.html
18 * A debian implementation can be found in the "fgetty" package, and
19 * gets installed in /bin/checkpassword.
21 public class CheckPassword {
22 public static boolean verify(String user, String pass) {
25 Runtime.getRuntime().exec(new String[] {
28 "checkpassword /bin/true 3<&0"
30 PrintWriter pw = new PrintWriter(p.getOutputStream());
35 // timestamp (ignored)
39 int exitcode = p.waitFor();
40 // FEATURE: grab errors off of stderr?
42 Log.error(CheckPassword.class, "exitcode " + exitcode);
44 } catch (Exception e) { Log.warn(CheckPassword.class, e); }